/* Trainers Union — design tokens from the logo: deep navy + sky blue */
:root {
  --navy-950: #041327; --navy-900: #071f3d; --navy-800: #0c2c55; --navy-700: #143a6b; --navy-600: #1f4c86;
  --sky-200: #cfeffd; --sky-300: #a6e3fb; --sky-400: #6cd1fa; --sky-500: #36b5ec; --sky-600: #0f8fcb; --sky-700: #0a6e9e;
  --bg: #f3f6fb; --surface: #fff; --surface-2: #f7f9fc; --line: #e2e8f1; --line-2: #cfd8e5;
  --text: #0a1a31; --muted: #52627a; --faint: #8090a6;
  --ok: #0b8f63; --ok-bg: #e6f6ef; --bad: #d13a41; --bad-bg: #fdecec; --warn: #a96a06; --warn-bg: #fff4dc;
  --coral: #ff8f80; --gold: #e2ac3f; --silver: #9fb0c4; --bronze: #c98a5a;
  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 28px;
  --sh-1: 0 1px 2px rgb(7 31 61 / .06), 0 1px 1px rgb(7 31 61 / .03);
  --sh-2: 0 10px 28px -12px rgb(7 31 61 / .2), 0 2px 6px rgb(7 31 61 / .05);
  --sh-3: 0 28px 56px -20px rgb(7 31 61 / .35);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Plus Jakarta Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --num: 'Lexend', 'Plus Jakarta Sans', system-ui, sans-serif;
  --slab: 'Zilla Slab', Georgia, serif;
  --grad-dir: 90deg;
  --hdr: 68px;
  color-scheme: light;
}
:root[lang="ar"] { --font: 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', system-ui, 'Segoe UI', sans-serif; --grad-dir: 270deg; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hdr) + 12px); }
html, body { overflow-x: clip; max-width: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.015em; text-wrap: balance; }
:root[lang="ar"] h1, :root[lang="ar"] h2, :root[lang="ar"] h3 { letter-spacing: 0; line-height: 1.35; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--sky-500); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* (2026-11-10) The iPhone's white screen when the page was swiped sideways: a hidden label (.sr-only, absolute) inside a
   sideways scroller whose nearest positioned ancestor was OUTSIDE that scroller (the home slideshow's Start/Explore
   buttons, table rows, the segmented controls) was not part of the scroller's own scrolling: WebKit counted it, at its
   place in the far cards or columns, in the whole document's width (1,174 px at 390 px), and the page could be swiped
   into that empty width. Each sideways scroller is now the containing block of what it holds, so its hidden labels stay
   inside its own scrolling area. */
.car-track, .reels-track, .tbl-wrap, .seg, .gal-thumbs, .side nav { position: relative; }
/* the smallest phones (320 px): a long status badge in a table row wraps instead of pushing the page wider */
@media (max-width: 400px) { .tbl .badge { max-width: 100%; white-space: normal; } }
/* phones: a dashboard card never widens the page (at 320 px a segmented control's labels counted 2-4 px past the screen) */
@media (max-width: 640px) { .dash-main > .card, .dash-main > section { overflow-x: clip; } }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 200; background: var(--navy-900); color: #fff; padding: 10px 16px; border-radius: 10px; }
.skip:focus { top: 12px; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.i { display: inline-block; vertical-align: -.2em; width: 1.15em; height: 1.15em; flex: none; }
[dir="rtl"] .flip { transform: scaleX(-1); }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 20px; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sky-700); }
:root[lang="ar"] .eyebrow { letter-spacing: 0; font-size: .9rem; }
.sec-title { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); font-weight: 800; }
.sec-sub { color: var(--muted); margin-top: 8px; max-width: 60ch; }
.section { padding: clamp(48px, 7vw, 88px) 0; }

/* ---------- Buttons ---------- */
.btn { --b: var(--navy-900); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; font-weight: 700; font-size: .95rem; line-height: 1.2; border: 1px solid transparent; white-space: nowrap; transition: transform .18s var(--ease), box-shadow .2s var(--ease), background-color .2s, border-color .2s, color .2s; user-select: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--navy-900); color: #fff; box-shadow: 0 6px 16px -8px rgb(7 31 61 / .6); }
.btn-primary:hover { background: var(--navy-700); transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgb(7 31 61 / .55); }
.btn-sky { background: var(--sky-400); color: var(--navy-950); box-shadow: 0 8px 22px -10px rgb(54 181 236 / .9); }
.btn-sky:hover { background: var(--sky-300); transform: translateY(-1px); }
.btn-outline { background: var(--surface); border-color: var(--line-2); color: var(--navy-900); }
.btn-outline:hover { border-color: var(--navy-600); background: var(--surface-2); }
.btn-ghost { color: var(--navy-800); }
.btn-ghost:hover { background: rgb(7 31 61 / .06); }
.btn-glass { background: rgb(255 255 255 / .1); color: #fff; border-color: rgb(255 255 255 / .28); backdrop-filter: blur(8px); }
.btn-glass:hover { background: rgb(255 255 255 / .18); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(1.08); }
.btn-lg { min-height: 54px; padding: 14px 26px; font-size: 1.02rem; border-radius: 14px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--navy-800); transition: background .2s; }
.icon-btn:hover { background: rgb(7 31 61 / .07); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Badges, chips, meters ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; line-height: 1.5; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.sky { background: var(--sky-200); color: var(--sky-700); border-color: transparent; }
.badge.navy { background: var(--navy-900); color: #fff; border-color: transparent; }
.badge.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--navy-800); min-height: 36px; transition: all .18s var(--ease); }
button.chip:hover { border-color: var(--sky-500); }
.chip[aria-pressed="true"] { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.meter { display: inline-flex; gap: 3px; align-items: flex-end; vertical-align: middle; }
.meter i { width: 6px; border-radius: 2px; background: var(--line-2); }
.meter i:nth-child(1) { height: 8px; } .meter i:nth-child(2) { height: 11px; } .meter i:nth-child(3) { height: 14px; } .meter i:nth-child(4) { height: 17px; } .meter i:nth-child(5) { height: 20px; }
.meter i.on { background: linear-gradient(var(--sky-500), var(--navy-700)); }
.on-dark .meter i { background: rgb(255 255 255 / .2); }
.on-dark .meter i.on { background: var(--sky-400); }
.av { --h: 210; display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; font-weight: 700; font-size: .9rem; color: #fff; background: linear-gradient(135deg, hsl(var(--h) 70% 38%), hsl(calc(var(--h) - 15) 85% 58%)); box-shadow: inset 0 0 0 2px rgb(255 255 255 / .25); text-transform: uppercase; }
.av.sm { width: 32px; height: 32px; font-size: .75rem; }
.av.lg { width: 72px; height: 72px; font-size: 1.4rem; }
.av.xl { width: 96px; height: 96px; font-size: 1.9rem; }

/* ---------- Header ---------- */
.hdr { position: sticky; top: 0; z-index: 50; background: rgb(255 255 255 / .86); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid rgb(7 31 61 / .07); }
.hdr-in { height: var(--hdr); display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img { width: 46px; height: 46px; object-fit: cover; border-radius: 50%; mix-blend-mode: multiply; }
.brand b { display: block; font-family: var(--slab); font-size: 1.22rem; color: var(--navy-900); line-height: 1; letter-spacing: .01em; }
.brand small { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; margin-top: 3px; }
.nav { display: flex; align-items: center; gap: 2px; margin-inline: auto; }
.nav a { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: .92rem; color: var(--muted); white-space: nowrap; transition: color .2s, background .2s; }
.nav a:hover { color: var(--navy-900); background: rgb(7 31 61 / .05); }
.nav a[aria-current="page"] { color: var(--navy-900); }
.nav a[aria-current="page"]::after { content: ''; position: absolute; inset-inline: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--sky-500); }
.nav .count { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 9px; background: var(--bad); color: #fff; font-size: .7rem; font-weight: 700; }
.tools { display: flex; align-items: center; gap: 6px; flex: none; }
.lang-btn { min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line-2); font-weight: 700; font-size: .88rem; color: var(--navy-900); display: inline-flex; align-items: center; gap: 6px; transition: border-color .2s, background .2s; }
.lang-btn:hover { border-color: var(--navy-600); background: var(--surface-2); }
.role-menu { position: relative; }
.role-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line-2); cursor: pointer; background: var(--surface); transition: border-color .2s; }
:root[dir="rtl"] .role-menu summary { padding: 4px 4px 4px 10px; }
.role-menu summary::-webkit-details-marker { display: none; }
.role-menu summary:hover { border-color: var(--navy-600); }
.role-menu .who { display: grid; line-height: 1.15; }
.role-menu .who b { font-size: .84rem; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-menu .who small { font-size: .7rem; color: var(--sky-700); font-weight: 700; }
.role-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); width: min(300px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-3); padding: 8px; animation: pop .18s var(--ease); z-index: 60; }
.role-pop h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 8px 10px 6px; }
.role-pop button, .role-pop a[role], .demo-roles button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-align: start; min-height: 48px; }
.role-pop button:hover, .role-pop a[role]:hover, .demo-roles button:hover { background: var(--surface-2); }
.role-pop button[aria-checked="true"], .demo-roles button[aria-checked="true"] { background: var(--sky-200); }
.role-pop button span, .demo-roles button span { display: grid; line-height: 1.25; }
.role-pop button small, .demo-roles button small { color: var(--muted); font-size: .75rem; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.burger { display: none; }
@media (max-width: 1080px) {
  .burger { display: inline-grid; }
  .nav { overscroll-behavior: contain; position: absolute; inset-inline: 0; top: var(--hdr); flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 16px 18px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--sh-2); margin: 0; visibility: hidden; opacity: 0; transform: translateY(-8px); transition: all .22s var(--ease); max-height: calc(100svh - var(--hdr)); overflow-y: auto; }
  .hdr.open .nav { visibility: visible; opacity: 1; transform: none; }
  .nav a { padding: 12px 14px; font-size: 1rem; min-height: 48px; }
  .nav a[aria-current="page"] { background: var(--sky-200); }
  .nav a[aria-current="page"]::after { display: none; }
  .tools { margin-inline-start: auto; }
}
@media (max-width: 640px) {
  .brand small, .role-menu .who { display: none; }
  .brand b { font-size: 1.05rem; }
  .brand img { width: 40px; height: 40px; }
  .role-menu summary { padding: 3px !important; }
  .role-pop { position: fixed; top: calc(var(--hdr) + 6px); inset-inline: 12px; width: auto; max-height: calc(100svh - var(--hdr) - 18px); overflow-y: auto; overscroll-behavior: contain; }
  .lang-btn .lbl { display: none; }
}
/* Phones: the logo alone, so the cart, account, language and menu buttons all fit on one row (the row needs ~400px with the name). */
@media (max-width: 440px) { .brand span { display: none; } }
/* The narrowest phones, where the admin also has the notifications bell: the same buttons, a little smaller and closer. */
@media (max-width: 380px) { .hdr-in { gap: 8px; } .tools { gap: 2px; } .tools .icon-btn { width: 38px; } .lang-btn { padding: 6px 9px; } .role-menu summary > .i { display: none; } }
/* the admin's row holds the bell too: the logo alone a little longer, and the account button without the name */
@media (max-width: 490px) { .hdr.is-admin .brand span, .hdr.has-bell .brand span { display: none; } } /* the bell's room (a trainer's and a student's too since 2026-10-27) */
@media (max-width: 700px) { .hdr.is-admin .role-menu .who { display: none; } }

/* ---------- Video bands ---------- */
.vband { position: relative; isolation: isolate; overflow: hidden; background: var(--navy-950); color: #fff; }
.vband > video, .vband > .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.vband::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(var(--grad-dir), rgb(4 19 39 / .96) 0%, rgb(7 31 61 / .86) 45%, rgb(7 31 61 / .55) 100%); }
.on-dark .eyebrow, .vband .eyebrow { color: var(--sky-400); }

.hero { min-height: min(880px, calc(100svh - var(--hdr))); display: flex; align-items: center; padding: clamp(48px, 8vw, 96px) 0 clamp(72px, 9vw, 120px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 1.2rem + 4.4vw, 4.6rem); font-weight: 800; line-height: 1.04; margin-top: 18px; }
:root[lang="ar"] .hero h1 { line-height: 1.25; }
.hero h1 span { display: block; }
.hero h1 .accent { background: linear-gradient(90deg, var(--sky-400), #e8f8ff); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .15em; margin-bottom: -.15em; } /* room for descenders (y, p): the gradient only paints inside the box */
/* the heading's third line: what the platform covers, smaller than the two supplied lines (2026-10-30, docs/SEO.md) */
.hero h1 .h1-sub { margin-top: 14px; font-size: clamp(1.15rem, .95rem + .9vw, 1.65rem); font-weight: 700; line-height: 1.4; letter-spacing: normal; color: rgb(255 255 255 / .92); text-wrap: balance; }
.hero .tag { margin-top: 14px; font-size: clamp(1.05rem, .9rem + .6vw, 1.35rem); font-weight: 600; color: var(--sky-300); }
.hero p.lead { margin-top: 18px; max-width: 54ch; color: rgb(255 255 255 / .78); font-size: 1.05rem; }
.hero .row { margin-top: 30px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 44px; max-width: 560px; }
.hero-stats div { border-inline-start: 2px solid rgb(108 209 250 / .5); padding-inline-start: 12px; }
.hero-stats b { display: block; font-family: var(--num); font-size: 1.6rem; line-height: 1.1; }
.hero-stats span { font-size: .78rem; color: rgb(255 255 255 / .7); }
.seal { width: 92px; height: 92px; border-radius: 50%; background: #fff; padding: 4px; box-shadow: 0 0 0 6px rgb(255 255 255 / .12), var(--sh-3); }
.seal img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.preview { position: relative; border-radius: var(--r-xl); padding: 22px; background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .16); backdrop-filter: blur(16px); box-shadow: var(--sh-3); }
.preview-top { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: rgb(255 255 255 / .75); }
.preview-stage { height: clamp(200px, 26vw, 280px); display: grid; place-items: center; }
.preview-num { font-family: var(--num); font-weight: 700; font-size: clamp(5rem, 3rem + 7vw, 8.5rem); line-height: 1; color: #fff; text-shadow: 0 0 40px rgb(108 209 250 / .45); }
.preview-num.total { color: var(--sky-400); font-size: clamp(3rem, 2rem + 4vw, 5rem); }
.preview-num.total small { display: block; font-family: var(--font); font-size: .9rem; color: rgb(255 255 255 / .7); text-align: center; font-weight: 600; margin-bottom: 6px; }
.dots { display: flex; justify-content: center; gap: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: rgb(255 255 255 / .2); transition: background .2s, transform .2s; }
.dots i.on { background: var(--sky-400); transform: scale(1.15); }
.flash-in { animation: flashIn .14s var(--ease); }
@keyframes flashIn { from { opacity: 0; transform: scale(.9); } }

.phead { padding: clamp(36px, 6vw, 64px) 0 clamp(72px, 9vw, 104px); }
.phead h1 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 3rem); font-weight: 800; margin-top: 8px; }
.phead p { color: rgb(255 255 255 / .78); margin-top: 10px; max-width: 62ch; }
.phead .row { margin-top: 18px; }
.pbody { margin-top: calc(-1 * clamp(44px, 6vw, 64px)); position: relative; padding-bottom: 72px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: .85rem; color: rgb(255 255 255 / .7); flex-wrap: wrap; }
.crumbs a:hover { color: #fff; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card.pad { padding: clamp(18px, 2.4vw, 26px); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-h h2, .card-h h3 { font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.lift { transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s; }
.lift:hover { transform: translateY(-4px); box-shadow: var(--sh-2); border-color: var(--line-2); }

.tabs-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh-2); margin-bottom: 24px; }
.seg { overscroll-behavior-x: contain; display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; min-height: 40px; border-radius: 10px; font-weight: 700; font-size: .9rem; color: var(--muted); white-space: nowrap; transition: all .2s var(--ease); }
.seg a:hover, .seg button:hover { color: var(--navy-900); }
.seg [aria-current="page"], .seg [aria-pressed="true"] { background: var(--surface); color: var(--navy-900); box-shadow: var(--sh-1), 0 0 0 1px var(--line); }
.seg.dark [aria-current="page"] { background: var(--navy-900); color: #fff; box-shadow: none; }

/* Track cards (home) */
.track { overflow: hidden; display: flex; flex-direction: column; }
.track-vis { position: relative; height: 210px; overflow: hidden; background: radial-gradient(120% 120% at 20% 0%, var(--navy-700), var(--navy-950)); display: grid; place-items: center; }
.track-vis::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgb(255 255 255 / .05) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .05) 1px, transparent 1px); background-size: 28px 28px; mask-image: radial-gradient(circle at center, #000 30%, transparent 80%); }
.track-vis > * { position: relative; z-index: 1; transition: transform .5s var(--ease); }
.track:hover .track-vis > * { transform: scale(1.06); }
.track-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.track-body h3 { font-size: 1.35rem; font-weight: 800; }
.track-body .row:last-child { margin-top: auto; padding-top: 6px; }
.track:hover { border-color: var(--sky-400); box-shadow: 0 24px 50px -24px rgb(15 143 203 / .45); }
.anzan-vis { display: flex; gap: 18px; font-family: var(--num); font-weight: 700; font-size: 4.2rem; color: #fff; }
.anzan-vis span { animation: seq 3s infinite; opacity: .15; }
.anzan-vis span:nth-child(2) { animation-delay: .6s; } .anzan-vis span:nth-child(3) { animation-delay: 1.2s; } .anzan-vis span:nth-child(4) { animation-delay: 1.8s; color: var(--coral); }
@keyframes seq { 0%, 100% { opacity: .15; transform: none; } 8%, 22% { opacity: 1; transform: translateY(-4px); text-shadow: 0 0 30px rgb(108 209 250 / .7); } 32% { opacity: .15; } }
.mini-grid { display: grid; grid-template-columns: repeat(10, 14px); gap: 4px; direction: ltr; }
.mini-grid i { width: 14px; height: 14px; border-radius: 3px; background: rgb(255 255 255 / .1); }
.mini-grid i.c { background: rgb(108 209 250 / .35); }
.mini-grid i.c.h { animation: cell 3s infinite; }
@keyframes cell { 0%, 100% { background: rgb(108 209 250 / .35); } 10%, 20% { background: var(--sky-400); box-shadow: 0 0 14px var(--sky-400); } 30% { background: rgb(108 209 250 / .35); } }

.steps { counter-reset: s; }
.step { padding: 24px; position: relative; }
.step .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--sky-200); color: var(--navy-800); margin-bottom: 16px; }
.step .ic .i { width: 24px; height: 24px; }
.step h3 { font-size: 1.05rem; font-weight: 700; }
.step p { color: var(--muted); font-size: .92rem; margin-top: 6px; }
.step::before { counter-increment: s; content: '0' counter(s); position: absolute; top: 20px; inset-inline-end: 22px; font-family: var(--num); font-weight: 700; font-size: 1.6rem; color: var(--line-2); }

/* ---------- Level picker (training) ---------- */
.train-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); grid-template-areas: "levels cfg" "rest cfg"; grid-template-rows: auto 1fr; gap: 24px; align-items: start; }
.tl-levels { grid-area: levels; } .tl-rest { grid-area: rest; } .train-layout .cfg { grid-area: cfg; }
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.lvl { text-align: start; padding: 18px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 12px; transition: transform .22s var(--ease), border-color .22s, box-shadow .22s; position: relative; }
.lvl:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--line-2); }
.lvl[aria-checked="true"] { border-color: var(--navy-800); box-shadow: 0 0 0 4px rgb(54 181 236 / .18), var(--sh-2); }
.lvl[aria-checked="true"]::after { content: ''; position: absolute; top: 14px; inset-inline-end: 14px; width: 22px; height: 22px; border-radius: 50%; background: var(--navy-900) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat; animation: pop .2s var(--ease); }
.lvl-top { display: flex; align-items: center; gap: 10px; }
.lvl-n { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-family: var(--num); font-weight: 700; font-size: 1.25rem; color: #fff; background: linear-gradient(135deg, var(--navy-700), var(--navy-950)); flex: none; }
.lvl.custom .lvl-n { background: linear-gradient(135deg, var(--sky-500), var(--sky-700)); }
.lvl .lt { display: block; font-size: 1rem; font-weight: 700; }
.lvl small { color: var(--muted); font-size: .8rem; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: .82rem; }
.specs div { display: flex; flex-direction: column; }
.specs span { color: var(--faint); font-size: .74rem; }
.specs b { font-weight: 700; }
.cfg { position: sticky; top: calc(var(--hdr) + 16px); }
.cfg-h { padding: 22px 22px 0; }
.cfg-h h2 { font-size: 1.3rem; font-weight: 800; margin-top: 6px; }
.cfg-b { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field > .lbl { font-weight: 700; font-size: .88rem; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.field > label output, .field > .lbl output { font-family: var(--num); color: var(--sky-700); font-weight: 700; }
.field .hint { font-size: .8rem; color: var(--muted); }
.field .err { font-size: .82rem; color: var(--bad); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.field .err:empty { display: none; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--surface); }
.stepper button { width: 48px; height: 44px; display: grid; place-items: center; color: var(--navy-800); transition: background .15s; }
.stepper button:hover { background: var(--surface-2); }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper output { flex: 1; text-align: center; font-family: var(--num); font-weight: 700; font-size: 1.1rem; }
input[type="range"] { width: 100%; accent-color: var(--navy-800); height: 28px; }
.input, select.input, textarea.input { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); transition: border-color .2s, box-shadow .2s; font-size: 1rem; }
textarea.input { min-height: 90px; resize: vertical; }
/* A date field: phones (iOS Safari above all) draw it at their own width and height and centre its value, so it spilled
   out of its box. Without the native look it keeps the box of every other field; tapping it still opens the date picker. */
input[type="date"].input { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; height: 46px; line-height: 24px; }
input[type="date"].input::-webkit-date-and-time-value { text-align: start; margin: 0; min-height: 24px; }
.input:focus { outline: none; border-color: var(--sky-600); box-shadow: 0 0 0 4px rgb(54 181 236 / .18); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.summary-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.summary-strip div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.summary-strip > div > span:first-child { display: block; font-size: .74rem; color: var(--faint); }
.summary-strip b { font-size: .95rem; }
.diff-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 12px; background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); color: #fff; }
.diff-row small { color: rgb(255 255 255 / .7); }
@media (max-width: 1024px) { .train-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "levels" "cfg" "rest"; grid-template-rows: auto; } .cfg { position: static; } }

/* ---------- Guides: written-problem instructions, level guide and its map ---------- */
.guide summary { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 800; cursor: pointer; list-style: none; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after { content: ''; width: 9px; height: 9px; margin-inline-start: auto; flex: none; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; }
.guide[open] summary::after { transform: rotate(-135deg); }
.guide h3 { font-size: .8rem; font-weight: 700; color: var(--sky-700); margin: 18px 0 6px; }
.guide p, .guide li { font-size: .93rem; line-height: 1.7; }
.guide ol { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.g-how { margin-top: 14px; counter-reset: g; }
.g-how li { counter-increment: g; display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 12px; }
.g-how li::before { content: counter(g); grid-row: span 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--navy-900); color: #fff; font-family: var(--num); font-weight: 700; font-size: .85rem; }
.g-how span { color: var(--muted); }
.g-ex li { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.g-ex b { font-size: 1.15rem; }
.g-ex small { color: var(--muted); font-size: .86rem; }
.g-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.g-steps i { font-style: normal; font-weight: 600; font-size: .88rem; padding: 2px 10px; border-radius: 8px; background: var(--sky-200); color: var(--sky-700); }
.g-tip { display: flex; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.g-tip .i { flex: none; margin-top: 3px; }
.guide .hint { font-size: .84rem; color: var(--muted); margin-top: 8px; }
/* Add/subtract map: bead values and friends pairs */
.fmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; font-family: var(--num); font-variant-numeric: tabular-nums; }
.fmap.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fmap span { padding: 6px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fmap b { color: var(--ok); }
.fmap .neg b { color: var(--bad); }
/* Multiply/divide map: the times table (division reads it backwards, so it gets its own colour) */
.tmap { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; max-width: 460px; font-family: var(--num); font-variant-numeric: tabular-nums; container-type: inline-size; }
.tmap > * { aspect-ratio: 1; display: grid; place-items: center; border-radius: 6px; min-width: 0; font-size: clamp(.62rem, 3.6cqi, .95rem); }
.tmap b { background: var(--navy-900); color: #fff; }
.tmap span { background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; color: var(--navy-800); }
.tmap b.on { background: var(--sky-600); }
.tmap span.on { background: var(--sky-200); border-color: var(--sky-500); }
.tmap.div b { background: var(--warn); }
.tmap.div span { background: var(--warn-bg); border-color: transparent; }

/* 10x10 grid */
.g10 { --cell: 1fr; display: grid; grid-template-columns: 26px repeat(10, minmax(0, 1fr)); gap: 3px; width: 100%; max-width: 520px; margin-inline: auto; direction: ltr; container-type: inline-size; }
.g10 .h, .g10 .rh, .g10 .c { aspect-ratio: 1; display: grid; place-items: center; border-radius: 6px; font-family: var(--num); font-variant-numeric: tabular-nums; min-width: 0; }
.g10 .h { aspect-ratio: auto; height: 28px; font-size: clamp(.55rem, 2.2cqi, .7rem); font-weight: 700; color: var(--faint); background: var(--surface-2); border: 1px solid var(--line); transition: all .18s; padding: 0; }
.g10 button.h:hover { border-color: var(--sky-500); color: var(--navy-900); }
.g10 .h.on { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.g10 .rh { font-size: clamp(.55rem, 2.2cqi, .72rem); color: var(--faint); font-weight: 700; aspect-ratio: auto; border-radius: 6px; padding: 0; }
.g10 button.rh:hover { background: var(--surface-2); }
.g10 .rh.on { background: var(--sky-200); color: var(--sky-700); }
.g10 .c { background: var(--surface-2); border: 1px solid var(--line); font-size: clamp(.72rem, 3.4cqi, 1.05rem); font-weight: 600; color: var(--navy-800); transition: background .2s, color .2s; }
.g10 .c.col { background: rgb(108 209 250 / .14); border-color: rgb(54 181 236 / .35); }
.g10 .c.rowon { background: rgb(7 31 61 / .05); }
.g10 .c.hit { background: var(--navy-900); color: #fff; border-color: var(--navy-900); font-weight: 700; }
.g10 input.c { width: 100%; text-align: center; padding: 0; outline: none; }
.g10 input.c:focus { border-color: var(--sky-600); box-shadow: 0 0 0 2px rgb(54 181 236 / .3); }
.g10.dark .c { background: rgb(255 255 255 / .05); border-color: rgb(255 255 255 / .08); color: rgb(255 255 255 / .7); }
.g10.dark .c.col { background: rgb(108 209 250 / .1); }
.g10.dark .c.hit { background: var(--sky-400); color: var(--navy-950); }
.g10.dark .h, .g10.dark .rh { background: transparent; border-color: rgb(255 255 255 / .1); color: rgb(255 255 255 / .5); }
.g10.dark .h.on { background: rgb(108 209 250 / .2); color: var(--sky-300); }
.g10.dark .rh.on { color: var(--sky-300); background: rgb(108 209 250 / .12); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 12px; justify-content: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; }

/* ---------- Lists, comps, exams ---------- */
.comp { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.comp h3 { font-size: 1.12rem; font-weight: 800; }
.comp p { color: var(--muted); font-size: .92rem; }
.meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px 14px; font-size: .84rem; }
.meta div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.meta span { color: var(--faint); font-size: .74rem; display: flex; align-items: center; gap: 5px; }
.meta b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium { display: flex; gap: 8px; flex-wrap: wrap; }
.podium > span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .8rem; font-weight: 600; }
:root[dir="rtl"] .podium > span { padding: 4px 4px 4px 10px; }
.comp .row:last-child { margin-top: auto; }
.owner-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); font-weight: 600; }

.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.board li { display: grid; grid-template-columns: 36px 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid transparent; animation: rowIn .45s var(--ease) both; }
.board li:nth-child(2) { animation-delay: .05s; } .board li:nth-child(3) { animation-delay: .1s; } .board li:nth-child(4) { animation-delay: .15s; } .board li:nth-child(5) { animation-delay: .2s; } .board li:nth-child(n+6) { animation-delay: .25s; }
.board .rk { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-family: var(--num); font-weight: 700; background: var(--surface); border: 1px solid var(--line); }
.board li:nth-child(1) .rk { background: var(--gold); color: #fff; border: 0; }
.board li:nth-child(2) .rk { background: var(--silver); color: #fff; border: 0; }
.board li:nth-child(3) .rk { background: var(--bronze); color: #fff; border: 0; }
.board .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .sc { font-family: var(--num); font-weight: 700; color: var(--navy-800); }
.board li.me { background: var(--sky-200); border-color: var(--sky-400); animation: meIn .8s var(--ease) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes meIn { 0% { opacity: 0; transform: scale(.94); } 60% { transform: scale(1.02); } }

.banner { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--sh-2); flex-wrap: wrap; margin-bottom: 24px; animation: rise .4s var(--ease); }
.banner .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.banner .ic .i { width: 24px; height: 24px; }
.banner.pending .ic { background: var(--warn-bg); color: var(--warn); }
.banner.ok .ic { background: var(--ok-bg); color: var(--ok); }
.banner.bad .ic { background: var(--bad-bg); color: var(--bad); }
.banner.info .ic { background: var(--sky-200); color: var(--sky-700); }
.banner .pending-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-inline-end: 6px; animation: pulse 1.6s infinite; color: var(--warn); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.teacher { display: flex; flex-direction: column; overflow: hidden; }
.teacher-top { padding: 24px 24px 0; display: flex; gap: 16px; align-items: center; }
.teacher-top h3 { font-size: 1.15rem; font-weight: 800; }
.teacher-top p { color: var(--muted); font-size: .85rem; }
.teacher-body { padding: 16px 24px 24px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.teacher-body > p { color: var(--muted); font-size: .92rem; }
.teacher-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.teacher-stats div { padding: 10px; text-align: center; }
.teacher-stats div + div { border-inline-start: 1px solid var(--line); }
.teacher-stats b { display: block; font-family: var(--num); font-size: 1.05rem; }
.teacher-stats span { font-size: .72rem; color: var(--faint); }
.teacher-body .row:last-child { margin-top: auto; }
.teacher.is-mine { border-color: var(--sky-500); box-shadow: 0 0 0 4px rgb(54 181 236 / .14); }
.direct { background: linear-gradient(160deg, var(--navy-900), var(--navy-700)); color: #fff; border: 0; }
.direct p { color: rgb(255 255 255 / .75) !important; }

/* ---------- KPI + charts ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 118px), 1fr)); gap: 12px; }
.kpi { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.kpi .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--sky-200); color: var(--navy-800); }
.kpi b { font-family: var(--num); font-size: 1.75rem; line-height: 1; font-weight: 700; }
.kpi span { color: var(--muted); font-size: .84rem; font-weight: 600; }
.kpi.alert .ic { background: var(--warn-bg); color: var(--warn); }
.chart { width: 100%; }
.plot { position: relative; height: 200px; background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 25%; border-bottom: 1px solid var(--line-2); }
.plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; animation: reveal 1.1s var(--ease) both; }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.plot .ln { fill: none; stroke: var(--sky-600); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.plot .area { opacity: .9; }
.plot .dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--sky-600); animation: rise .4s var(--ease) both .6s; }
.plot .dot:hover::after { content: attr(data-v); position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); background: var(--navy-900); color: #fff; font-size: .72rem; padding: 2px 8px; border-radius: 6px; white-space: nowrap; font-family: var(--num); }
.xlabels { display: flex; justify-content: space-between; font-size: .72rem; color: var(--faint); margin-top: 8px; gap: 4px; }
.xlabels span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars { display: flex; align-items: flex-end; gap: clamp(6px, 2vw, 16px); height: 200px; border-bottom: 1px solid var(--line-2); padding-top: 22px; }
.bars div { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bars i { width: 100%; max-width: 44px; border-radius: 8px 8px 3px 3px; background: linear-gradient(var(--sky-500), var(--navy-700)); transform-origin: bottom; animation: grow .8s var(--ease) both; }
.bars div:nth-child(2) i { animation-delay: .05s; } .bars div:nth-child(3) i { animation-delay: .1s; } .bars div:nth-child(4) i { animation-delay: .15s; } .bars div:nth-child(5) i { animation-delay: .2s; } .bars div:nth-child(n+6) i { animation-delay: .25s; }
.bars em { font-style: normal; font-family: var(--num); font-size: .75rem; font-weight: 700; color: var(--navy-800); }
@keyframes grow { from { transform: scaleY(0); } }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(0, 130px) minmax(0, 1fr) 46px; gap: 12px; align-items: center; font-size: .86rem; }
.hbar > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.track-line { height: 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.track-line i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--sky-500), var(--navy-700)); transform-origin: left; animation: growX .9s var(--ease) both; }
[dir="rtl"] .track-line i { transform-origin: right; background: linear-gradient(270deg, var(--sky-500), var(--navy-700)); }
@keyframes growX { from { transform: scaleX(0); } }
.hbar b { font-family: var(--num); text-align: end; }
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: center; }
.donut { width: 168px; height: 168px; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 14; animation: dash 1s var(--ease) both; }
@keyframes dash { from { stroke-dasharray: 0 100; } }
.donut-legend { display: grid; gap: 8px; font-size: .86rem; }
.donut-legend span { display: flex; align-items: center; gap: 8px; }
.donut-legend i { width: 12px; height: 12px; border-radius: 4px; }

/* ---------- Tables ---------- */
.tbl-wrap { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.tbl th { text-align: start; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); }
:root[lang="ar"] .tbl th { letter-spacing: 0; font-size: .8rem; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover { background: var(--surface-2); }
.tbl tr:last-child td { border-bottom: 0; }
.who-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-cell b { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-cell small { color: var(--faint); font-size: .76rem; }
.acc { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.acc .track-line { flex: 1; height: 6px; }
@media (max-width: 900px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody { display: block; }
  .tbl tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 10px; background: var(--surface); }
  .tbl td { padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .tbl td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--faint); font-weight: 700; margin-bottom: 2px; }
  .tbl td.first { grid-column: 1 / -1; }
  .tbl td.actions { grid-column: 1 / -1; }
  .tbl tr:last-child td { border: 0; }
}

/* ---------- Dashboard shell ---------- */
.dash { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 24px; align-items: start; }
.side { position: sticky; top: calc(var(--hdr) + 16px); padding: 10px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-weight: 600; font-size: .92rem; color: var(--muted); transition: all .18s var(--ease); min-height: 44px; }
.side a:hover { background: var(--surface-2); color: var(--navy-900); }
.side a[aria-current="page"] { background: var(--navy-900); color: #fff; }
.side a .count { margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; background: var(--bad); color: #fff; font-size: .72rem; font-weight: 700; }
.side .who { display: flex; align-items: center; gap: 10px; padding: 10px 12px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.side .who b { display: block; font-size: .9rem; }
.side .who small { color: var(--muted); font-size: .76rem; }
.dash-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 20px; box-shadow: var(--sh-2); }
.dash-head h2 { font-size: 1.5rem; font-weight: 800; }
@media (max-width: 1024px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; padding: 6px; }
  .side .who { display: none; }
  .side nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .side nav::-webkit-scrollbar { display: none; }
  .side a { white-space: nowrap; flex: none; }
}
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters > .input { width: auto; flex: 1 1 180px; min-width: 0; }
.search { position: relative; flex: 2 1 220px; min-width: 0; }
.search .i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { padding-inline-start: 42px; }
.search.code-search { flex: 1 1 160px; } /* the student code's own box (Admin → Students): shorter than the name search */
.tq-bar { margin-bottom: 16px; align-items: center; } /* Admin → Trainers: the search above the cards */
.tq-bar > span:empty { display: none; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow b { display: block; font-weight: 700; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .grow small { color: var(--muted); font-size: .8rem; }
.req { animation: rise .35s var(--ease) both; }
/* On a phone the buttons of a request or registration go on a line of their own, so the details keep the width. */
@media (max-width: 560px) { .list-item.req { flex-wrap: wrap; } .list-item.req > .row { flex-basis: 100%; justify-content: flex-end; } }
.req.leaving { animation: leave .35s var(--ease) forwards; }
@keyframes leave { to { opacity: 0; transform: translateX(24px); } }
.toggle { position: relative; width: 48px; height: 28px; flex: none; appearance: none; border-radius: 14px; background: var(--line-2); cursor: pointer; transition: background .2s; }
.toggle::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .2s var(--ease); }
.toggle:checked { background: var(--navy-800); }
.toggle:checked::after { transform: translateX(20px); }
[dir="rtl"] .toggle:checked::after { transform: translateX(-20px); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.set-row:last-child { border-bottom: 0; }
.set-row b { display: block; }
.set-row small { color: var(--muted); }
/* A trainer's "What visitors see" (js/auth.js trainerForm) and the admin's moderation switches on a trainer's card */
.tp-show { border: 1px solid var(--line-2); border-radius: 14px; padding: 6px 14px 2px; margin: 0 0 14px; min-width: 0; }
.tp-show legend { font-weight: 700; font-size: .9rem; padding: 0 6px; display: inline-flex; align-items: center; gap: 6px; }
.tp-show .hint { margin: 4px 0 2px; font-size: .82rem; color: var(--muted); }
.tp-show .set-row { padding: 12px 0; flex-wrap: nowrap; }
.tp-show .set-row label { min-width: 0; }
.t-mod { display: grid; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.t-mod small.muted { color: var(--muted); font-weight: 400; margin: 0; }
.set-row small.tp-mod, .t-mod small { display: flex; align-items: center; gap: 6px; color: var(--warn, #b45309); font-weight: 600; margin-top: 4px; }

/* Skeleton / empty / denied */
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, #eaf0f7 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.1s infinite linear; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 44px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--sky-200); color: var(--navy-800); margin-bottom: 6px; }
.empty .ic .i { width: 30px; height: 30px; }
.empty h3, .empty h1 { font-size: 1.1rem; font-weight: 700; }
.empty p { color: var(--muted); max-width: 42ch; font-size: .92rem; }
.denied { max-width: 520px; margin: 0 auto; }
.denied .ic { background: var(--warn-bg); color: var(--warn); }

/* Profile */
.prof-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.prof-head .badge { white-space: normal; }
.prof-head h2 { font-size: 1.5rem; font-weight: 800; }
.prof-head .grow > div { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Platform hero for teachers */
.plat-id { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.plat-id .av { box-shadow: 0 0 0 4px rgb(255 255 255 / .18); }
.plat-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 22px; }
.plat-stats b { display: block; font-family: var(--num); font-size: 1.5rem; }
.plat-stats span { color: rgb(255 255 255 / .7); font-size: .82rem; }

/* ---------- Modal + toast ---------- */
dialog.modal { padding: 0; border: 0; background: transparent; width: min(620px, calc(100vw - 24px)); max-height: calc(100svh - 24px); overflow: visible; color: var(--text); }
dialog.modal.wide { width: min(860px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgb(4 19 39 / .55); backdrop-filter: blur(4px); animation: fade .2s; }
.modal-card { background: var(--surface); border-radius: 22px; box-shadow: var(--sh-3); display: flex; flex-direction: column; max-height: calc(100svh - 24px); animation: modalIn .26s var(--ease); }
dialog.closing .modal-card { animation: modalOut .16s ease-in forwards; }
dialog.closing::backdrop { opacity: 0; transition: opacity .16s; }
.modal-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px 12px 24px; }
:root[dir="rtl"] .modal-h { padding: 18px 24px 12px 20px; }
.modal-h h2 { font-size: 1.2rem; font-weight: 800; }
.modal-b { padding: 4px 24px 20px; overflow-y: auto; overscroll-behavior: contain; }
/* While a window is open the page behind it stays put (the gutter keeps the layout from shifting when the scrollbar goes) */
html { scrollbar-gutter: stable; }
html:has(dialog[open]) { overflow-y: hidden; }
.modal-f { padding: 14px 24px 20px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 40px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--navy-900); color: #fff; box-shadow: var(--sh-3); font-weight: 600; font-size: .92rem; animation: toastIn .3s var(--ease); }
.toast .i { color: var(--sky-400); }
.toast.bad .i { color: var(--coral); }
.toast.out { animation: toastOut .25s ease-in forwards; }
/* During a session (body.locked: Runner, the championship's sheet, Memory) nothing lands on the answer box, Next or Skip at
   the bottom (2026-10-31: a phone's keyboard puts them right there): news waits in the bell, a problem is said at the top. */
body.locked .toast:not(.bad) { display: none; }
body.locked .toasts { top: max(8px, env(safe-area-inset-top)); bottom: auto; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Runner (flash session) ---------- */
body.locked { overflow: hidden; }
.runner { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; color: #fff; background: radial-gradient(90% 70% at 50% 40%, #0f3462 0%, var(--navy-900) 45%, var(--navy-950) 100%); animation: fade .25s; overflow: hidden; }
.rn-top { display: flex; align-items: center; gap: 12px; padding: 12px clamp(12px, 3vw, 24px); padding-top: max(12px, env(safe-area-inset-top)); }
.rn-top .icon-btn { color: #fff; background: rgb(255 255 255 / .08); flex: none; } /* never squeezed away by the pills (2026-10-31) */
.rn-top .icon-btn:hover { background: rgb(255 255 255 / .16); }
.rn-title { min-width: 0; flex: 1; }
.rn-title b { display: block; font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rn-title span { display: block; font-size: .8rem; color: rgb(255 255 255 / .65); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rn-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgb(255 255 255 / .08); font-size: .85rem; font-weight: 700; white-space: nowrap; }
.rn-pill.warn { background: rgb(255 143 128 / .2); color: var(--coral); }
/* A crowded top bar, any two of the question, the time left, End and Hand in (a timed practice, a competition or an exam,
   its results too): on a phone exit / title / sound stay on the first row and the rest get a row of their own. (Until
   2026-10-31 only a timed practice did: elsewhere Exit and Sound were squeezed to nothing and Hand in pushed off the screen.) */
@media (max-width: 560px) {
  :is(.rn-top:has(#rn-q:not([hidden])):has(#rn-timer:not([hidden]), #rn-end, #rn-handin), .rn-top:has(#rn-timer:not([hidden])):has(#rn-end, #rn-handin)) { flex-wrap: wrap; row-gap: 4px; padding-bottom: 6px; }
  .runner:not(.tight) :is(.rn-top:has(#rn-q:not([hidden])):has(#rn-timer:not([hidden]), #rn-end, #rn-handin), .rn-top:has(#rn-timer:not([hidden])):has(#rn-end, #rn-handin)) :is(#rn-end, #rn-handin) { padding-block: 6px; min-height: 34px; }
  :is(.rn-top:has(#rn-q:not([hidden])):has(#rn-timer:not([hidden]), #rn-end, #rn-handin), .rn-top:has(#rn-timer:not([hidden])):has(#rn-end, #rn-handin)) > :is([data-rn="exit"], .tu-bot, .rn-title, [data-rn="sound"]) { order: -1; }
  :is(.rn-top:has(#rn-q:not([hidden])):has(#rn-timer:not([hidden]), #rn-end, #rn-handin), .rn-top:has(#rn-timer:not([hidden])):has(#rn-end, #rn-handin)) .rn-title { flex-basis: calc(100% - 180px); }
  :is(.rn-top:has(#rn-q:not([hidden])):has(#rn-timer:not([hidden]), #rn-end, #rn-handin), .rn-top:has(#rn-timer:not([hidden])):has(#rn-end, #rn-handin)) :is(#rn-end, #rn-handin) { margin-inline-start: auto; }
}
.rn-bar { height: 3px; background: rgb(255 255 255 / .08); }
.rn-bar i { display: block; height: 100%; background: var(--sky-400); transform-origin: left; transition: transform .3s var(--ease); }
[dir="rtl"] .rn-bar i { transform-origin: right; }
.rn-stage { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 16px clamp(16px, 4vw, 32px) max(24px, env(safe-area-inset-bottom)); }
.rn-stage > * { margin-block: auto; }
.runner .g10 { max-width: 400px; }
.rn-center { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; width: 100%; max-width: 760px; }
.cd { position: relative; width: 180px; height: 180px; display: grid; place-items: center; }
.cd svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.cd circle { fill: none; stroke-width: 6; }
.cd .bg { stroke: rgb(255 255 255 / .1); }
.cd .fg { stroke: var(--sky-400); stroke-linecap: round; stroke-dasharray: 100; animation: cdRing var(--d, .8s) linear forwards; }
@keyframes cdRing { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 100; } }
.cd b { font-family: var(--num); font-size: 4.5rem; font-weight: 700; animation: cdNum var(--d, .8s) var(--ease); }
@keyframes cdNum { from { opacity: 0; transform: scale(1.4); } 30% { opacity: 1; transform: scale(1); } }
.rn-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.rn-chips span { padding: 6px 12px; border-radius: 999px; background: rgb(255 255 255 / .08); font-size: .82rem; color: rgb(255 255 255 / .85); }
.flash-box { height: min(48vh, 360px); display: grid; place-items: center; width: 100%; }
.flash-num { font-family: var(--num); font-weight: 700; line-height: 1; letter-spacing: -.02em; font-size: min(36vw, 34vh, 300px); color: #fff; text-shadow: 0 0 60px rgb(108 209 250 / .35); font-variant-numeric: tabular-nums; white-space: nowrap; }
.flash-num[data-len="3"] { font-size: min(27vw, 30vh, 260px); }
.flash-num[data-len="4"] { font-size: min(21vw, 26vh, 220px); }
.flash-num[data-len="5"], .flash-num[data-len="6"] { font-size: min(16vw, 22vh, 180px); }
.flash-num[data-len="7"], .flash-num[data-len="8"], .flash-num[data-len="9"], .flash-num[data-len="10"], .flash-num[data-len="11"] { font-size: min(11vw, 18vh, 140px); }
.flash-num[data-len="12"] { font-size: min(7.5vw, 15vh, 110px); }
.flash-num.neg { color: var(--coral); text-shadow: 0 0 60px rgb(255 143 128 / .35); }
.flash-num.show { animation: flashIn .12s var(--ease); }
.rn-dots { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; max-width: 320px; }
.rn-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgb(255 255 255 / .16); transition: background .15s; }
.rn-dots i.on { background: var(--sky-400); }
/* Written problem: the whole question stays on screen above the answer box */
.written { font-family: var(--num); font-weight: 700; font-size: clamp(1.7rem, 1.1rem + 3.4vw, 2.8rem); line-height: 1.25; font-variant-numeric: tabular-nums; text-align: center; max-width: 100%; overflow-wrap: anywhere; }
.written.col { display: grid; width: max-content; min-width: 5ch; margin-inline: auto; padding: 0 10px 6px; border-bottom: 3px solid rgb(255 255 255 / .45); }
.written.col.long { font-size: clamp(1.25rem, 1rem + 1.6vw, 1.8rem); }
.written.col span { display: flex; justify-content: space-between; gap: .7em; }
.written.col i { font-style: normal; min-width: 1ch; color: rgb(255 255 255 / .7); }
.written .neg, .written .neg i { color: var(--coral); }
/* Answer review after training */
.rep-note { display: flex; gap: 8px; align-items: flex-start; text-align: start; font-size: .85rem; padding: 10px 12px; border-radius: 12px; background: rgb(255 255 255 / .08); color: rgb(255 255 255 / .85); }
.rep-note .i { flex: none; margin-top: 2px; }
.rn-eval { font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem); font-weight: 800; color: var(--sky-300); }
.review { list-style: none; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: start; }
.review li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .1); border-inline-start: 4px solid #4ade9c; }
.review li.bad { border-inline-start-color: var(--coral); }
.review .grow { flex: 1; min-width: 0; }
.review .seq { justify-content: flex-start; }
.review p { margin-top: 8px; font-size: .9rem; color: rgb(255 255 255 / .75); }
.review .rv-n { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgb(255 255 255 / .1); font-weight: 700; font-size: .85rem; }
.review .rv-mark { flex: none; color: #4ade9c; }
.review li.bad .rv-mark { color: var(--coral); }
.ans-form { width: min(440px, 100%); display: flex; flex-direction: column; gap: 14px; animation: rise .3s var(--ease); }
.ans-form label { font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem); font-weight: 700; }
.ans-input { width: 100%; text-align: center; font-family: var(--num); font-size: clamp(2.4rem, 1.6rem + 4vw, 3.8rem); font-weight: 700; padding: 14px; border-radius: 20px; background: rgb(255 255 255 / .06); border: 2px solid rgb(255 255 255 / .18); color: #fff; outline: none; transition: border-color .2s, box-shadow .2s; direction: ltr; }
.ans-input:focus { border-color: var(--sky-400); box-shadow: 0 0 0 6px rgb(108 209 250 / .15); }
.ans-input.shake { animation: shake .35s; border-color: var(--coral); }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
.ans-form .hint { color: rgb(255 255 255 / .55); font-size: .85rem; }
.ans-form .err { color: var(--coral); font-size: .9rem; min-height: 1.3em; font-weight: 600; }
.verdict { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.verdict .ring { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; animation: verdictIn .5s var(--ease); }
.verdict.ok .ring { background: rgb(11 143 99 / .2); color: #4ade9c; box-shadow: 0 0 0 10px rgb(11 143 99 / .08); }
.verdict.bad .ring { background: rgb(255 143 128 / .16); color: var(--coral); box-shadow: 0 0 0 10px rgb(255 143 128 / .06); }
.verdict .ring .i { width: 48px; height: 48px; stroke-width: 2.6; }
.verdict h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); font-weight: 800; animation: rise .4s var(--ease) .1s both; }
@keyframes verdictIn { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.compare div { padding: 14px; border-radius: 16px; background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .1); }
.compare span { display: block; font-size: .8rem; color: rgb(255 255 255 / .6); }
.compare b { font-family: var(--num); font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); }
.compare .is-right b { color: #4ade9c; }
.compare .is-wrong b { color: var(--coral); text-decoration: line-through; text-decoration-thickness: 2px; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; width: 100%; }
.metrics div { padding: 12px 8px; border-radius: 14px; background: rgb(255 255 255 / .05); animation: rise .45s var(--ease) both; }
.metrics div:nth-child(2) { animation-delay: .06s; } .metrics div:nth-child(3) { animation-delay: .12s; } .metrics div:nth-child(4) { animation-delay: .18s; } .metrics div:nth-child(5) { animation-delay: .24s; }
.metrics span { display: block; font-size: .74rem; color: rgb(255 255 255 / .6); }
.metrics b { font-family: var(--num); font-size: 1.2rem; }
@media (max-width: 560px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .metrics div:first-child { grid-column: 1 / -1; } }
.seq { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; direction: ltr; font-family: var(--num); }
.seq span { padding: 4px 10px; border-radius: 8px; background: rgb(255 255 255 / .07); font-weight: 600; }
.seq span.neg { color: var(--coral); }
.seq span.eq { background: var(--sky-400); color: var(--navy-950); font-weight: 700; }
.rn-sec { width: 100%; text-align: start; }
.rn-sec h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: rgb(255 255 255 / .55); margin-bottom: 10px; text-align: center; }
:root[lang="ar"] .rn-sec h3 { letter-spacing: 0; font-size: .88rem; }
.rn-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.rn-feedback { display: flex; flex-direction: column; align-items: center; gap: 10px; animation: rise .25s var(--ease); }
.rn-feedback b { font-family: var(--num); font-size: 2.2rem; }
.rn-summary .big, .ch-run .big { font-family: var(--num); font-size: clamp(3.2rem, 2rem + 6vw, 5.5rem); font-weight: 700; line-height: 1; background: linear-gradient(180deg, #fff, var(--sky-300)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rn-board { width: 100%; max-width: 520px; }
.rn-board .board li { background: rgb(255 255 255 / .06); color: #fff; }
.rn-board .board li .rk { background: rgb(255 255 255 / .1); border-color: transparent; color: #fff; }
.rn-board .board li .sc { color: var(--sky-300); }
.rn-board .board li.me { background: rgb(108 209 250 / .2); border-color: var(--sky-400); }

/* Footer */
.foot { background: var(--navy-950); color: rgb(255 255 255 / .7); padding: 40px 0 28px; font-size: .9rem; }
.foot-in { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.foot .seal { width: 56px; height: 56px; box-shadow: none; }
.foot b { color: #fff; font-family: var(--slab); font-size: 1.15rem; }
.foot-links { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.foot-links a:hover, .foot button:hover { color: #fff; }
.foot button { display: inline-flex; gap: 8px; align-items: center; color: rgb(255 255 255 / .7); min-height: 44px; }
/* The 2FA setup key: one tap selects it all, and it wraps on a phone. */
.tfa-key { display: block; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: 10px; font-size: 1.05rem; letter-spacing: .08em; word-break: break-all; user-select: all; }
/* The developer's credit: the last line of every page, quiet, under the footer's own content. */
.foot-credit { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgb(255 255 255 / .08); text-align: center; font-size: .78rem; color: rgb(255 255 255 / .5); }
.foot-credit a { color: rgb(255 255 255 / .75); text-decoration: underline; text-underline-offset: 3px; }
.foot-credit a:hover, .foot-credit a:focus-visible { color: #fff; }

/* Reveal + page transition */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
main.enter { animation: pageIn .35s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .preview-stage { height: 180px; }
}
@media (max-width: 480px) {
  .hero .row .btn { flex: 1 1 100%; }
  .compare b { font-size: 1.6rem; }
  .board li { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .board li .av { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
main:focus { outline: none; }
.tbl td .badge { white-space: normal; }
@media (max-width: 560px) {
  .tabs-bar { padding: 8px; gap: 8px; }
  .tabs-bar .seg { width: 100%; }
  .tabs-bar .seg a { flex: 1; justify-content: center; padding: 8px 6px; font-size: .84rem; }
  .tabs-bar .seg a .i { display: none; }
}
/* desktop menu: text only, so Memory Challenges and Vedic Mathematics fit beside the others (when it still does not fit: .hdr.fold) */
@media (min-width: 1081px) { .nav a { padding: 8px 8px; font-size: .88rem; } .nav a > .i { display: none; } }
@media (min-width: 1081px) and (max-width: 1439px) { .role-menu .who { display: none; } }
.wrap.hdr-in { width: min(1440px, 100% - 32px); }

/* Products */
.products-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.toggle:disabled { opacity: .4; cursor: not-allowed; }
.product { display: flex; flex-direction: column; overflow: hidden; }
.product-img { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: linear-gradient(135deg, var(--sky-200), var(--surface-2)); color: var(--navy-800); }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-img > .i { width: 56px; height: 56px; opacity: .55; }
.product-tag { position: absolute; top: 12px; inset-inline-start: 12px; box-shadow: var(--sh-1); }
.product-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product-body h3, .product-body h2 { font-size: 1.08rem; font-weight: 800; }
.product-body p { color: var(--muted); font-size: .9rem; }
.product-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.product-price b { font-size: 1.35rem; color: var(--navy-900); }
.product-price s { color: var(--faint); font-size: .92rem; }
.product.is-out .product-img img { filter: grayscale(1); opacity: .7; }
.product-thumb { width: 40px; height: 40px; border-radius: 10px; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--sky-200); color: var(--navy-800); }
.product-thumb.lg { width: 72px; height: 72px; border-radius: 14px; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Admin hub cards and homepage advertisements */
.hub-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 24px; text-align: start; width: 100%; font: inherit; color: inherit; cursor: pointer; }
.hub-card .ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--sky-200); color: var(--navy-800); margin-bottom: 6px; }
.hub-card .ic .i { width: 26px; height: 26px; }
.hub-card b { font-size: 1.1rem; font-weight: 800; }
.hub-card .muted { font-size: .9rem; }
.hub-card .go { margin-top: auto; padding-top: 10px; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .88rem; color: var(--sky-700); }
/* The admin menu has longer labels: keep it on one line on desktop */
.hdr.is-admin .nav a { font-size: .86rem; padding-inline: 8px; white-space: nowrap; }
@media (min-width: 1081px) { .hdr.is-admin .nav a > .i { display: none; } }

/* Courses */
a.product { color: inherit; text-decoration: none; }
.course-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .course-layout { grid-template-columns: minmax(0, 1fr); } }
.player { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.player.none { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 20px; color: var(--muted); background: var(--surface-2); border: 1.5px dashed var(--line-2); }
.player.none .i { width: 44px; height: 44px; color: var(--navy-800); opacity: .5; }
.player.none b { color: var(--text); }
.player.none span { font-size: .88rem; }
.lessons .list-item { border-radius: 12px; padding-inline: 8px; text-decoration: none; color: inherit; }
.lessons .list-item[aria-current] { background: var(--sky-200); }
.lesson-edit { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }

/* ---------- Shared card frame: products, level cards, advertisements, hub cards ---------- */
.nice { border: 1.5px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; }
.nice.lift:hover, a.nice:hover { border-color: var(--sky-500); }
.nice:focus-visible, .nice:focus-within { border-color: var(--sky-600); }
.bi-head { display: flex; flex-direction: column; gap: 6px; }
.eyebrow[lang="ar"] { letter-spacing: 0; font-size: .9rem; }
.btn-wa { background: #0a7558; color: #fff; }
.btn-wa:hover { background: #086249; transform: translateY(-1px); }
a.link { font-weight: 700; color: var(--navy-800); text-decoration: underline; text-underline-offset: 3px; }

/* Products page: one section per category, one picture shape per category */
.cat-sec { scroll-margin-top: calc(var(--hdr) + 16px); }
.cat-sec + .cat-sec { margin-top: clamp(40px, 6vw, 64px); }
.cat-sec .products-grid { margin-top: 22px; }
.cat-sec:focus { outline: none; }
.product-body { min-width: 0; }
.product-body h3, .product-body h2 { overflow-wrap: anywhere; }
.product-price small { font-size: .82rem; }
.product-price .ask { font-size: 1.05rem; color: var(--sky-700); }
.cat-game .product-img { aspect-ratio: 1; background: #fff; }
.cat-game .product-img img { object-fit: contain; }
.cat-exercise .product-img, .cat-book .product-img, .cat-iq .product-img { aspect-ratio: 7 / 5; }
.level-card { cursor: pointer; }
.no-cover { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--navy-800); opacity: .7; font-weight: 600; text-align: center; padding: 12px; }
.no-cover .i { width: 44px; height: 44px; }
.ed-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.reader { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
.reader .product { border-radius: var(--r); overflow: hidden; border: 1.5px solid var(--line-2); }
@media (max-width: 640px) { .reader { grid-template-columns: minmax(0, 1fr); } }
.code-steps { margin: 0 0 16px; padding-inline-start: 22px; display: grid; gap: 6px; color: var(--muted); font-size: .92rem; }
.code { font-size: 1.05rem; letter-spacing: .06em; user-select: all; white-space: nowrap; }
.code-box { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r); background: var(--ok-bg); border: 1.5px solid var(--ok); }
.code-box small { display: block; color: var(--ok); font-weight: 700; }
.code-box .code { font-size: 1.4rem; color: var(--navy-900); }

/* Home page: the four advertisement sections */
.home-feat { padding-bottom: clamp(48px, 7vw, 88px); }
.home-sec { padding-top: clamp(40px, 6vw, 72px); }
.home-sec .feat-grid, .home-sec .home-own { margin-top: 22px; }
.home-sec .feat-grid + .home-own { margin-top: 20px; }
.feat-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
.feat-card { display: grid; grid-template-columns: 200px minmax(0, 1fr); background: var(--surface); color: inherit; text-decoration: none; max-width: 100%; }
.feat-card:only-child { max-width: 760px; }
/* Every picture gets the same poster-shaped frame (2:3) and fills it edge to edge, centred, so no empty band is left inside the border.
   A picture of another shape is cropped around its centre, never stretched; "Read more" opens it whole. */
.feat-img { display: block; padding: 0; background: var(--navy-950); aspect-ratio: 2 / 3; align-self: start; width: 100%; }
button.feat-img { cursor: zoom-in; }
/* A poster or picture is always shown whole, in its own proportions: never cropped, never stretched */
.feat-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .4s var(--ease); }
button.feat-img:hover img { transform: scale(1.03); }
.feat-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.feat-body h3 { font-size: 1.15rem; font-weight: 800; }
.feat-text { color: var(--muted); font-size: .93rem; white-space: pre-line; overflow-wrap: anywhere; }
.feat-card .feat-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden; }
.feat-more { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-weight: 700; font-size: .88rem; color: var(--sky-700); }
.feat-more:hover { color: var(--navy-900); }
.feat-cta { margin-top: auto; padding-top: 6px; gap: 10px; }
.feat-full { display: grid; gap: 20px; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
.feat-full img { width: 100%; border-radius: var(--r); border: 1.5px solid var(--line-2); }
.feat-full .feat-text { font-size: 1rem; color: var(--text); margin-bottom: 18px; }
@media (max-width: 640px) {
  .feat-card { grid-template-columns: minmax(0, 1fr); }
  .feat-full { grid-template-columns: minmax(0, 1fr); }
  .feat-cta .btn { flex: 1 1 auto; }
}

/* Footer: social links */
.social { display: flex; gap: 10px; }
.social a { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .22); transition: background .2s, transform .2s var(--ease); }
.social a .i { width: 22px; height: 22px; }
.social a:hover { transform: translateY(-2px); }
.social .soc-facebook:hover { background: #1877f2; }
.social .soc-instagram:hover { background: linear-gradient(45deg, #f09433, #dc2743 50%, #bc1888); }
.social .soc-whatsapp:hover { background: #0a7558; }
.social a:focus-visible { outline-color: var(--sky-300); border-radius: 50%; }
/* Pictures fill their box without ever stretching it, whatever their own proportions are */
.product-img, .feat-img { position: relative; overflow: hidden; }
.product-img img { position: absolute; inset: 0; }
/* Product category tabs: one row on wide screens, a full-width column on phones (long names, no sideways scrolling) */
.cat-tabs a { white-space: nowrap; }
@media (max-width: 860px) { .cat-tabs { display: grid; width: 100%; } .cat-tabs a { justify-content: flex-start; white-space: normal; min-height: 44px; } }
.gate { max-width: 560px; margin: 22px auto 0; }

/* ---------- Carousel (phones only): one card per view ---------- */
.car-nav { display: none; }
/* (2026-11-08) Safari on the iPhone let the whole page be dragged sideways to a blank strip: the slideshow's cards, in
   their own scroller, still counted in the page's width (1158 px at 390), and Safari pans over that whatever the page's
   own overflow-x: clip. Clipped here, at the slideshow, the page is the screen's width again. */
.car { overflow-x: clip; }
@media (max-width: 640px) {
  /* overflow-y is closed on purpose: a row that can also move a few pixels up and down swallows the vertical swipe of the page */
  .car-track { display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
  .car-track::-webkit-scrollbar { display: none; }
  /* A card is a little narrower than the screen, so the next one peeks in and the section is shorter */
  .car-track > * { flex: 0 0 86%; scroll-snap-align: start; }
  .car-track .feat-body { padding: 14px 16px 16px; gap: 8px; }
  .car-track .feat-body h3 { font-size: 1.05rem; }
  .car-track .feat-text { -webkit-line-clamp: 3; line-clamp: 3; font-size: .88rem; }
  .car-nav { display: flex; align-items: center; justify-content: center; gap: 2px; margin-top: 8px; }
  .car-dot { width: 44px; height: 44px; display: grid; place-items: center; }
  .car-dot::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); transition: width .2s, background .2s; }
  .car-dot[aria-current]::before { width: 26px; border-radius: 6px; background: var(--navy-900); }
  /* Compact cards sit two to a row; long text, forms and tables keep the full width */
  .products-grid, .steps, .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hub-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .hub-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .products-grid .product-body { padding: 12px; gap: 8px; }
  .products-grid .product-body h3, .products-grid .product-body h2 { font-size: .92rem; }
  .products-grid .product-body p { font-size: .82rem; }
  .products-grid .product-price b { font-size: 1.12rem; }
  .products-grid .btn { white-space: normal; padding: 8px 10px; font-size: .82rem; }
  .products-grid .badge { white-space: normal; font-size: .72rem; }
  .products-grid .product-tag { top: 8px; inset-inline-start: 8px; }
  .step, .hub-card { padding: 16px; }
  .step::before { font-size: 1.15rem; top: 16px; inset-inline-end: 16px; }
  .step .ic { margin-bottom: 12px; }
}

/* ---------- Login, Create Account, profile ---------- */
.auth { padding: clamp(24px, 6vw, 64px) 0; min-height: calc(100svh - var(--hdr)); display: grid; align-items: center; }
.auth-card { width: min(460px, 100%); margin-inline: auto; padding: clamp(20px, 4vw, 32px); color: var(--text); box-shadow: var(--sh-3); }
.auth-head { display: grid; justify-items: center; text-align: center; gap: 6px; margin-bottom: 16px; }
.auth-head .seal { width: 72px; height: 72px; box-shadow: none; border: 1px solid var(--line); margin-bottom: 6px; }
.auth-head h1 { font-size: 1.6rem; font-weight: 800; }
.auth-note { display: flex; gap: 8px; align-items: flex-start; font-size: .84rem; font-weight: 600; background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 10px 12px; margin-bottom: 18px; }
.auth-card form { display: grid; gap: 14px; }
.pw { position: relative; }
.pw .input { padding-right: 50px; }
.pw .icon-btn { position: absolute; right: 1px; top: 1px; }
.auth-alt { text-align: center; margin-top: 16px; font-size: .92rem; }
.auth-sep { display: flex; align-items: center; gap: 12px; margin: 22px 0 8px; color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
:root[lang="ar"] .auth-sep { letter-spacing: 0; font-size: .86rem; }
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.demo-roles { border: 1px solid var(--line); border-radius: 14px; padding: 6px; }
.role-pop a[role], .role-pop .out { font-weight: 600; }
.role-pop .out { border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; }
.role-pop .sub { display: block; text-align: center; font-size: .8rem; color: var(--muted); padding: 10px; border-top: 1px solid var(--line); margin-top: 4px; }
.role-pop .sub:hover { color: var(--navy-900); }
.profile-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
@media (max-width: 760px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Home: "How a session works" with a session to try ---------- */
.how-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 28px; }
.how-grid .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; }
.step { transition: border-color .25s, box-shadow .25s; }
.step .ic { transition: background .25s, color .25s; }
.how[data-phase="1"] .step:nth-child(1), .how[data-phase="2"] .step:nth-child(2), .how[data-phase="3"] .step:nth-child(3), .how[data-phase="4"] .step:nth-child(4) { border-color: var(--sky-500); box-shadow: 0 0 0 4px rgb(54 181 236 / .16); }
.how[data-phase="1"] .step:nth-child(1) .ic, .how[data-phase="2"] .step:nth-child(2) .ic, .how[data-phase="3"] .step:nth-child(3) .ic, .how[data-phase="4"] .step:nth-child(4) .ic { background: var(--navy-900); color: #fff; }
.try { border-radius: var(--r-lg); background: radial-gradient(120% 120% at 20% 0%, var(--navy-700), var(--navy-950)); color: #fff; padding: 24px; min-height: 320px; display: grid; place-items: center; text-align: center; }
#try-stage { display: grid; justify-items: center; gap: 16px; width: 100%; }
.try-lbl { font-weight: 700; color: rgb(255 255 255 / .8); }
.try-levels { justify-content: center; gap: 8px; }
.try .chip { min-height: 44px; padding-inline: 16px; background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .28); color: #fff; }
.try .chip[aria-pressed="true"] { background: var(--sky-400); border-color: var(--sky-400); color: var(--navy-950); }
.try .preview-num { font-size: clamp(4rem, 3rem + 5vw, 6.5rem); }
.try-form { display: grid; gap: 12px; justify-items: center; width: min(280px, 100%); }
.try-form .input { text-align: center; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.try-res { display: grid; justify-items: center; gap: 6px; }
.try-res > .i { width: 48px; height: 48px; }
.try-res > b { font-size: 1.3rem; }
.try-res.ok > .i, .try-res.ok > b { color: var(--sky-300); }
.try-res.bad > .i, .try-res.bad > b { color: var(--coral); }
.try-res p { font-size: 1.15rem; }
.try-res small { color: rgb(255 255 255 / .7); }
@media (max-width: 900px) { .how-grid { grid-template-columns: minmax(0, 1fr); } .try { min-height: 280px; } }
/* The steps answer the pointer: the card lifts, its icon swings, and the panel plays that step */
.how .step { cursor: pointer; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.how .step:hover, .how .step:focus-visible { transform: translateY(-4px); border-color: var(--sky-500); }
.how .step:hover .ic, .how .step:focus-visible .ic { animation: swing .6s var(--ease); }
.how .step:hover::before, .how .step:focus-visible::before { color: var(--sky-500); }
.step::before { transition: color .25s; }
@keyframes swing { 30% { transform: rotate(-12deg) scale(1.12); } 60% { transform: rotate(8deg) scale(1.12); } }
#try-stage > * { animation: rise .3s var(--ease); }
#try-stage > .preview-num { animation-name: flashIn; }

/* ---------- Written problems: one column, fitted to the visible screen (phoneFit, js/runner.js) ---------- */
.ans-btns { display: flex; flex-direction: column; gap: 14px; }
.runner.tight .rn-top { padding-block: 6px; gap: 8px; row-gap: 4px; }
.runner.tight .rn-top .icon-btn { width: 36px; height: 36px; }
/* (the bar's second row on a phone, the question, the time left and Hand in, stays one row even 320 px wide) */
.runner.tight .rn-pill, .runner.tight .rn-top :is(#rn-end, #rn-handin) { padding: 4px 7px; gap: 4px; font-size: .8125rem; min-height: 30px; } /* (13 px: the time left stays readable) */
.runner.tight .rn-title span, .runner.tight .ans-form .hint, .runner.tight .rep-note { display: none; }
.runner.tight .rn-stage { padding-block: 6px; }
.runner.tight .ans-form { gap: 6px; animation: none; }
.runner.tight .ans-form label { font-size: .92rem; text-align: center; }
/* One answer box: it sits under the problem with Next and Skip beside it, and its label is kept for screen readers only.
   Placed by order, not by row number, so a line above the problem (the championship's "Question n of N") keeps it so. */
@media not all and (min-width: 560px) and (max-height: 500px) {
  .runner.tight .ans-form:not(.has-rem) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; position: relative; }
  .runner.tight .ans-form:not(.has-rem) > * { grid-column: 1 / -1; }
  .runner.tight .ans-form:not(.has-rem) > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .runner.tight .ans-form:not(.has-rem) > .ans-input { grid-column: 1; }
  .runner.tight .ans-form:not(.has-rem) > .ans-btns { grid-column: 2; }
  .runner.tight .ans-form:not(.has-rem) > :is(.err, .hint, .rep-note) { order: 1; }
  .runner.tight .ans-form:not(.has-rem) :is([data-rn="skip"], [data-ch="skip"]) { flex: none; width: 44px; }
  .runner.tight .ans-form:not(.has-rem) :is([data-rn="skip"], [data-ch="skip"]) .lbl { display: none; }
}
/* A phone on its side (2026-10-31): little height, much width. The problem on one side; the answer box, Next and Skip on
   the other, so a keyboard taking half of what height there is still leaves them all on screen. (Rows: one per item on the
   answer side, the last taking whatever the problem's height leaves.) By width, not orientation: an upright Android phone
   whose keyboard leaves the page wider than tall stays as it is. */
@media (min-width: 560px) and (max-height: 500px) {
  .runner .ans-form { width: min(760px, 100%); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: repeat(8, auto) 1fr; column-gap: 10px; row-gap: 0; align-items: center; }
  .runner .ans-form > * { grid-column: 2 / -1; margin: 0 0 8px; }
  .runner .ans-form > .written { grid-column: 1; grid-row: 1 / -1; align-self: center; margin: 0; margin-inline-end: clamp(6px, 3vw, 30px); }
  .runner .ans-form > .ans-input { grid-column: 2; }
  .runner .ans-form > .ans-btns { grid-column: 3; flex-direction: row; gap: 8px; }
  .runner .ans-form > :is(.err, .hint, .rep-note) { order: 1; }
  .runner.tight .ans-form { row-gap: 0; } /* (the spacing is each item's own margin: a gap would come between all nine rows) */
  .runner.tight .ans-form:not(.has-rem) > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .runner.tight .rn-top { padding-block: 4px; }
  .runner.tight .rn-top .icon-btn { width: 32px; height: 32px; }
  .runner.tight .rn-top .tu-bot { font-size: 28px; }
  .runner.tight .ans-form .written.col { line-height: 1.05; }
}
.runner.tight .ch-page-h { margin: 0; font-size: .78rem; }
.runner.tight .written.col { line-height: 1.12; padding-bottom: 2px; border-bottom-width: 2px; }
.runner.tight .ans-input { font-size: 1.5rem; line-height: 1.2; padding: 4px 10px; border-radius: 12px; }
.runner.tight .ans-form .err { min-height: 0; font-size: .8rem; }
.runner.tight .ans-form .err:empty { display: none; }
.runner.tight .ans-btns { flex-direction: row; gap: 8px; }
.runner.tight .ans-btns .btn { flex: 1; min-width: 0; min-height: 40px; padding: 6px 8px; font-size: .9rem; }
/* Written-problems results: totals, then the correct and the incorrect answers */
.rn-results { gap: 18px; }
.rn-results .metrics .is-ok b, .review .rv-right, .res-metrics .is-ok b { color: #4ade9c; }
.rn-results .metrics .is-bad b, .review .rv-wrong, .res-metrics .is-bad b { color: var(--coral); }
/* an exam's or competition's result in full (2026-10-31): as many columns as fit, two on a phone */
.res-metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 112px), 1fr)); }
.res-metrics .is-rank b { color: var(--sky-300); }
.res-metrics b span { display: inline; font-size: inherit; color: inherit; } /* a value's own number, not a label (.metrics span) */
.review .rv-wrong { text-decoration: line-through; text-decoration-thickness: 2px; }
.rv-none { text-align: center; color: rgb(255 255 255 / .55); font-size: .9rem; }

/* ---------- Cart, checkout, orders ---------- */
.cart-btn { position: relative; }
.cart-btn[aria-current] { background: rgb(7 31 61 / .07); }
.cart-btn .count { position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border-radius: 9px; background: var(--bad); color: #fff; font-size: .7rem; font-weight: 700; }
button.product-img { display: grid; width: 100%; cursor: pointer; }
.home-game .go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .88rem; color: var(--sky-700); }
.sub-title { font-size: 1.3rem; margin-top: 36px; display: flex; align-items: center; gap: 8px; }
.pd .product { border-radius: var(--r); overflow: hidden; border: 1.5px solid var(--line-2); }
.wa-ask { color: #0a7558; white-space: normal; text-align: center; }
.cart-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.cart-sum { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 92px; }
.cart-sum h2 { font-size: 1.1rem; font-weight: 800; }
.cart-list, .lines { list-style: none; padding: 0; display: flex; flex-direction: column; }
.cart-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item:first-child { padding-top: 0; } .cart-item:last-child { border-bottom: 0; padding-bottom: 0; }
.ci-name b, .lines b { overflow-wrap: anywhere; }
.ci-name small, .ci-total small, .lines small { display: block; font-size: .8rem; color: var(--muted); }
.ci-total { text-align: end; min-width: 92px; }
.cart-item .stepper { width: 132px; }
.cart-item .stepper button { width: 40px; flex: none; }
.cart-item .stepper input { flex: 1; min-width: 0; width: 100%; height: 44px; border: 0; background: none; text-align: center; font-weight: 700; font-size: 1.05rem; outline-offset: -2px; }
.lines li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.totals { display: flex; flex-direction: column; gap: 6px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; color: var(--muted); font-size: .92rem; }
.totals .grand { color: var(--text); font-weight: 700; font-size: 1rem; padding-top: 8px; border-top: 1px solid var(--line); }
.totals .grand b { font-size: 1.35rem; color: var(--navy-900); }
.pay-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pay-opt { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border: 1.5px solid var(--line-2); border-radius: 14px; cursor: pointer; }
.pay-opt:has(input:checked) { border-color: var(--sky-500); background: var(--sky-200); }
.pay-opt input { width: 18px; height: 18px; flex: none; accent-color: var(--navy-800); }
.pay-box { margin-top: 0; }
.checkout .hint { font-size: .82rem; color: var(--muted); }
.checkout .err { font-size: .82rem; color: var(--bad); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.checkout .err:empty { display: none; }
.shot-prev img { display: block; max-width: 100%; max-height: 260px; margin-top: 6px; border-radius: 12px; border: 1px solid var(--line-2); }
.order-rev { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
.shot { display: block; width: 100%; cursor: zoom-in; border-radius: 14px; overflow: hidden; border: 1.5px solid var(--line-2); background: var(--surface-2); }
.shot img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.shot-big .order-rev { grid-template-columns: minmax(0, 1fr); }
.shot-big .shot { cursor: zoom-out; } .shot-big .shot img { max-height: none; }
@media (max-width: 900px) { .cart-layout, .order-rev { grid-template-columns: minmax(0, 1fr); } .cart-sum { position: static; } }
@media (max-width: 560px) {
  .cart-item { grid-template-columns: auto minmax(0, 1fr) auto; }
  .cart-item .stepper { grid-column: 1 / 3; } .ci-total { grid-column: 3; grid-row: 2; }
  .cart-item > .icon-btn { grid-column: 3; grid-row: 1; justify-self: end; }
  .pay-opts { grid-template-columns: minmax(0, 1fr); }
}
/* Timing settings: the seconds can be typed as well as dragged */
.sec-box { display: inline-flex; align-items: center; gap: 6px; font-family: var(--num); font-weight: 700; color: var(--sky-700); }
.sec-box .input { width: 84px; min-height: 38px; padding: 4px 8px; text-align: center; font-weight: 700; }

/* ---------- Home: Memory Challenges, Vedic Mathematics, Reels, Our Competition (js/home.js) ---------- */
.hx-show { background: var(--surface); border-block: 1px solid var(--line); }
.hx-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap; }
.hx-head .bi-head { flex: 1 1 420px; min-width: 0; }
.hx-soon { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 14px; font-size: .88rem; color: var(--muted); }
.vband .hx-soon { margin-top: 18px; color: rgb(255 255 255 / .8); }
.hx-page > :first-child { margin-top: 0; }
/* Memory: ten information cards (no game behind them yet, so no pointer and no lift) */
.mem-grid, .vd-grid, .reels-track { list-style: none; margin: 0; padding: 0; }
.mem-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); margin-top: 28px; }
.mem-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; transition: border-color .25s, box-shadow .25s; }
.mem-card:hover { border-color: var(--sky-400); box-shadow: var(--sh-2); }
.mem-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.mem-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy-700), var(--navy-950)); color: var(--sky-400); box-shadow: 0 8px 18px -10px rgb(7 31 61 / .7); }
.mem-ic .i { width: 22px; height: 22px; }
.mem-n { font-weight: 700; font-size: 1.3rem; color: var(--line-2); }
.mem-card h3 { font-size: 1.02rem; font-weight: 800; }
.mem-card > p { color: var(--muted); font-size: .9rem; }
.mem-card > .mem-skill { margin-top: auto; display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: var(--sky-200); color: var(--navy-800); font-weight: 700; font-size: .84rem; line-height: 1.35; }
.mem-skill .i { color: var(--sky-700); margin-top: 2px; }
.mem-skill small { display: block; font-size: .7rem; color: var(--sky-700); }
/* Vedic: one colour per group (core operations, special cases, powers and roots, fractions) */
.g-basic { --c: var(--navy-700); --c-bg: #e6edf7; --c-grad: linear-gradient(135deg, var(--navy-600), var(--navy-950)); }
.g-special { --c: var(--warn); --c-bg: var(--warn-bg); --c-grad: linear-gradient(135deg, var(--gold), #a96a06); }
.g-powers { --c: var(--sky-700); --c-bg: var(--sky-200); --c-grad: linear-gradient(135deg, var(--sky-500), var(--sky-700)); }
.g-fractions { --c: #b4473a; --c-bg: #fff0ed; --c-grad: linear-gradient(135deg, var(--coral), #c4554a); }
.vd-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.vd-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--c-bg); color: var(--c); white-space: nowrap; }
.vd-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.vd-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); margin-top: 20px; }
.vd-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px; overflow: hidden; transition: border-color .25s, box-shadow .25s; }
.vd-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--c-grad); }
.vd-card:hover { border-color: var(--c); box-shadow: var(--sh-2); }
.vd-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.vd-glyph { min-width: 52px; height: 52px; padding: 0 10px; border-radius: 16px; display: grid; place-items: center; background: var(--c-grad); color: #fff; font-family: var(--num); font-weight: 700; font-size: 1.45rem; letter-spacing: .02em; box-shadow: 0 10px 20px -12px var(--c); }
.vd-card h3 { font-size: 1.08rem; font-weight: 800; }
.vd-desc { color: var(--muted); font-size: .9rem; }
.vd-block small, .vd-sample small { display: block; font-size: .72rem; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
:root[lang="ar"] .vd-block small, :root[lang="ar"] .vd-sample small { letter-spacing: 0; font-size: .78rem; }
.vd-types { display: flex; flex-wrap: wrap; gap: 6px; }
.vd-types span { padding: 3px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: .8rem; font-weight: 600; color: var(--navy-800); }
.vd-levels { list-style: none; margin: 0; padding: 0; counter-reset: lv; display: flex; flex-direction: column; gap: 4px; }
.vd-levels li { counter-increment: lv; position: relative; display: flex; gap: 10px; align-items: baseline; font-size: .86rem; font-weight: 600; padding-bottom: 4px; }
.vd-levels li::before { content: counter(lv); flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-family: var(--num); font-size: .7rem; font-weight: 700; color: #fff; background: var(--c-grad); transform: translateY(3px); }
.vd-levels li:not(:last-child)::after { content: ''; position: absolute; inset-inline-start: 9.5px; top: 22px; bottom: -4px; width: 1px; background: var(--line-2); }
.vd-sample { margin-top: auto; padding: 10px 12px; border-radius: 12px; background: var(--c-bg); }
.vd-sample b { display: block; color: var(--c); font-size: 1.15rem; overflow-wrap: anywhere; text-align: start; }
:root[dir="rtl"] .vd-sample b { text-align: end; }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; line-height: 1; font-size: .82em; margin: 0 2px; }
.frac sup, .frac sub { font-size: 1em; vertical-align: baseline; position: static; }
.frac sup { border-bottom: 1.5px solid currentColor; padding: 0 2px 1px; }
.frac sub { padding: 1px 2px 0; }
/* Video that stays paused until clicked; its box keeps the video's own shape (--ar) */
.vid { position: relative; aspect-ratio: var(--ar, 16 / 9); background: var(--navy-950); overflow: hidden; isolation: isolate; }
.vid video, .vid-ph { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.vid-bg { display: none; }
.vid-play { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: linear-gradient(180deg, transparent 55%, rgb(4 19 39 / .55)); }
.vid-play span { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / .92); color: var(--navy-900); box-shadow: 0 10px 30px -8px rgb(0 0 0 / .6), 0 0 0 8px rgb(255 255 255 / .18); transition: transform .25s var(--ease); }
.vid-play .i { width: 26px; height: 26px; margin-inline-start: 4px; fill: currentColor; }
:root[dir="rtl"] .vid-play .i { margin-inline-start: 0; margin-inline-end: 4px; }
.vid-play:hover span, .vid-play:focus-visible span { transform: scale(1.08); }
.vid.playing .vid-play, .vid.broken .vid-play { display: none; }
.vid-err { display: none; position: absolute; inset: 0; z-index: 3; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; text-align: center; color: #fff; background: rgb(4 19 39 / .85); font-size: .9rem; font-weight: 600; }
.vid-err .i { width: 28px; height: 28px; color: var(--sky-400); }
.vid.broken .vid-err { display: flex; }
/* Reels: vertical 9:16 cards of one fixed size on every screen, swiped or moved with the arrows */
.hx-reels { color: #fff; background: radial-gradient(90% 120% at 15% 0%, var(--navy-700), var(--navy-950) 70%); overflow: hidden; }
.hx-reels .eyebrow { color: var(--sky-400); }
.hx-reels .sec-sub { color: rgb(255 255 255 / .75); }
.hx-reels .hx-manage { background: transparent; color: #fff; border-color: rgb(255 255 255 / .3); }
.reels { margin-top: 28px; }
.reels-track { display: flex; gap: 16px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; padding: 6px 2px 10px; }
.reels-track::-webkit-scrollbar { display: none; }
/* centred while they all fit, still fully scrollable once they do not */
.reels-track > :first-child { margin-inline-start: auto; }
.reels-track > :last-child { margin-inline-end: auto; }
.reel { flex: 0 0 auto; width: min(260px, 72vw); scroll-snap-align: center; border-radius: 22px; padding: 3px; background: linear-gradient(160deg, var(--sky-400), rgb(108 209 250 / .15) 40%, rgb(255 255 255 / .1) 70%, var(--sky-500)); box-shadow: 0 24px 50px -24px rgb(0 0 0 / .8); transition: transform .3s var(--ease), box-shadow .3s; }
.reel:hover, .reel:focus-within { transform: translateY(-4px); box-shadow: 0 30px 60px -24px rgb(54 181 236 / .55); }
.reel .vid { aspect-ratio: 9 / 16; border-radius: 19px; }
.reel .vid-bg { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(22px) brightness(.55) saturate(1.2); transform: scale(1.25); }
.reels-nav { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.reels-nav[hidden] { display: none; }
.reels-nav .icon-btn { color: #fff; border: 1px solid rgb(255 255 255 / .28); border-radius: 50%; }
.reels-nav .icon-btn:hover { background: rgb(255 255 255 / .12); }
/* Our Competition: the video in a framed border beside the text, stacked on narrow screens */
.show-grid { display: grid; gap: clamp(28px, 5vw, 64px); grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; }
.show-grid.no-media { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.show-media { position: relative; }
.show-media::before { content: ''; position: absolute; top: -18px; inset-inline-end: -18px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgb(54 181 236 / .25), transparent 70%); }
.show-frame { position: relative; z-index: 1; padding: 6px; border-radius: 26px; background: linear-gradient(135deg, var(--sky-400), var(--navy-700) 45%, var(--navy-950) 60%, var(--gold)); box-shadow: var(--sh-3), 0 0 0 1px rgb(7 31 61 / .08); }
.show-frame .vid { border-radius: 20px; }
.show-copy { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.show-line { font-size: clamp(1.25rem, 1rem + 1vw, 1.7rem); font-weight: 700; line-height: 1.45; color: var(--navy-900); padding-inline-start: 16px; border-inline-start: 4px solid var(--sky-500); }
.show-copy .row { margin-top: 8px; gap: 10px; }
@media (max-width: 860px) { .show-grid { grid-template-columns: minmax(0, 1fr); } .show-media::before { inset-inline-end: 0; } }
/* the platform's video (2026-11-07): a phone-shaped video beside its words, on the brand's night blue (the video's own) */
.hx-promo { background: radial-gradient(110% 80% at 15% 0%, var(--navy-700), var(--navy-900) 55%, var(--navy-950)); color: #fff; }
/* on a computer the section above (its cards) ends clear of the band, not on its edge (2026-11-08; the fade was undone) */
@media (min-width: 861px) { .hx-promo { margin-top: clamp(40px, 4vw, 64px); } }
.hx-promo .sec-title { color: #fff; }
.hx-promo .eyebrow { color: var(--sky-400); }
.hx-promo .show-line { color: var(--sky-300); border-inline-start-color: var(--sky-400); }
.hx-promo .sec-sub { color: rgb(255 255 255 / .78); }
.promo-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(28px, 6vw, 80px); align-items: center; }
.promo-grid.no-media { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.promo-frame { width: min(100%, 340px); margin-inline: auto; padding: 7px; border-radius: 32px; background: linear-gradient(160deg, var(--sky-400), rgb(108 209 250 / .14) 45%, rgb(255 255 255 / .06) 70%, var(--sky-500)); box-shadow: 0 34px 80px -34px rgb(54 181 236 / .65); }
.promo-frame .vid { border-radius: 26px; }
.promo-copy { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.promo-copy .row { margin-top: 8px; gap: 10px; }
@media (max-width: 860px) { .promo-grid { grid-template-columns: minmax(0, 1fr); } .promo-copy { order: -1; align-items: center; text-align: center; } .promo-copy .show-line { border: 0; padding: 0; } .promo-copy .row { justify-content: center; } .promo-frame { width: min(100%, 300px); } }
@media (max-width: 640px) {
  .mem-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
  .mem-card { padding: 14px; gap: 6px; }
  .mem-ic { width: 40px; height: 40px; border-radius: 12px; }
  .mem-card h3 { font-size: .95rem; }
  .mem-card > p { font-size: .84rem; }
  .mem-card > .mem-skill { font-size: .78rem; padding: 7px 8px; }
  .vd-card { padding: 18px 16px; }
}
/* Admin: Dashboard → Homepage sections */
.ha-card { margin-bottom: 20px; }
.ha-switch { gap: 8px; font-weight: 600; font-size: .9rem; min-height: 44px; }
.ha-title { margin: -4px 0 14px; display: flex; flex-direction: column; gap: 2px; }
.ha-title small { color: var(--faint); font-size: .78rem; }
.ha-title p { font-size: .88rem; margin-top: 4px; }
.ha-warn { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: .86rem; font-weight: 600; margin-bottom: 14px; }
.ha-glyph { font-family: var(--num); font-size: 1rem; color: var(--navy-800); }
.ha-show { display: flex; gap: 14px; align-items: center; }
.ha-show b { display: block; }
.ha-show small { color: var(--faint); font-size: .8rem; }
/* The video dialog (2026-11-15, js/home.js homeVideoForm): upload from this device or pick one of the site's */
.vu { display: grid; gap: 14px; min-width: 0; }
.vu-cur { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); min-width: 0; }
.vu-cur .grow { flex: 1 1 160px; min-width: 0; }
.vu-cur b, .vu-meta b, .vu-opt b { display: block; overflow-wrap: anywhere; }
.vu-none { color: var(--bad); }
.vu-tabs { justify-self: start; }
@media (max-width: 560px) { .vu-tabs { justify-self: stretch; } .vu-tabs button { flex: 1 1 0; justify-content: center; white-space: normal; text-align: center; padding-inline: 8px; } }
.vu-drop { display: grid; justify-items: center; gap: 6px; padding: 28px 16px; border: 2px dashed var(--line-2); border-radius: 16px; text-align: center; cursor: pointer; transition: border-color .2s var(--ease), background-color .2s var(--ease); }
.vu-drop .ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--sky-200); color: var(--navy-800); }
.vu-drop:hover, .vu-drop.over { border-color: var(--sky-500); background: var(--surface-2); }
.vu-drop:focus-within { outline: 3px solid var(--sky-500); outline-offset: 2px; }
.vu-drop[hidden], .vu-pick[hidden], .vu-prog[hidden] { display: none; }
.vu-pick video { display: block; width: 100%; max-height: 46vh; border-radius: 14px; background: #000; }
.vu-meta { margin-top: 10px; gap: 10px; }
.vu-meta small, .vu-opt small { display: block; font-size: .8rem; }
.vu-prog { display: grid; gap: 6px; }
.vu-prog progress { width: 100%; height: 10px; accent-color: var(--sky-600); }
.vu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 46vh; overflow-y: auto; }
.vu-list li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vu-opt { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 44px; min-width: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.vu-opt input { flex: none; width: 18px; height: 18px; accent-color: var(--sky-600); }
.vu-opt:has(input:checked) { border-color: var(--sky-500); box-shadow: 0 0 0 1px var(--sky-500); }
@media (prefers-reduced-motion: reduce) { .vu-drop { transition: none; } }

/* ---------- Memory games and Vedic sessions (js/memory.js, js/vedic.js) ---------- */
.mem-card > .btn, .vd-card > .btn { margin-top: 6px; }
.hx-soon-tag { margin-top: auto; padding-top: 6px; }
/* start windows */
.ms-start, .vs-start { display: flex; flex-direction: column; gap: 16px; }
.ms-how { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--sky-200); color: var(--navy-800); font-size: .92rem; font-weight: 600; }
.ms-how .i { flex: none; margin-top: 3px; }
.ms-how.dark { background: rgb(255 255 255 / .08); color: rgb(255 255 255 / .85); max-width: 520px; text-align: start; }
.ms-voice { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .9rem; font-weight: 600; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.ms-voice.ok { background: var(--ok-bg); color: var(--ok); } .ms-voice.bad { background: var(--warn-bg); color: var(--warn); }
.ms-voice:empty { display: none; }
.vs-tech { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.vs-tech h3 { font-size: 1rem; }
.vs-example { padding: 14px 16px; border-radius: 14px; background: var(--navy-900); color: #fff; display: flex; flex-direction: column; gap: 10px; }
.vs-example .lbl { color: var(--sky-300); font-size: .8rem; font-weight: 700; }
.vd-line { font-family: var(--num); font-weight: 700; font-size: 1.35rem; direction: ltr; text-align: start; overflow-wrap: anywhere; }
.vd-line small { font-size: .8rem; color: var(--sky-300); }
.written.vd-line { font-size: clamp(1.8rem, 1.1rem + 3.4vw, 3rem); text-align: center; }
.vd-eq { color: rgb(255 255 255 / .55); }
.pow { font-size: .55em; vertical-align: super; line-height: 0; }
.rad { display: inline-flex; align-items: flex-start; }
.rad > span { border-top: .08em solid currentColor; padding: 0 .08em; margin-top: .12em; }
.runner .frac, .vs-example .frac { font-size: .7em; }
.work { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .86rem; }
.work li { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.work span { color: rgb(255 255 255 / .6); min-width: 9em; }
.work b { font-family: var(--num); font-weight: 600; direction: ltr; overflow-wrap: anywhere; }
/* memory session screen */
.mg-cue { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: clamp(1.1rem, 1rem + .6vw, 1.4rem); color: var(--sky-300); }
.mg-pic { display: inline-grid; place-items: center; width: clamp(64px, 16vw, 92px); aspect-ratio: 1; border-radius: 20px; background: #fff; color: var(--c); box-shadow: 0 10px 24px -12px rgb(0 0 0 / .6); }
.mg-pic .i { width: 55%; height: 55%; stroke-width: 2.2; }
.mg-pic.sm { width: 38px; border-radius: 10px; }
.mg-items, .mg-options, .mg-tray { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 640px; }
.mg-digits { font-size: clamp(2.4rem, 1.2rem + 6vw, 5rem); font-weight: 700; letter-spacing: .18em; overflow-wrap: anywhere; text-align: center; max-width: 100%; }
.mg-words { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 680px; }
.mg-words span, .mg-word { padding: 10px 18px; border-radius: 14px; background: rgb(255 255 255 / .1); font-size: clamp(1.1rem, 1rem + .8vw, 1.5rem); font-weight: 700; }
.mg-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; direction: ltr; }
.mg-row li { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mg-row small { font-family: var(--num); color: rgb(255 255 255 / .55); font-size: .8rem; }
.mg-shape { width: clamp(46px, 11vw, 66px); height: auto; }
.mg-grid { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; width: min(100%, calc(var(--n) * 76px)); direction: ltr; }
.mg-grid .mg-cell { aspect-ratio: 1; min-height: 44px; border-radius: 12px; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .14); display: grid; place-items: center; padding: 0; }
.mg-grid .mg-cell .mg-pic { width: 82%; border-radius: 12px; }
button.mg-cell[aria-pressed="true"] { background: var(--sky-400); border-color: var(--sky-300); box-shadow: 0 0 0 3px rgb(108 209 250 / .3); }
.mg-grid.sm { width: min(100%, calc(var(--n) * 30px)); gap: 3px; margin-top: 6px; }
.mg-grid.sm .mg-cell { min-height: 0; border-radius: 5px; }
.mg-faces { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; max-width: 720px; }
.mg-faces figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; width: clamp(120px, 28vw, 150px); }
.mg-faces figcaption { font-weight: 700; font-size: 1.05rem; }
.mg-faces select, .mg-card select, .mg-card input { min-height: 44px; font-size: .95rem; color: var(--text); }
.mg-face { width: 100%; height: auto; border-radius: 50%; }
.mg-cards { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; max-width: 760px; }
.mg-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; border-radius: 18px; background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .12); width: clamp(140px, 40vw, 170px); }
.mg-card > b { font-size: 1.15rem; } .mg-card > span.num { font-size: 1.6rem; font-weight: 700; color: var(--sky-300); }
.mg-listen { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: rgb(108 209 250 / .15); color: var(--sky-300); animation: pulse 1.6s infinite; }
.mg-listen .i { width: 56px; height: 56px; }
.mg-recall { width: min(720px, 100%); display: flex; flex-direction: column; align-items: center; gap: 16px; animation: rise .3s var(--ease); }
.mg-recall > label { font-size: clamp(1.1rem, 1rem + .8vw, 1.4rem); font-weight: 700; text-align: center; }
.mg-recall .btn-block { max-width: 440px; }
.mg-recall .err { color: var(--coral); font-weight: 600; min-height: 1.3em; text-align: center; }
.mg-in { max-width: 440px; letter-spacing: .12em; }
.mg-text { max-width: 440px; font-size: 1.1rem; color: var(--text); }
.mg-count { color: rgb(255 255 255 / .7); font-size: .9rem; font-weight: 600; }
.mg-opt { border-radius: 18px; padding: 4px; border: 2px solid transparent; transition: transform .15s, border-color .15s; }
.mg-opt:hover { transform: translateY(-2px); }
.mg-opt[aria-pressed="true"] { border-color: var(--sky-400); background: rgb(108 209 250 / .18); }
.mg-opt[aria-pressed="true"] .mg-word { background: var(--sky-400); color: var(--navy-950); }
.mg-opt[hidden] { display: none; }
.mg-slots .mg-slot { width: clamp(50px, 12vw, 70px); aspect-ratio: 1; border-radius: 14px; border: 2px dashed rgb(255 255 255 / .35); display: grid; place-items: center; }
.mg-slots .mg-slot.full { border-style: solid; border-color: var(--sky-400); }
.mg-slot .mg-shape { width: 80%; }
.mg-pads { display: grid; gap: 12px; width: min(100%, 420px); direction: ltr; }
.mg-pads.p4 { grid-template-columns: repeat(2, 1fr); } .mg-pads.p6, .mg-pads.p9 { grid-template-columns: repeat(3, 1fr); }
.mg-pad { aspect-ratio: 1; min-height: 64px; border-radius: 20px; background: color-mix(in srgb, var(--c) 35%, var(--navy-900)); border: 2px solid color-mix(in srgb, var(--c) 60%, transparent); display: grid; place-items: center; color: #fff; font-size: 1.8rem; font-weight: 700; transition: background .12s, transform .12s, box-shadow .12s; }
.mg-pad .mg-pic { width: 62%; }
.mg-pad.lit, .mg-pad.tap { background: var(--c); box-shadow: 0 0 34px color-mix(in srgb, var(--c) 70%, transparent); transform: scale(1.05); }
.mg-pad:disabled { cursor: default; }
.mg-review li { align-items: flex-start; }
.mg-rv { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mg-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 10px; background: rgb(255 255 255 / .08); border: 2px solid transparent; font-weight: 600; }
.mg-chip.ok { border-color: #4ade9c; } .mg-chip.miss { opacity: .55; border-style: dashed; border-color: #4ade9c; } .mg-chip.bad { border-color: var(--coral); }
.mg-chip .mg-shape { width: 28px; } .mg-chip .mg-face { width: 36px; } .mg-chip s, .mg-chip small { color: rgb(255 255 255 / .6); font-size: .8rem; }
.mg-dot { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px; background: color-mix(in srgb, var(--c) 45%, transparent); font-size: .78rem; font-weight: 700; }
.mg-dot.ok { outline: 2px solid #4ade9c; } .mg-dot.bad { outline: 2px solid var(--coral); }
/* admin: Vedic steps, memory levels */
.vse { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.vse-row { border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.vse-row legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }
.vse-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.vse-f { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--muted); min-width: 0; }
.vse-f.wide { grid-column: 1 / -1; }
.vse-row .err { color: var(--bad); font-size: .85rem; font-weight: 600; } .vse-row .err:empty { display: none; }
.ml-tbl .input { min-height: 40px; max-width: 140px; }
/* Progress page */
.pa-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.pa-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pa-kpis div { padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.pa-kpis b { display: block; font-size: 1.3rem; } .pa-kpis span { font-size: .78rem; color: var(--muted); }
.mem-run .metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 100px), 1fr)); }
/* Specialist / Free settings, flash items, face picking, picture grids */
.ms-free { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.ms-free .err { color: var(--bad); font-weight: 600; font-size: .88rem; display: flex; gap: 6px; align-items: center; } .ms-free .err:empty { display: none; }
.ms-free .vse-f small { font-weight: 500; color: var(--faint); }
.mg-flash { font-weight: 700; line-height: 1.1; color: #fff; text-align: center; max-width: 100%; overflow-wrap: anywhere; font-size: clamp(2.6rem, 1rem + 10vw, 7.5rem); text-shadow: 0 0 60px rgb(108 209 250 / .35); }
.mg-flash.show { animation: flashIn .12s var(--ease); }
.mg-face-pick { gap: 10px; }
.mg-face-pick .mg-opt { width: clamp(84px, 22vw, 124px); border-radius: 50%; padding: 4px; }
.mg-grid .mg-cell.mg-opt { padding: 3px; }
.mg-grid.sm { width: min(100%, calc(var(--n) * 40px)); }
.mg-grid.sm .mg-cell .mg-pic { width: 100%; border-radius: 5px; box-shadow: none; }
.mg-grid.sm .mg-cell.ok { box-shadow: 0 0 0 3px #4ade9c; } .mg-grid.sm .mg-cell.miss { box-shadow: 0 0 0 3px #4ade9c; opacity: .55; } .mg-grid.sm .mg-cell.bad { box-shadow: 0 0 0 3px var(--coral); }
.mg-pads.p12, .mg-pads.p16 { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mg-pads.p12 .mg-pad, .mg-pads.p16 .mg-pad { min-height: 52px; font-size: 1.3rem; border-radius: 14px; }
@media (max-width: 560px) { .work span { min-width: 0; width: 100%; } }

/* ---------- Memory: up to 100 items on screen; Number shown all together; grids up to 8×8 ---------- */
.mg-items.many, .mg-options.many { gap: 8px; max-width: 960px; }
.mg-items.many .mg-pic, .mg-options.many .mg-pic { width: clamp(44px, 9vw, 56px); border-radius: 12px; }
.mg-nums { max-width: 960px; }
.mg-nums .mg-word { direction: ltr; }
.mg-grid.big { gap: 3px; }
.mg-grid.big .mg-cell { border-radius: 8px; }

/* ---------- Home: Vedic Mathematics and Memory Challenges as track cards (same frame and blue animation as Flash / Written) ---------- */
/* four cards: two by two on wide screens (the phone slideshow is .car) */
@media (min-width: 641px) { .home-tracks .car-track { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.anzan-vis.vd-vis { font-size: clamp(2.2rem, 1.4rem + 2.4vw, 3.2rem); gap: 12px; align-items: baseline; }
.mem-vis { grid-template-columns: repeat(5, 30px); gap: 9px; }
.mem-vis i { width: 30px; height: 30px; border-radius: 8px; }
/* one cycle of the board: each lit tile in turn (delays set inline), then a pause */
.mem-vis i.c { background: rgb(255 255 255 / .1); }
.mem-vis i.c.h { animation: memTile 3.6s infinite; }
@keyframes memTile { 0%, 100% { background: rgb(255 255 255 / .1); } 6%, 16% { background: var(--sky-400); box-shadow: 0 0 16px var(--sky-400); } 24% { background: rgb(255 255 255 / .1); } }
@media (prefers-reduced-motion: reduce) { .mem-vis i.c.h { animation: none; background: rgb(108 209 250 / .35); } }

/* ---------- Header: a menu that does not fit on one line folds into the burger menu, as on small screens (headerFit in app.js) ---------- */
.hdr.fold .burger { display: inline-grid; }
.hdr.fold .nav { overscroll-behavior: contain; position: absolute; inset-inline: 0; top: var(--hdr); flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 16px 18px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--sh-2); margin: 0; visibility: hidden; opacity: 0; transform: translateY(-8px); transition: all .22s var(--ease); max-height: calc(100svh - var(--hdr)); overflow-y: auto; }
.hdr.fold.open .nav { visibility: visible; opacity: 1; transform: none; }
.hdr.fold .nav a { padding: 12px 14px; font-size: 1rem; min-height: 48px; }
.hdr.fold .nav a > .i { display: inline-block; }
.hdr.fold .nav a[aria-current="page"] { background: var(--sky-200); }
.hdr.fold .nav a[aria-current="page"]::after { display: none; }
.hdr.fold .tools { margin-inline-start: auto; }

/* ---------- Celebration (js/cheer.js): the message card, and particles in a layer that never takes a click ---------- */
.cheer { position: relative; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 12px; max-width: min(100%, 520px); margin: 4px auto; padding: 12px 20px; border-radius: 18px; text-align: center;
  background: linear-gradient(135deg, rgb(56 189 248 / .22), rgb(167 139 250 / .2)), rgb(10 37 72 / .94); border: 1px solid rgb(255 255 255 / .22); box-shadow: 0 0 0 4px rgb(56 189 248 / .08), 0 10px 30px rgb(0 0 0 / .25); animation: cheerIn .6s var(--ease) both; }
.cheer b { font-size: clamp(1.1rem, .95rem + 1vw, 1.5rem); line-height: 1.3; color: #fff; overflow-wrap: anywhere; }
.cheer-perfect { background: linear-gradient(135deg, rgb(250 204 21 / .3), rgb(251 146 60 / .22)), rgb(10 37 72 / .94); border-color: rgb(250 204 21 / .5); }
.cheer-great { background: linear-gradient(135deg, rgb(56 189 248 / .28), rgb(74 222 128 / .18)), rgb(10 37 72 / .94); }
.cheer-improved { background: linear-gradient(135deg, rgb(74 222 128 / .26), rgb(56 189 248 / .18)), rgb(10 37 72 / .94); }
@keyframes cheerIn { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }
.cheer-fx { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; contain: strict; }
.cheer-fx i { position: absolute; font-style: normal; line-height: 1; will-change: transform, opacity; animation-fill-mode: both; }
.fx-fall { top: -24px; left: var(--x); width: 9px; height: 14px; border-radius: 2px; background: var(--c); transform: scale(var(--s)); animation: fxFall var(--t) cubic-bezier(.3, .6, .5, 1) var(--d) both; }
.fx-fall.g { width: auto; height: auto; background: none; font-size: 1.4rem; }
.fx-rise { bottom: -48px; left: var(--x); font-size: calc(1.8rem * var(--s)); filter: hue-rotate(var(--h)); animation: fxRise var(--t) ease-out var(--d) both; }
.fx-tw { left: var(--x); top: var(--y); font-size: calc(1.3rem * var(--s)); animation: fxTw var(--t) ease-in-out var(--d) 2 both; }
.fx-burst { left: var(--x); top: var(--y); width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); animation: fxBurst 1.3s cubic-bezier(.15, .7, .3, 1) var(--d) both; }
.fx-burst.g { width: auto; height: auto; background: none; box-shadow: none; font-size: 1.3rem; }
.fx-pop { left: 50%; top: 26%; font-size: clamp(4rem, 3rem + 6vw, 7rem); filter: drop-shadow(0 8px 24px rgb(250 204 21 / .55)); animation: fxPop 2.6s var(--ease) both; }
.fx-glow { left: 50%; top: 40%; width: 70vmin; height: 70vmin; border-radius: 50%; background: radial-gradient(circle, rgb(56 189 248 / .35), rgb(167 139 250 / .15) 45%, transparent 70%); animation: fxGlow 2.8s ease-out both; }
@keyframes fxFall { 0% { opacity: 1; transform: translateY(0) rotate(0) scale(var(--s)); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(105vh) rotate(var(--r)) scale(var(--s)); } }
@keyframes fxRise { 0% { opacity: 0; transform: translate(0, 0); } 12% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--w), -105vh); } }
@keyframes fxTw { 0%, 100% { opacity: 0; transform: scale(.2) rotate(0); } 50% { opacity: 1; transform: scale(1.15) rotate(25deg); } }
@keyframes fxBurst { 0% { opacity: 1; transform: translate(0, 0) scale(.4); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); } }
@keyframes fxPop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(-25deg); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.2) rotate(6deg); } 40% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -80%) scale(.9); } }
@keyframes fxGlow { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 35% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); } }
@media (prefers-reduced-motion: reduce) { .cheer-fx { display: none; } .cheer { animation: none; } }

/* ---------- The logo assistant (Cheer.bot) ----------
   Sized by its font-size (1em = the logo's width), so the same drawing works small in the top bar, in the result message
   and large on the stage. In a session it lives in the top bar; while the numbers flash (and during the countdown and the
   right/wrong feedback) it stands larger in the stage's free bottom corner; on results it sits in the message card. */
.tu-bot { position: relative; flex: none; display: inline-grid; place-items: center; font-size: 38px; width: 1em; height: 1em; margin-top: .1em;
  animation: botIn .5s var(--ease) both, botFloat 3.4s ease-in-out .6s infinite; }
.tu-bot img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #fff; border: max(2px, .05em) solid rgb(255 255 255 / .9); box-shadow: 0 0 0 .08em rgb(108 209 250 / .22), 0 .15em .4em rgb(0 0 0 / .35); }
.bot-ant { position: absolute; top: -.17em; left: 50%; width: max(2px, .05em); height: .19em; transform: translateX(-50%); border-radius: 2px; background: rgb(255 255 255 / .85); }
.bot-ant::after { content: ''; position: absolute; top: -.1em; left: 50%; width: .16em; height: .16em; margin-left: -.08em; border-radius: 50%; background: var(--sky-400); box-shadow: 0 0 .2em var(--sky-400); animation: botBlink 2.4s ease-in-out infinite; }
.bot-badge { position: absolute; bottom: -.12em; inset-inline-end: -.16em; font-size: .34em; line-height: 1; filter: drop-shadow(0 2px 4px rgb(0 0 0 / .4)); }
.bot-spark { position: absolute; font-style: normal; font-size: .25em; color: #facc15; text-shadow: 0 0 6px rgb(250 204 21 / .8); animation: botSpark 1.8s ease-in-out infinite; }
.bot-spark:nth-of-type(2) { top: -.6em; inset-inline-start: -.9em; }
.bot-spark:nth-of-type(3) { top: 1.2em; inset-inline-end: -1.2em; animation-delay: .6s; }
.bot-spark:nth-of-type(4) { bottom: -.3em; inset-inline-start: -1.1em; animation-delay: 1.2s; }
/* The result message's assistant: larger, and its reaction follows the result (it then settles into the same gentle float). */
.cheer .tu-bot { font-size: 52px; margin-top: .12em; }
.bot-perfect, .bot-great { animation: botIn .5s var(--ease) both, botHop 1.1s ease-in-out .5s 3, botFloat 3.4s ease-in-out 3.8s infinite; }
.bot-perfect img { animation: botGlow 1.6s ease-in-out infinite; }
.bot-improved, .bot-good { animation: botIn .5s var(--ease) both, botWave 1s ease-in-out .5s 3, botFloat 3.4s ease-in-out 3.5s infinite; }
.bot-effort { animation: botIn .5s var(--ease) both, botNod 1.6s ease-in-out .5s 2, botFloat 3.4s ease-in-out 3.7s infinite; }
/* The stage companion (Cheer.buddy): one fixed spot at the top-left of the screen, placed by script; never takes clicks. */
.rn-buddy { position: absolute; z-index: 2; left: 0; top: 0; font-size: 76px; pointer-events: none; opacity: 0; transform: translateY(16px) scale(.7);
  transition: opacity .45s var(--ease), transform .45s var(--ease); }
.rn-buddy.on { opacity: 1; transform: none; }
.rn-buddy::before { content: ''; position: absolute; inset: -35%; border-radius: 50%; background: radial-gradient(circle, rgb(108 209 250 / .22), transparent 65%); }
.rn-buddy .tu-bot { font-size: 1em; }
/* what it is doing, in a speech bubble beside it */
.bot-say { position: absolute; z-index: 1; top: -.3em; right: -.42em; display: grid; place-items: center; min-width: 1.5em; height: 1.5em; padding: 0 .2em; font-size: .3em; line-height: 1;
  border-radius: 999px 999px 999px .25em; background: #fff; box-shadow: 0 .15em .5em rgb(0 0 0 / .35); }
.bot-say:empty { display: none; }
.bot-say.pop { animation: sayPop .45s var(--ease) both; }
/* its situation: ready (floats calmly through the countdown), watching (leans in and nods on every flashed number), thinking (slow tilt) */
.rn-buddy[data-state="ready"] .tu-bot { animation: botFloat 3.4s ease-in-out infinite; }
.rn-buddy[data-state="watch"] .tu-bot { animation: botWatch 2.2s ease-in-out infinite; }
.rn-buddy[data-state="think"] .tu-bot { animation: botThink 2.8s ease-in-out infinite; }
.rn-buddy.beat .tu-bot img { transform: scale(1.08); box-shadow: 0 0 0 .1em rgb(108 209 250 / .55), 0 0 .5em rgb(108 209 250 / .6); }
.rn-buddy .tu-bot img { transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
/* its reaction to an answer: a jump and spin (right), a supportive shake-off (wrong, with 💪), a nod (answer received) */
.rn-buddy[data-act="yes"] .tu-bot { animation: botJump .9s cubic-bezier(.3, .7, .4, 1); }
.rn-buddy[data-act="oops"] .tu-bot { animation: botShake .9s ease-in-out; }
.rn-buddy[data-act="sent"] .tu-bot { animation: botNodQuick .6s ease-in-out; }
/* One assistant at a time: the top bar's steps back while the stage or the result message has one. */
.runner:has(.cheer) .rn-top .tu-bot, .runner:has(.rn-buddy.on) .rn-top .tu-bot { animation: botOut .35s var(--ease) forwards; }
@keyframes sayPop { from { opacity: 0; transform: scale(.3) translateY(.3em); } 70% { transform: scale(1.12); } to { opacity: 1; transform: none; } }
@keyframes botWatch { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-.04em); } }
@keyframes botThink { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg) translateY(-.03em); } 60% { transform: rotate(-6deg); } }
@keyframes botJump { 0% { transform: none; } 35% { transform: translateY(-.45em) rotate(180deg) scale(1.1); } 65% { transform: translateY(-.2em) rotate(360deg); } 82% { transform: translateY(0) scale(1.08, .92); } 100% { transform: none; } }
@keyframes botShake { 0%, 100% { transform: none; } 15% { transform: translateX(-.08em) rotate(-10deg); } 35% { transform: translateX(.08em) rotate(8deg); } 55% { transform: translateX(-.05em) rotate(-5deg); } 75% { transform: translateY(-.1em) rotate(0); } }
@keyframes botNodQuick { 0%, 100% { transform: none; } 40% { transform: translateY(.08em) rotate(6deg); } }
@keyframes botOut { to { opacity: 0; transform: scale(.5); } }
@keyframes botIn { from { opacity: 0; transform: scale(.4) rotate(-20deg); } to { opacity: 1; transform: none; } }
@keyframes botFloat { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-.08em) rotate(-4deg); } 70% { transform: translateY(-.03em) rotate(4deg); } }
@keyframes botHop { 0%, 100% { transform: translateY(0) scale(1); } 25% { transform: translateY(-.2em) rotate(-8deg) scale(1.06); } 50% { transform: translateY(0) scale(.97, 1.03); } 75% { transform: translateY(-.12em) rotate(8deg); } }
@keyframes botWave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes botNod { 0%, 100% { transform: translateY(0) rotate(0); } 40% { transform: translateY(.06em) rotate(-5deg); } 70% { transform: translateY(-.04em) rotate(3deg); } }
@keyframes botBlink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes botSpark { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 50% { opacity: 1; transform: scale(1.1) rotate(45deg); } }
@keyframes botGlow { 0%, 100% { box-shadow: 0 0 0 .06em rgb(250 204 21 / .3), 0 .15em .4em rgb(0 0 0 / .35); } 50% { box-shadow: 0 0 0 .12em rgb(250 204 21 / .45), 0 0 .45em rgb(250 204 21 / .6); } }
@media (max-width: 560px) { .rn-top .tu-bot { font-size: 32px; } }
@media (prefers-reduced-motion: reduce) {
  .tu-bot, .tu-bot *, .tu-bot *::after, .bot-say { animation: none !important; } .bot-spark { opacity: 1; } .rn-buddy { transition: opacity .2s; } .rn-buddy.beat .tu-bot img { transform: none; }
  .runner:has(.cheer) .rn-top .tu-bot, .runner:has(.rn-buddy.on) .rn-top .tu-bot { opacity: 0; }
}

/* ---------- Championship 2026 (js/champ.js) ---------- */
.ch-letter { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--navy-900); font-weight: 800; margin-inline-end: 6px; }
.ch-level h3 { display: flex; align-items: center; font-size: 1.05rem; margin-bottom: 12px; }
.ch-pages { margin: 0; padding-inline-start: 18px; font-size: .86rem; }
.ch-rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ch-rules li { display: flex; gap: 8px; align-items: flex-start; }
.ch-rules .i { color: var(--ok, #16a34a); flex: none; margin-top: 3px; }
.ch-list { list-style: none; padding: 0; margin: 0; }
.ch-reg { flex-wrap: wrap; }
.ch-reg > .row { flex-wrap: wrap; }
.ch-filters { gap: 12px; flex-wrap: wrap; align-items: end; }
.ch-filters .vse-f { min-width: min(100%, 200px); }
.ch-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.ch-page-h { text-align: center; color: rgb(255 255 255 / .7); font-size: .9rem; margin: 0 0 10px; }
@media print { .hdr, .foot, .modal-f, .ch-filters { display: none !important; } }

/* Course videos: the viewer's name and student code move over the player without stopping (a visible watermark; it deters
   and identifies, it cannot stop a recording). It never takes a click. */
.player-wrap { position: relative; }
/* (2026-10-31) The moving line, the same over every player: the box is the video above its controls; the line glides across
   it (wm-x) and down it (wm-y), each to the far edge and back (alternate), so it bounces off the edges and never rests.
   The two lengths differ, so the path keeps changing. It moves by translate and transform only (the compositor's work, no
   layout of the page per frame): the box's size (cqw, cqh: the box is a size container) less its own (100%), so it always
   ends exactly at an edge, whatever the box's size (full screen, a phone). Gray, with a thin dark edge: readable over white
   and over a dark scene, faint enough to watch through. */
.wm-box { position: absolute; inset: 2% 2% 58px; z-index: 1; pointer-events: none; overflow: hidden; container-type: size; }
.wm-move { position: absolute; left: 0; top: 0; white-space: nowrap; color: rgb(140 140 140 / .88); text-shadow: 0 0 1px rgb(0 0 0 / .55), 0 1px 2px rgb(0 0 0 / .3);
  font-size: clamp(.8rem, .7rem + .5vw, 1.05rem); font-weight: 800; animation: wm-x 13s linear infinite alternate, wm-y 8.3s linear infinite alternate; will-change: transform; }
@keyframes wm-x { from { translate: 0 0; } to { translate: calc(100cqw - 100%) 0; } }
@keyframes wm-y { from { transform: translateY(0); } to { transform: translateY(calc(100cqh - 100%)); } }
@supports not (width: 1cqw) { /* a browser without container units (Safari before 16): the same path by left and top */
  .wm-move { animation-name: wm-xl, wm-yl; }
  @keyframes wm-xl { from { left: 0; translate: 0 0; } to { left: 100%; translate: -100% 0; } }
  @keyframes wm-yl { from { top: 0; transform: translateY(0); } to { top: 100%; transform: translateY(-100%); } }
}
@media (prefers-reduced-motion: reduce) { .wm-move { animation-duration: 26s, 16.6s; } } /* slower, never still: it is the lesson's protection */
.player.locked { gap: 6px; text-align: center; }
.teacher.is-off { opacity: .78; }

/* ---------- The lesson player for YouTube lessons (js/courses.js): YouTube's controls off, the platform's on top ---------- */
.player.yt { position: relative; isolation: isolate; outline: none; touch-action: manipulation; } /* a tap is a tap at once: no double-tap zoom */
.player.yt:focus-visible { box-shadow: 0 0 0 3px var(--sky-400); }
/* the frame reaches beyond the box at the top and the bottom, where YouTube draws its title bar and buttons */
.yt iframe { position: absolute; left: 0; width: 100%; top: calc(-1 * max(64px, 9%)); height: calc(100% + 2 * max(64px, 9%)); border: 0; pointer-events: none; }
.yt-shield { position: absolute; inset: 0; z-index: 1; cursor: pointer; }
.yt-cover { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; color: #fff; text-align: center;
  background: radial-gradient(circle at 50% 40%, var(--navy-700), var(--navy-950)); transition: opacity .25s, background .25s; }
.yt-cover b { position: absolute; top: calc(50% + 50px); inset-inline: 6%; font-size: clamp(.95rem, .85rem + .6vw, 1.3rem); line-height: 1.35; }
.yt-cover small { position: absolute; bottom: 10%; inset-inline: 6%; color: rgb(255 255 255 / .78); font-size: .85rem; }
.yt-cover small:empty { display: none; }
.yt-cover:has(small:not(:empty)) b { display: none; } /* a message (loading, paused in the background, an error) instead of the title */
/* the play button exactly in the middle: before the first play it is where YouTube's own play button is, under it */
.yt-big { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: var(--sky-400); color: var(--navy-950); box-shadow: 0 8px 30px rgb(0 0 0 / .4); }
.yt-big .i { width: 30px; height: 30px; }
@media (max-width: 560px) { .yt-cover b { top: calc(50% + 40px); font-size: .9rem; } .yt-cover small { bottom: 6%; } }
/* before the first play: a tap on the play button goes through to YouTube's play button in the frame (and only there) */
.yt[data-state="cover"] .yt-cover { pointer-events: none; }
.yt[data-state="cover"] iframe { pointer-events: auto; }
.yt[data-state="cover"] .yt-shield { clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, calc(50% - 34px) calc(50% - 34px), calc(50% + 34px) calc(50% - 34px), calc(50% + 34px) calc(50% + 34px), calc(50% - 34px) calc(50% + 34px), calc(50% - 34px) calc(50% - 34px)); }
.yt[data-state="cover"]:not(:has(.yt-msg:empty)) .yt-big { opacity: .55; }
.yt[data-state="paused"] .yt-cover { background: rgb(4 19 39 / .42); }
.yt[data-state="paused"] .yt-cover b { display: none; }
.yt[data-state="playing"] .yt-cover { opacity: 0; pointer-events: none; }
.yt[data-state="error"] .yt-big { background: var(--bad); color: #fff; }
.yt-bar { position: absolute; inset-inline: 0; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 6px; padding: 22px 10px 8px; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / .75)); opacity: 0; transition: opacity .25s; }
.yt:not([data-state="playing"]) .yt-bar, .yt.show .yt-bar, .yt:focus-within .yt-bar { opacity: 1; }
.yt[data-state="cover"] .yt-bar, .yt[data-state="error"] .yt-bar { opacity: 0; pointer-events: none; }
.yt-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: #fff; flex: none; }
.yt-btn:hover, .yt-btn:focus-visible { background: rgb(255 255 255 / .16); }
.yt-time { font-size: .8rem; white-space: nowrap; flex: none; }
.yt-bar input[type="range"] { accent-color: var(--sky-400); height: 24px; }
.yt-bar .yt-seek { flex: 1 1 0; width: auto; min-width: 50px; }
.yt-bar .yt-vol { flex: none; width: 84px; }
@media (max-width: 560px) { .yt-vol { display: none; } .yt-time { font-size: .72rem; } .yt-btn { width: 36px; height: 36px; } .yt-big { width: 56px; height: 56px; } }
/* full screen: the player and the name over it fill the screen, the video at its own shape; .yt-max where a page cannot go full screen (iPhone) */
.player-wrap:fullscreen, .player-wrap.yt-max { display: flex; align-items: center; justify-content: center; background: #000; }
.player-wrap.yt-max { position: fixed; inset: 0; z-index: 300; }
html.yt-maxed, html.yt-maxed body, :root:has(.player-wrap:fullscreen) { overflow: hidden; scrollbar-gutter: auto; } /* no page scrollbar, nor its reserved gutter, beside the video */
/* dvh: the height really visible (Safari's bars shown or not); vh, larger with the bars shown, cut the bottom (the controls) off */
.player-wrap:fullscreen .player, .player-wrap.yt-max .player { width: min(100vw, 177.78vh); width: min(100vw, 177.78dvh); border-radius: 0; }
/* Filling the full view (.yt-fill, 2026-10-30, js/courses.js ytFillPref): the player takes the whole view, and while the view
   is wider than tall the video covers it, its frame's edges cut by at most a sixth (19.5:9 phones need about that); a taller
   view keeps the video whole. The frame still reaches beyond the video at the top and the bottom (YouTube's title bar). */
.yt-fit { display: none; }
.player-wrap:fullscreen .yt-fit, .player-wrap.yt-max .yt-fit { display: grid; }
.player-wrap.yt-fill:fullscreen .player, .player-wrap.yt-fill.yt-max .player { width: 100%; height: 100%; aspect-ratio: auto; container-type: size; }
@container (orientation: landscape) {
  .yt-fill .yt iframe { --vw: min(max(100cqw, 177.78cqh), 1.22 * min(100cqw, 177.78cqh)); left: 50%; top: 50%; width: var(--vw); height: calc(var(--vw) * .5625 + 2 * max(64px, var(--vw) * .050625)); transform: translate(-50%, -50%); }
}
/* a phone held upright that a page cannot turn (iPhone): the player turned a quarter, the video along the screen's length (2026-10-29) */
@media (orientation: portrait) and (max-width: 600px) {
  .player-wrap.yt-max { inset: auto; top: 0; left: 100%; width: 100vh; width: 100dvh; height: 100vw; transform-origin: 0 0; transform: rotate(90deg); }
  .player-wrap.yt-max .player { width: min(100vh, 177.78vw); width: min(100dvh, 177.78vw); }
}
/* The YouTube player's watermark (2026-10-30, js/courses.js wmHTML): the code tiled faintly over the whole video, and the moving
   line (.wm-box above). Under the cover and the controls, never taking a tap. */
.wm-tile { position: absolute; inset: 0; z-index: 1; pointer-events: none; background-repeat: repeat; background-size: 240px 130px; }
/* the lesson on another device: the notice and its button */
.player.elsewhere { aspect-ratio: auto; min-height: 220px; padding: 24px 18px; } /* its text and button, whole on a phone */
.player.elsewhere .btn { pointer-events: auto; }
.player.elsewhere .btn .i { width: 18px; height: 18px; color: inherit; opacity: 1; } /* not the notice's large icon */
.home-tip { margin-top: 10px; font-size: .84rem; }
/* the full view's controls clear of a phone's rounded corners, notch and home bar (from the Home Screen the view reaches them) */
.player-wrap.yt-max .yt-bar { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
@media (orientation: portrait) and (max-width: 600px) { /* turned a quarter: the bar's ends lie at the screen's top and bottom */
  .player-wrap.yt-max .yt-bar { padding-left: max(10px, env(safe-area-inset-top)); padding-right: max(10px, env(safe-area-inset-bottom)); padding-bottom: 8px; }
}
/* A capture key on a lesson (2026-10-29, js/courses.js captureWarning): the warning in both languages, the server's answer under it */
.cap-dlg .modal-h h2 { display: flex; align-items: center; gap: 8px; color: var(--bad); }
.cap-warn { display: grid; gap: 14px; }
.cap-lang { display: grid; gap: 6px; line-height: 1.6; }
.cap-lang + .cap-lang { padding-top: 12px; border-top: 1px solid var(--line); }
.cap-lead { font-weight: 700; color: var(--text); }
.cap-status { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: .92rem; line-height: 1.55; }
.cap-status.warn { background: var(--warn-bg); border-color: var(--warn); }
.cap-status.bad { background: var(--bad-bg); border-color: var(--bad); font-weight: 700; }
/* the admin's list of a student's violations */
.cap-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cap-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.cap-list li.cleared { opacity: .65; }
.cap-list small { flex-basis: 100%; }
/* the lesson page: nothing to select, copy or print */
.course-layout { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media print { .course-layout, .player-wrap { display: none !important; } }

/* ---------- Certificates (js/certs.js) ---------- */
.cert-note { display: flex; gap: 8px; align-items: flex-start; margin: -4px 0 14px; font-size: .86rem; color: var(--muted); }
.cert-note .i { flex: none; margin-top: 2px; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.cert-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); min-height: 210px; }
.cert-card h3 { font-size: 1rem; }
.cert-card p { font-size: .85rem; }
.cert-card.earned { background: linear-gradient(135deg, rgb(226 172 63 / .14), rgb(108 209 250 / .1)), var(--surface); border-color: rgb(226 172 63 / .55); }
.cert-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface); color: var(--navy-800); border: 1px solid var(--line); }
.cert-card.earned .cert-ic { background: var(--gold); color: #fff; border-color: transparent; }
.cert-prog { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.cert-prog .track-line { flex: 1; height: 8px; }
.cert-prog b { font-size: .85rem; white-space: nowrap; }
.cert-view { display: grid; place-items: center; min-height: 220px; background: var(--surface-2); border-radius: 12px; overflow: hidden; }
.cert-view img { display: block; width: 100%; height: auto; }

/* ---------- The admin's notifications (js/dash.js) ---------- */
.ntf-menu { position: relative; }
.ntf-menu > summary { position: relative; list-style: none; cursor: pointer; }
.ntf-menu > summary::-webkit-details-marker { display: none; }
.ntf-menu > summary .count { position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border-radius: 9px; background: var(--bad); color: #fff; font-size: .7rem; font-weight: 700; }
.ntf-pop { width: min(380px, calc(100vw - 24px)); max-height: min(70vh, 540px); overflow-y: auto; }
.ntf-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.ntf-h .btn { width: auto; min-height: 36px; }
.role-pop a.ntf-item { align-items: flex-start; font-weight: 500; }
.ntf-item > span { display: grid; gap: 2px; line-height: 1.35; min-width: 0; }
.ntf-item b { font-weight: 500; font-size: .88rem; overflow-wrap: anywhere; }
.ntf-item small { color: var(--muted); font-size: .75rem; }
.ntf-item.unread { background: rgb(108 209 250 / .12); }
.ntf-item.unread b { font-weight: 700; }
.ntf-item > .i { flex: none; margin-top: 2px; color: var(--sky-700); }
.ntf-none { padding: 18px 10px; text-align: center; font-size: .88rem; }

/* ---------- Bundles and product galleries (js/catalog.js) ---------- */
.bundle-card { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); margin: 22px 0 6px; overflow: hidden; border: 1.5px solid rgb(226 172 63 / .6);
  background: linear-gradient(135deg, rgb(226 172 63 / .12), rgb(108 209 250 / .12)), var(--surface); }
.bundle-covers { display: flex; align-items: center; justify-content: center; min-height: 250px; padding: 30px 22px; border: 0; cursor: pointer; background: radial-gradient(circle at 50% 60%, var(--sky-200), transparent 72%); }
.bundle-covers > span { flex: 0 1 21%; aspect-ratio: 3 / 4; margin-inline-start: -3%; border-radius: 12px; overflow: hidden; background: #fff; border: 3px solid #fff; box-shadow: 0 10px 24px rgb(7 31 61 / .22); transition: transform .3s var(--ease); }
.bundle-covers > span:first-child { margin-inline-start: 0; }
.bundle-covers > span:nth-child(odd) { transform: rotate(-4deg); }
.bundle-covers > span:nth-child(even) { transform: rotate(4deg) translateY(10px); }
.bundle-covers:hover > span, .bundle-covers:focus-visible > span { transform: none; }
.bundle-covers img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 72%; }
.bundle-body { display: flex; flex-direction: column; gap: 10px; padding: 24px; }
.bundle-body h3 { font-size: 1.3rem; color: var(--navy-900); }
.bundle-tag { align-self: flex-start; }
.bundle-names { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .9rem; }
.bundle-names li { display: flex; align-items: flex-start; gap: 8px; }
.bundle-names .i { flex: none; width: 18px; height: 18px; margin-top: 3px; color: var(--ok); }
.bundle-actions { margin-top: 6px; gap: 10px; }
.bundle-break { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.bundle-break ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bundle-break li { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.bundle-break .product-thumb { width: 36px; height: 36px; }
.bundle-sum { display: flex; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px dashed var(--line-2); font-size: .92rem; }
.bundle-sum.total { border-top-style: solid; color: var(--navy-900); }
@media (max-width: 760px) { .bundle-card { grid-template-columns: minmax(0, 1fr); } .bundle-covers { min-height: 0; padding: 22px 14px 26px; } .bundle-body { padding: 16px; } }
@media (prefers-reduced-motion: reduce) { .bundle-covers > span { transition: none; } }
.pd .product-img img { object-fit: contain; background: #fff; }
.gal-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; background: var(--surface); }
.gal-thumb { flex: none; width: 64px; height: 64px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid var(--line); background: var(--surface-2); cursor: pointer; }
.gal-thumb[aria-pressed="true"] { border-color: var(--sky-500); box-shadow: 0 0 0 3px rgb(54 181 236 / .25); }
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.incl { display: block; margin-top: 2px; font-size: .78rem; color: var(--muted); }
.incl .i { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- The soroban (js/soroban.js): the reference's deep-blue abacus in the site's colours ---------- */
.sb-card { display: grid; gap: 14px; padding: 18px; }
.sb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sb-value { display: grid; line-height: 1.1; min-width: 0; overflow-wrap: anywhere; } /* 17 digits on a phone: wraps, never wider than the card */
.sb-value span { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sb-value b { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); color: var(--navy-900); }
.sb-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; font-size: .9rem; }
.sb-host { padding: clamp(8px, 2vw, 18px); border-radius: 20px; background: radial-gradient(circle at 30% 20%, #17408f, #0a2357 72%); }
.sb-svg { display: block; width: 100%; height: auto; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
/* the frame's and the beads' colours: the admin's (js/soroban.js Soroban.lookVars), else the original's */
.sb-frame { fill: var(--sb-frame, #2a5aa0); }
.sb-inner { fill: #0d2b5c; }
.sb-wire { stroke: rgb(255 255 255 / .38); stroke-width: 4; }
.sb-beam { fill: var(--sb-beam, #3f72bb); }
.sb-dot { fill: #fff; }
.sb-col { fill: transparent; stroke: transparent; stroke-width: 4; }
.sb-rod { outline: none; }
.sb-rod:focus-visible .sb-col { stroke: var(--sky-400); }
.sb-bead { cursor: grab; transition: transform .18s cubic-bezier(.3, .7, .4, 1); }
.sb-bead .t { fill: var(--sb-bead-t, #6ea7ee); }
.sb-bead .b { fill: var(--sb-bead, #2f6bc2); }
.sb-bead.ref .t { fill: var(--sb-ref-t, #f6d27a); }   /* the reference bead: the site's gold (--gold), or the admin's colour */
.sb-bead.ref .b { fill: var(--sb-ref, var(--gold)); }
.sb-bead .edge { fill: none; stroke: rgb(4 19 39 / .4); stroke-width: 1.5; }
.sb-bead.on .edge { stroke: rgb(255 255 255 / .9); stroke-width: 2.5; }
/* a bead that moves lights up in gold for a moment (a ring and a glow, the bead brightened), then is itself again */
/* a bead that moved: a ring and a glow in the site's coral (against the blue and the gold beads), or the admin's light colour, fading back; its own colour never changes */
.sb-bead .hl { fill: none; stroke: var(--sb-light, var(--coral)); stroke-width: 6; opacity: 0; pointer-events: none; }
.sb-bead.flash .hl { animation: sbFlash .9s ease-out; }
.sb-bead.flash { animation: sbGlow .9s ease-out; }
@keyframes sbFlash { 0%, 35% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sbGlow { 0% { filter: brightness(1.35) drop-shadow(0 0 12px var(--sb-light, var(--coral))); } 100% { filter: none; } }
/* 2026-11-02, the admin's light on a bead that counts: the ring, and the bead lit from inside in the same colour. Continuous:
   while it counts. Timed: --sb-light-s seconds after it moved there, then the short flash's fade. No filter on a lit bead:
   a soroban of 17 rods may hold 85 of them, redrawn at every move on a phone. */
.lit-on .sb-bead.on .hl, .lit-timed .sb-bead.on.flash .hl { fill: var(--sb-light, var(--coral)); fill-opacity: .32; }
.lit-on .sb-bead.on .hl { opacity: 1; animation: none; }
.lit-timed .sb-bead.on.flash .hl { animation: sbHold var(--sb-light-s, 3s) linear, sbFlash .9s ease-out var(--sb-light-s, 3s); }
@keyframes sbHold { from, to { opacity: 1; } }
.sb-digit { fill: #ffd34d; font: 700 34px var(--num); }
.sb-digit.zero { fill: rgb(255 211 77 / .45); }
.no-digits .sb-digit, .no-num .sb-value b { visibility: hidden; } /* numbers off: neither under the rods nor the value */
.sb-how { font-size: .85rem; }
.sb-stage { display: grid; gap: 14px; }
/* The landscape view (js/soroban.js land): the whole screen; on an upright screen the stage is laid out landscape and
   shown a quarter turn clockwise, so the soroban runs along the long side */
.sb-card.sb-max { position: fixed; inset: 0; z-index: 120; display: block; padding: 0; border: 0; border-radius: 0; background: var(--bg); touch-action: none; overscroll-behavior: contain; }
.sb-max .sb-stage { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; padding: 8px 12px; }
.sb-max .sb-bar { gap: 8px; }
.sb-max .sb-value b { font-size: 1.6rem; }
.sb-max .sb-host { flex: 1; min-height: 0; display: grid; padding: 8px; }
.sb-max .sb-svg { width: 100%; height: 100%; }
.sb-max .sb-how { display: none; }
@media (orientation: portrait) {
  .sb-max.sb-wide .sb-stage { inset: auto; top: 0; left: 100%; width: 100vh; width: 100dvh; height: 100vw; transform-origin: 0 0; transform: rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) { .sb-bead { transition: none; } .sb-bead.flash { animation: none; } }

/* 2026-10-24: the preview of a locked activity (js/views.js lockedPanel), the account type on Create Account, and the
   header's Log in / Create account for visitors */
.pv-h { font-size: 1.3rem; display: flex; align-items: center; gap: 8px; }
.pv-q { display: grid; gap: 14px; align-content: start; justify-items: start; }
.pv-sb { width: min(100%, 420px); }
.pv-try { overflow: hidden; max-width: 520px; }
.pv-try .written { color: #fff; }
.pv-end { margin-top: 18px; text-align: start; }
.pv-end h3 { color: #fff; margin-bottom: 10px; }
.pv-end .banner { color: var(--text); margin: 0; }
#pv-sb-task { margin-bottom: 12px; }
.acct-type { display: flex; margin-bottom: 18px; }
.acct-type a { flex: 1; justify-content: center; }
@media (max-width: 380px) { .hdr-auth { padding-inline: 10px; } .hdr-auth .i { display: none; } }

/* 2026-10-24, third release. The date of birth: a text box, and the calendar beside it (the date input over its icon). */
.dob-in { display: flex; gap: 8px; }
.dob-in .input { flex: 1; min-width: 0; }
.dob-pick { position: relative; flex: none; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; overflow: hidden; }
.dob-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
/* The Trainers page's cards: a band in the trainer's colour, the avatar over its edge. */
.tcard .tc-ban { height: 72px; flex: none; display: flex; justify-content: flex-end; align-items: flex-start; padding: 12px 14px; background: linear-gradient(120deg, hsl(var(--h) 62% 30%), hsl(calc(var(--h) - 20) 78% 52%)); }
.tcard .teacher-top { flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 0; margin-top: -36px; }
.tcard .teacher-top .av { box-shadow: 0 0 0 4px var(--surface); }
.tcard .teacher-top > div { min-width: 0; }
.tc-bio { color: var(--muted); font-size: .92rem; white-space: pre-line; overflow-wrap: anywhere; }
/* (2026-10-31) the bio is the card's content now: whole (600 characters at most), easy to read */
.tcard .tc-bio { color: var(--text); line-height: 1.75; }
/* The trainer's public link (their dashboard, the admin's Teachers). */
.t-link { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.t-link .input { flex: 1 1 220px; min-width: 0; font-size: .85rem; }
.t-link-box { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.t-link-wait { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
/* The training log: one line a session, opened for its details. */
.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-item { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.log-item > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 180px) auto 20px; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; }
.log-item > summary::-webkit-details-marker { display: none; }
.log-item > summary:focus-visible { outline: 3px solid var(--sky-500); outline-offset: 2px; }
.log-item > summary > .i { transition: transform .2s; color: var(--muted); }
.log-item[open] > summary > .i { transform: rotate(180deg); }
.log-main { display: flex; flex-direction: column; min-width: 0; }
.log-main small { color: var(--muted); font-size: .8rem; }
.log-pts { font-size: 1.05rem; }
.log-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 16px; margin: 0; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.log-dl dt { font-size: .75rem; color: var(--faint); font-weight: 700; }
.log-dl dd { margin: 2px 0 0; font-size: .92rem; overflow-wrap: anywhere; }
.res-item > summary { list-style: none; cursor: pointer; }
.res-item > summary::-webkit-details-marker { display: none; }
.res-item > summary:focus-visible { outline: 3px solid var(--sky-500); outline-offset: 2px; border-radius: 8px; }
.res-item > summary > .i:last-child { flex: none; color: var(--muted); transition: transform .2s; }
.res-item[open] > summary > .i:last-child { transform: rotate(180deg); }
.res-item .log-dl { border-top: 0; padding-inline: 0; }
.ch-res { display: block; margin-top: 4px; font-size: .78rem; color: var(--muted); }
.res-when { margin: 10px 0 0; font-size: .8rem; font-weight: 700; color: var(--muted); }
@media (max-width: 560px) { .log-item > summary { grid-template-columns: minmax(0, 1fr) auto 20px; } .log-item > summary .acc { display: none; } .log-dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 2026-11-02: an exam result in the staff's list (js/dash.js examResults): who and when, then the verdict and the mark */
.ex-item > summary { grid-template-columns: minmax(0, 1fr) auto 20px; }
.ex-mark { display: flex; align-items: center; gap: 10px; }
/* the admin's Soroban section (js/dash.js sorobanAdmin, second release of 2026-11-02): the choices beside a preview that
   stays in view while they scroll (on a phone the preview first); each colour a row of ready colours to tap, 44 px each */
.sb-admin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); gap: 18px; align-items: start; }
.sb-prev-card { position: sticky; top: 88px; display: grid; gap: 10px; }
.sb-prev-card .hint { margin: 0; }
@media (max-width: 960px) { .sb-admin { grid-template-columns: minmax(0, 1fr); } .sb-prev-card { position: static; order: -1; } .sb-prev-card .sb-prev { max-width: 420px; } }
.sb-pick { display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.sb-pick:last-child { border-bottom: 0; padding-bottom: 0; }
.sb-pick-h small { display: block; font-size: .82rem; }
.sb-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sb-sw { position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid rgb(0 0 0 / .2); background: var(--c); color: #fff; cursor: pointer; transition: transform .15s var(--ease); }
.sb-sw:hover { transform: scale(1.08); }
.sb-sw:focus-visible, .sb-custom:focus-within { outline: 3px solid var(--sky-500); outline-offset: 3px; }
.sb-sw[aria-pressed="true"], .sb-custom.on { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--navy-900); }
.sb-sw .i { width: 20px; height: 20px; stroke-width: 3; filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 2px rgb(0 0 0 / .6)); } /* the tick and the plus: seen on white and on black */
.sb-custom { background: conic-gradient(#e53935, #fdd835, #43a047, #00bcd4, #1e63c4, #8e24aa, #e53935); }
.sb-custom.on { background: var(--c); }
.sb-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; } /* the tap lands on the picker itself (iPhone too) */
@media (prefers-reduced-motion: reduce) { .sb-sw { transition: none; } .sb-sw:hover { transform: none; } }
/* An English certificate asks for the name in English first. */
.cert-name { width: min(100%, 460px); display: flex; flex-direction: column; gap: 12px; padding: 24px 16px; }

/* 2026-10-25. Profile pictures: over the initials, cut to the circle. */
.av { position: relative; overflow: hidden; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.av-tools.busy { opacity: .55; pointer-events: none; }
.av-pick { cursor: pointer; }
.av-pick:focus-within { outline: 3px solid var(--sky-500); outline-offset: 2px; }
.av-hint { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.field > label .opt { font-weight: 500; }
.name-en-form { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
/* The Teachers page's cards: photo and name first, then what they teach, what people wrote, and contact at the foot. */
.tgrid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); align-items: stretch; }
.tcard { padding: 0; }
.tcard .tc-ban { height: 88px; }
.tc-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; margin-top: -48px; padding: 0 20px; }
.tc-head .av { box-shadow: 0 0 0 4px var(--surface), 0 8px 20px rgb(11 36 71 / .16); margin-bottom: 6px; }
.tc-head h2 { font-size: 1.15rem; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.tc-head p { color: var(--muted); font-size: .88rem; }
.tc-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.tc-body { padding: 18px 20px 0; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.tc-reviews { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
#t-public .tc-reviews { margin-top: 16px; }
.tc-rv-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 36px; }
.tc-rv-h h3 { display: flex; align-items: center; gap: 6px; font-size: .92rem; font-weight: 800; }
.tc-rv-h h3 .i { color: var(--sky-700); }
.tc-quote { margin: 0; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-inline-start: 3px solid var(--sky-500); border-radius: 12px; }
.tc-quote p { font-size: .9rem; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.rv-list { display: flex; flex-direction: column; gap: 10px; }
.rv-list .tc-quote p { display: block; -webkit-line-clamp: unset; }
.tc-quote footer { margin-top: 6px; font-size: .8rem; color: var(--muted); }
.tc-quote footer b { color: var(--text); font-weight: 700; }
.tc-rv-empty { color: var(--muted); font-size: .88rem; }
/* the reviews taking turns (2026-10-31): every turn in the same cell, the box as tall as the tallest, only the shown one seen */
.rv-rot { display: grid; }
.rv-g { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 10px; opacity: 0; visibility: hidden; transition: opacity .5s var(--ease), visibility 0s .5s; }
.rv-g.on { opacity: 1; visibility: visible; transition: opacity .5s var(--ease); }
.rv-pause { width: 32px; height: 32px; }
.rv-pause .i { width: 16px; height: 16px; }
.rv-shown-card { margin-bottom: 16px; max-width: 520px; }
.tc-rv-write { align-self: flex-start; }
.tc-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 20px 20px; margin-top: auto; }
.tc-foot .btn { flex: 1 1 140px; justify-content: center; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.rv-sent { text-align: center; padding: 8px 0 4px; display: grid; gap: 8px; justify-items: center; }
.rv-sent > .i { width: 48px; height: 48px; color: var(--ok); }
/* Admin → Reviews */
.rv-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.rv-item-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.rv-body { white-space: pre-line; overflow-wrap: anywhere; margin: 10px 0 14px; line-height: 1.65; }
@media (prefers-reduced-motion: reduce) { .tcard, .tc-quote, .rv-g, .rv-g.on { transition: none; } }

/* ---------- 2026-10-27: joining a trainer from their link, the trainer's join requests, the admin's look at a picture ---------- */
.join-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.join-card h2 { font-size: 1.15rem; font-weight: 800; }
.join-card p { line-height: 1.65; }
.join-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--sky-200); color: var(--sky-700); }
.join-ic .i { width: 24px; height: 24px; }
.join-card.wait .join-ic { background: var(--warn-bg); color: var(--warn); }
.join-card.no .join-ic { background: var(--bad-bg); color: var(--bad); }
.join-act { gap: 8px; margin-top: 4px; }
.join-act .btn { min-height: 44px; }
.join-ask { display: grid; justify-items: center; text-align: center; gap: 10px; padding-top: 6px; }
.join-ask .join-q { font-size: 1.05rem; line-height: 1.6; }
.join-ask .err:empty { display: none; }
.jr-list { list-style: none; margin: 0; padding: 0; }
.jr-item { flex-wrap: wrap; }
.jr-item .grow { min-width: 160px; }
.jr-act { gap: 8px; }
.jr-act .btn { min-height: 40px; }
.jr-full { margin-bottom: 8px; color: var(--warn); }
/* The admin enlarges a student's picture: the avatar is the button (a 44 px target around the small one) */
.av-zoom { position: relative; display: inline-grid; flex: none; padding: 0; border: 0; background: none; border-radius: 50%; cursor: zoom-in; color: inherit; }
.av-zoom::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; }
.av-zoom:focus-visible { outline: 3px solid var(--sky-500); outline-offset: 3px; border-radius: 50%; }
.av-zoom .av { transition: box-shadow .15s, transform .15s; }
.av-zoom:hover .av { box-shadow: 0 0 0 3px var(--sky-400); }
.av-zoom-i { position: absolute; inset-inline-end: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--navy-800); box-shadow: var(--sh-2); pointer-events: none; }
.av-zoom-i .i { width: 16px; height: 16px; }
.av-zoom.sm .av-zoom-i { display: none; }
dialog.modal.av-dlg { width: fit-content; max-width: calc(100vw - 24px); }
.av-big { margin: 0; min-width: min(240px, calc(100vw - 72px)); min-height: 200px; display: grid; place-items: center; }
.av-big img { display: block; width: auto; height: auto; max-width: min(100%, calc(100vw - 72px)); max-height: calc(100svh - 160px); border-radius: 14px; object-fit: contain; background: var(--surface-2); }
.av-big .spin { width: 32px; height: 32px; border: 3px solid var(--sky-500); border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@media (prefers-reduced-motion: reduce) { .av-zoom .av { transition: none; } }

/* ---------- 2026-10-27, second release: a record opened from a notification; the training log's order; why a section is closed ---------- */
.spot { animation: spot 2.4s var(--ease); outline: 3px solid var(--sky-500); outline-offset: 3px; }
@keyframes spot { 0%, 30% { box-shadow: 0 0 0 8px rgb(54 181 236 / .28); } 100% { box-shadow: 0 0 0 0 rgb(54 181 236 / 0); } }
.log-sort { margin-bottom: 14px; }
.log-sort button { flex: 1 1 auto; justify-content: center; }
.log-time { color: var(--navy-800); font-weight: 700; white-space: nowrap; }
.log-time .i { width: 14px; height: 14px; vertical-align: -2px; }
.log-note { margin-top: 10px; }
.log-more { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 560px) { .log-sort { display: flex; width: 100%; } .log-sort button { padding: 8px 6px; font-size: .86rem; } }
/* The closed-section note: a title and its reason beside the lock, what to do under them on a phone (the text used to be
   squeezed to one word a line beside the WhatsApp button). */
.pv-note { align-items: flex-start; gap: 12px 16px; }
.pv-note .grow { flex: 1 1 280px; }
.pv-note-t { display: block; font-size: 1.02rem; line-height: 1.5; }
.pv-note .grow p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; line-height: 1.7; overflow-wrap: break-word; }
.pv-note .pv-act { gap: 8px; align-self: center; }
.pv-note .pv-act:not(:has(*)) { display: none; }
.pv-note .pv-act .btn { min-height: 44px; }
@media (max-width: 560px) {
  .pv-note { padding: 16px; }
  .pv-note .ic { width: 40px; height: 40px; border-radius: 12px; }
  .pv-note .grow { flex-basis: calc(100% - 56px); }
  .pv-note .pv-act { width: 100%; }
  .pv-note .pv-act .btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .spot { animation: none; } }

/* ---------- Stars of the Week (2026-10-28, js/home.js): three equal first places, each a podium cube with its 1 ---------- */
.stars { overflow-x: clip; background: radial-gradient(55% 60% at 50% 100%, rgb(226 172 63 / .09), transparent 70%), var(--surface-2); border-block: 1px solid var(--line); }
.star-week { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: 4px; padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; font-weight: 700; color: var(--navy-800); white-space: nowrap; vertical-align: middle; }
.star-week .i { width: 15px; height: 15px; }
.stars-row { list-style: none; max-width: 1040px; margin: 44px auto 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2.6vw, 32px); }
/* only the categories with a star (2026-10-29): two or one cube keep a cube's width, centred, never stretched across */
.stars-row[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 700px; }
.stars-row[data-n="1"] { grid-template-columns: minmax(0, 1fr); max-width: 340px; }
.star { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.star-top { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; padding: 0 6px 32px; max-width: 100%; }
.star-av { position: relative; display: inline-grid; margin-bottom: 6px; }
.star-av .av.lg { width: 88px; height: 88px; font-size: 1.8rem; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--gold), 0 14px 30px -12px rgb(7 31 61 / .5); }
.star-mark { position: absolute; top: -4px; inset-inline-end: -6px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--navy-950); box-shadow: 0 0 0 3px var(--surface), var(--sh-2); }
.star-mark .i { width: 16px; height: 16px; fill: currentColor; }
/* the full name (2026-11-10): one step above the body text, never the size of a heading; a long name wraps in balanced lines */
.star-name { font-size: clamp(1rem, .95rem + .25vw, 1.12rem); font-weight: 700; color: var(--text); line-height: 1.45; overflow-wrap: anywhere; text-wrap: balance; max-width: 26ch; }
.star-stat { font-size: .85rem; color: var(--muted); }
/* The cube: a navy front with its top face (the ::before, tilted away) and a gold edge, the 1 and the category on its front. */
.star-block { position: relative; width: 100%; min-height: 188px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 22px 14px; color: #fff;
  background: linear-gradient(180deg, var(--navy-700), var(--navy-950)); border-radius: 0 0 18px 18px; box-shadow: var(--sh-3), inset 0 1px 0 rgb(255 255 255 / .1); transition: transform .35s var(--ease); }
.star-block::before { content: ''; position: absolute; inset-inline: 0; bottom: 100%; height: 30px; border-radius: 14px 14px 0 0; background: linear-gradient(0deg, var(--navy-600), #3a6cad); transform: perspective(220px) rotateX(52deg); transform-origin: bottom; }
.star-block::after { content: ''; position: absolute; inset-inline: 22%; top: 0; height: 3px; border-radius: 0 0 4px 4px; background: var(--gold); }
.star-one { font-family: var(--num); font-weight: 800; font-size: clamp(3.6rem, 2.6rem + 3vw, 5.2rem); line-height: .9; color: var(--gold); text-shadow: 0 8px 28px rgb(226 172 63 / .35); }
.star-cat { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: .95rem; color: var(--sky-300); line-height: 1.35; }
.star-cat .i { width: 18px; height: 18px; flex: none; }
.star:hover .star-block { transform: translateY(-3px); }
.star:hover .star-mark { animation: starPop .6s var(--ease); }
@keyframes starPop { 50% { transform: scale(1.18) rotate(14deg); } }
/* A phone: one star under another, the cube small at the start, the category above the student. */
@media (max-width: 640px) {
  .stars-row, .stars-row[data-n] { grid-template-columns: 1fr; max-width: 1040px; gap: 12px; margin-top: 28px; }
  .star { display: grid; grid-template-columns: 76px minmax(0, 1fr); grid-template-areas: 'one cat' 'one top'; gap: 4px 14px; align-items: center; text-align: start; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh-1); }
  .star-block { display: contents; }
  .star-one { grid-area: one; width: 76px; height: 76px; display: grid; place-items: center; border-radius: 16px; font-size: 2.8rem; background: linear-gradient(180deg, var(--navy-700), var(--navy-950)); box-shadow: inset 0 3px 0 var(--gold), var(--sh-2); }
  .star-cat { grid-area: cat; justify-content: flex-start; font-size: .85rem; color: var(--sky-700); }
  .star-top { grid-area: top; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: 'av name' 'av stat'; align-items: center; justify-items: start; gap: 0 18px; padding: 0; }
  .star-av { grid-area: av; margin: 0; }
  .star-av .av.lg { width: 44px; height: 44px; font-size: 1rem; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold); }
  .star-mark { width: 20px; height: 20px; top: -6px; inset-inline-end: -8px; box-shadow: 0 0 0 2px var(--surface); }
  .star-mark .i { width: 11px; height: 11px; }
  .star-name { grid-area: name; font-size: 1rem; max-width: none; }
  .star-stat { grid-area: stat; }
}
/* A new Star of the Week (js/home.js starParty): five seconds over the page, never in its way. The layer takes no click and
   clips its particles (nothing reaches past the screen's sides); the card sits under the header. 4.55 s + .45 s out = 5 s. */
.star-party { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; contain: strict; }
.sp-card { position: absolute; z-index: 4; /* above the flying emojis (.cheer-fx: 3), so the names stay readable */ top: calc(var(--hdr) + 18px); left: 50%; transform: translateX(-50%); width: min(440px, calc(100% - 32px)); display: grid; justify-items: center; gap: 4px; padding: 26px 22px 20px; text-align: center; color: #fff;
  border-radius: 24px; background: radial-gradient(120% 90% at 50% 0%, rgb(226 172 63 / .28), transparent 60%), linear-gradient(160deg, var(--navy-700), var(--navy-950)); border: 1px solid rgb(226 172 63 / .55);
  box-shadow: 0 0 0 6px rgb(226 172 63 / .12), 0 24px 60px -18px rgb(4 19 39 / .7); animation: spIn .6s cubic-bezier(.2, .9, .3, 1.25) both, spOut .45s ease-in 4.55s forwards; }
.sp-badge { font-size: 2.6rem; line-height: 1; filter: drop-shadow(0 6px 16px rgb(226 172 63 / .6)); animation: spBadge 1.2s ease-in-out .5s 2; }
.sp-kicker { margin: 8px 0 0; font-weight: 800; font-size: clamp(1.25rem, 1.1rem + .8vw, 1.6rem); line-height: 1.25; color: var(--gold); }
.sp-title { margin: 0; font-size: .92rem; font-weight: 700; color: rgb(255 255 255 / .78); }
.sp-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; width: 100%; }
.sp-list li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .1); }
.sp-cat { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: clamp(1.02rem, .96rem + .3vw, 1.18rem); font-weight: 700; line-height: 1.4; color: var(--sky-300); }
.sp-cat .i { width: 20px; height: 20px; flex: none; }
@keyframes spIn { from { opacity: 0; transform: translate(-50%, -24px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes spOut { to { opacity: 0; transform: translate(-50%, -14px) scale(.97); } }
@keyframes spBadge { 50% { transform: scale(1.15) rotate(-8deg); } }
@media (prefers-reduced-motion: reduce) { .sp-fx { display: none; } .sp-card { animation: none; } .sp-badge { animation: none; } }
/* Dashboard → Overview → Best Trainees: a trainee with certificates (2026-11-10) */
/* A student's certificates (js/certs.js certsCard): the buttons go under the title when the row is narrow (2026-11-15) */
#prof-certs .list-item { flex-wrap: wrap; }
#prof-certs .list-item .grow { flex: 1 1 180px; min-width: 0; }
.cert-withdraw { color: var(--bad); }
/* Best Trainees on the home page, the admin's only (2026-11-15, js/home.js bestHome) */
.best-home { border-block: 1px solid var(--line); }
.best-list { margin-top: 20px; max-width: 760px; }
.top-cert { display: inline-flex; align-items: center; gap: 3px; color: var(--ok); font-weight: 700; }
.top-cert .i { width: 13px; height: 13px; }
/* Dashboard → Homepage sections → Stars of the Week */
.star-mode { margin: 6px 0 4px; }
.star-mode label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; min-height: 40px; border-radius: 10px; font-weight: 700; font-size: .9rem; color: var(--muted); white-space: nowrap; cursor: pointer; transition: all .2s var(--ease); }
.star-mode label:hover { color: var(--navy-900); }
.star-mode label:has(:checked) { background: var(--navy-900); color: #fff; }
.star-mode label:has(:focus-visible) { outline: 3px solid var(--sky-500); outline-offset: 2px; }
.star-adms { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.star-adm { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: var(--surface-2); min-width: 0; }
.star-adm h4 { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin-bottom: 10px; }
.star-adm-grid { display: grid; gap: 12px; }
.star-adm .lbl { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }

/* The first view the server writes for each page (server/seo.js): the page's heading, words and links, shown until the
   scripts draw the page over it, and read by search engines and link previews that run no script. */
.seo-pre { padding-bottom: 72px; }
.vband.hero + .seo-pre { margin-top: 32px; }
.seo-pre .card > * + * { margin-top: 18px; }
.seo-sec h2 { font-size: 1.15rem; margin-bottom: 10px; }
.seo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.seo-list li { display: flex; gap: 12px; align-items: flex-start; }
.seo-list img { flex: none; width: 88px; height: 88px; object-fit: cover; border-radius: var(--r-sm); background: var(--surface-2); }
.seo-list h3 { font-size: 1rem; }
.seo-list p { margin: 4px 0 0; font-size: .9rem; }
.seo-meta { font-weight: 700; color: var(--navy-800); }
.seo-links { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 6px; }
.seo-links a, .seo-list a { font-weight: 700; color: var(--navy-800); }
.seo-pic { display: block; width: min(320px, 100%); height: auto; aspect-ratio: 1; object-fit: contain; border-radius: var(--r); background: var(--surface-2); }
.crumbs > span[aria-hidden] { opacity: .6; }

/* 2026-11-04: a student's activities. The admin's three choices for each, with what is open now and why (js/dash.js
   accessCard); the trainer's toggles: all their students at once, then a student per row (activitiesView). */
.ac-row { gap: 8px 16px; }
.ac-f { min-width: 0; }
.ac-why { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: .82rem; color: var(--muted); }
.ac-why.is-open { color: var(--ok); }
.ac-seg button { min-height: 38px; padding: 6px 12px; font-size: .85rem; }
.tg-allrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 14px; margin-bottom: 12px; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--surface-2); }
.tg-all { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.tg-tbl th:not(:first-child), .tg-tbl td:not(.first) { text-align: center; }
@media (max-width: 900px) { .tg-tbl tr { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); } .tg-tbl td:not(.first) { text-align: start; } }

/* Admin: a product's pictures and a package's contents (2026-11-08) */
fieldset.field { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.field > legend.lbl { display: flex; align-items: center; justify-content: flex-start; gap: 8px; padding: 0; margin-bottom: 4px; }
.pics-ed, .part-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.pic-tile { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.pic-tile img { width: 72px; height: 72px; flex: none; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.pic-tile.is-main { border-color: var(--sky-500); box-shadow: 0 0 0 3px rgb(54 181 236 / .16); }
.pic-acts { display: flex; gap: 2px; margin-inline-start: auto; }
.pic-acts .icon-btn:disabled, .part-row .icon-btn:disabled { opacity: .3; cursor: default; }
.pic-add { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; padding: 12px; border: 2px dashed var(--line-2); border-radius: 14px; color: var(--navy-800); font-weight: 600; cursor: pointer; transition: background .2s, border-color .2s; }
.pic-add:hover { background: var(--surface-2); border-color: var(--sky-500); }
.pic-add:focus-within { outline: 3px solid var(--sky-500); outline-offset: 2px; }
.part-row { display: flex; align-items: center; gap: 10px; }
.part-row select { flex: 1; min-width: 0; }
.part-row input { width: 76px; flex: none; text-align: center; }
.qty-x { margin-inline-start: 4px; color: var(--navy-800); white-space: nowrap; }
@media (max-width: 480px) { .pic-tile { gap: 8px; } .pic-tile img { width: 56px; height: 56px; } .pic-acts .icon-btn { width: 40px; }
  /* a phone: the product's whole name on its own line, its quantity and the bin under it */
  .part-row { flex-wrap: wrap; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); } .part-row select { flex: 1 1 calc(100% - 50px); } .part-row input { width: 88px; } .part-row .icon-btn { margin-inline-start: auto; } }
