/* ---- copied from copycub-game/design/tokens.css — do not edit here ----
 * The game is the source of these colours. Change them there, then copy
 * the file across; the game's CI fails if its own copy drifts. */
:root {
	/* The page: home, the splash, the installed app's own background.
	   game/src/Main.gd, game/src/loop/LoopHarness.gd _build_home,
	   project.godot boot_splash/bg_color */
	--cc-page: #1c1f2b;

	/* The play surface, one step up from the page.
	   game/src/loop/LoopHarness.gd _bg */
	--cc-surface: #292b38;

	/* Text. White on the page; the example word at 62%; the quietest
	   text — the build number — in a blue-grey.
	   game/src/loop/LoopHarness.gd font_color */
	--cc-text: #ffffff;
	--cc-text-soft: rgba(255, 255, 255, 0.62);
	--cc-text-quiet: #8c94ad;

	/* The frame round a picture, and the letters drifting behind play.
	   game/src/loop/LoopHarness.gd _frame, game/src/fx/LetterField.gd ink */
	--cc-frame: rgba(255, 255, 255, 0.55);
	--cc-letters: rgba(255, 255, 255, 0.05);

	/* The brand shades, from the characters.
	   game/src/ui/BrandBadge.gd SHADES */
	--cc-green: #6fc48c;
	--cc-red: #f4756b;
	--cc-blue: #6ac0db;
	--cc-pink: #fc889d;
	--cc-peach: #fb9c85;
	--cc-magenta: #db6ba3;
	--cc-teal: #72cac1;
	--cc-plum: #441b4e;
	--cc-yellow: #f6c85f;

	/* The languages' colours: Afrikaans green, English purple; pastel, and
	   far from every avatar colour and brand shade.
	   game/src/ui/LanguagePicker.gd COLOURS */
	--cc-lang-af: #a6e8b4;
	--cc-lang-en: #bba0f0;

	/* Children's avatars: vivid where the characters are pastel, so a
	   child's figure never reads as a language character or a badge.
	   game/src/ui/Avatar.gd COLOURS */
	--cc-avatar-violet: #9b6bff;
	--cc-avatar-lime: #9bd93b;
	--cc-avatar-orange: #ff9230;
	--cc-avatar-cobalt: #3d8bff;
	--cc-avatar-raspberry: #f0457a;
	--cc-avatar-fuchsia: #d555f2;
	--cc-avatar-emerald: #2bc27a;
	--cc-avatar-gold: #ffc21a;
}

/* ---- end of the copy ---- */

/* The page is dark, so the browser's own controls (radio buttons, scroll
   bars, a dialog's defaults) should be drawn dark too. */
:root { color-scheme: dark; }

/* CopyCub — the parent's side.
 *
 * The game's palette, the same as the marketing site: the navy page, white to
 * read, plum for the band across the top, the pastels as accents. */

:root {
	--paper: var(--cc-page);
	--paper-warm: var(--cc-surface);
	--ground: var(--cc-page);
	--ink: var(--cc-text);
	--ink-soft: var(--cc-text-soft);
	--ink-quiet: var(--cc-text-quiet);
	--line: rgba(255, 255, 255, 0.10);
	--edge: rgba(255, 255, 255, 0.22);
	--plum-raised: #5c2d66;
	--on-plum: #e6d4e4;

	--magenta: var(--cc-magenta);
	--green: var(--cc-green);
	--green-wash: var(--cc-surface);
	--peach-wash: var(--cc-surface);
	--danger: var(--cc-red);
	--danger-edge: var(--cc-red);

	--display: "Fraunces", Georgia, "Times New Roman", serif;
	--body: "Nunito Sans", system-ui, -apple-system, sans-serif;
	/* The page's column: main, the bar's contents and the footer all line up
	   on it. A page with a narrower column sets --page-max on its body. */
	--page-max: 1180px;
	--gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	/* The game's drifting letters, standing still (--cc-letters). */
	background: var(--ground) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' font-family='Nunito Sans,sans-serif' font-weight='700' fill='rgba(255,255,255,0.05)'%3E%3Ctext x='18' y='62' font-size='54' transform='rotate(-12 40 50)'%3Ea%3C/text%3E%3Ctext x='150' y='44' font-size='40' transform='rotate(9 160 34)'%3Ek%3C/text%3E%3Ctext x='96' y='150' font-size='62' transform='rotate(6 110 130)'%3Eb%3C/text%3E%3Ctext x='20' y='208' font-size='42' transform='rotate(-7 30 196)'%3E3%3C/text%3E%3Ccircle cx='196' cy='182' r='16' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='5'/%3E%3C/svg%3E") repeat;
	color: var(--ink);
	font-family: var(--body);
	font-size: 17px;
	line-height: 1.55;
	-webkit-text-size-adjust: 100%;
}

h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(30px, 5vw, 40px); }
h2 { font-size: 22px; }
p { margin: 0; }
a { color: var(--ink); }
a:hover { color: var(--magenta); }
[hidden] { display: none !important; }

.logo { height: 40px; width: auto; }
.small { font-size: 15px; color: var(--ink-quiet); }
.loading { padding: 40px 16px; text-align: center; color: var(--ink-quiet); }

/* Anything that can be tapped is at least 44px tall. */
.btn {
	min-height: 44px;
	padding: 10px 22px;
	border-radius: 999px;
	border: 2px solid transparent;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-go { background: var(--green); color: var(--cc-plum); }
.btn-quiet { background: var(--cc-surface); border-color: var(--edge); color: var(--ink); }
.btn-danger { background: var(--cc-surface); border-color: var(--danger-edge); color: var(--danger); }
.btn:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; }

.notice { padding: 14px 18px; border-radius: 14px; background: var(--paper-warm); }
/* A reference to quote (app.js withReference): on one line, taken whole. */
.ref { white-space: nowrap; user-select: all; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Waiting on the server (app.js and the admin page's busy()): a bar across
   the top while any request is out, shown after a moment so a quick one does
   not flash, and a spinner in the button that started it. The bar stays
   while the page is leaving for another (PayFast, sign-in). */
.wait-bar {
	position: fixed; inset: 0 0 auto 0; z-index: 10; height: 4px; overflow: hidden;
	pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
.wait-bar::before {
	content: ""; position: absolute; inset: 0 auto 0 0; width: 40%;
	background: var(--cc-yellow); animation: progress 1.1s ease-in-out infinite;
}
html.waiting .wait-bar { opacity: 1; transition-delay: 0.2s; }
html.waiting, html.waiting .btn { cursor: progress; }
@keyframes progress { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.is-busy { opacity: 1; cursor: progress; }
.btn.is-busy::before, .loading::before {
	content: ""; display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.55em; vertical-align: -0.12em;
	border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
	animation: spin 0.7s linear infinite;
}
.loading::before { display: block; width: 28px; height: 28px; margin: 0 auto 14px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.wait-bar::before { animation-duration: 3s; }
	.btn.is-busy::before, .loading::before { animation-duration: 2s; }
}
.notice-error { background: rgba(244, 117, 107, 0.14); }
.empty { padding: 28px; border: 2px dashed var(--edge); border-radius: 22px; color: var(--ink-soft); }

/* Signed out */

.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); background: var(--paper); }
.signin-about { background: var(--paper-warm); padding: 56px 64px; display: flex; flex-direction: column; gap: 24px; }
.signin-about .logo { height: 44px; align-self: flex-start; }
.signin-about p, .signin-about ul { color: var(--ink-soft); font-size: 18px; }
.signin-about ul { margin: 0; padding-left: 22px; line-height: 2; }
.signin-form { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 56px 16px; }
.signin-step { width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; }
.signin-step input {
	font: inherit; padding: 12px 14px; border-radius: 12px;
	border: 1px solid var(--edge); background: var(--paper-warm); color: var(--ink);
}
#code { font-size: 1.6rem; letter-spacing: 0.3em; text-align: center; }

/* Signed in */

.bar {
	display: flex; align-items: center; gap: 28px;
	/* The bar runs edge to edge; its contents sit in the page's column. */
	padding: 14px calc(max(0px, (100% - var(--page-max)) / 2) + var(--gutter));
	background: var(--cc-plum); color: var(--on-plum);
}
.bar .logo { height: 34px; }
.bar nav { display: flex; gap: 6px; flex-grow: 1; }
.bar nav a {
	display: inline-flex; align-items: center; min-height: 44px;
	padding: 0 16px; border-radius: 12px;
	color: var(--on-plum); text-decoration: none; font-weight: 600;
}
.bar nav a[aria-current="page"] { background: var(--plum-raised); color: var(--cc-text); font-weight: 700; }
.who { display: flex; align-items: center; gap: 14px; font-size: 15px; min-width: 0; }
#who-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { max-width: var(--page-max); margin: 0 auto; padding: 36px var(--gutter) 64px; display: flex; flex-direction: column; gap: 24px; }
main section { display: flex; flex-direction: column; gap: 24px; }
.heading { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.heading > div:first-child { flex: 1 1 280px; }
.heading p { margin-top: 8px; color: var(--ink-soft); }

.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.cards li { background: var(--cc-surface); border: 1px solid var(--line); border-radius: 26px; padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.cards h2 { font-size: 26px; overflow-wrap: anywhere; }
.cards .meta { color: var(--ink-quiet); font-size: 15px; }
.cards .actions { margin-top: 8px; }

.rows { list-style: none; margin: 0; padding: 0; background: var(--cc-surface); border: 1px solid var(--line); border-radius: 26px; overflow: hidden; }
.rows li { display: flex; align-items: center; gap: 16px; padding: 20px 26px; flex-wrap: wrap; }
.rows li + li { border-top: 1px solid var(--line); }
.rows .what { flex: 1 1 220px; min-width: 0; }
.rows h2 { font-size: 20px; overflow-wrap: anywhere; }
.rows .meta { color: var(--ink-quiet); font-size: 15px; margin-top: 4px; }
.tag { padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; background: var(--green-wash); }
.tag-quiet { background: var(--peach-wash); }

.slots { display: flex; gap: 8px; }
.slots span { width: 16px; height: 16px; border-radius: 4px; background: var(--edge); }
.slots span.used { background: var(--green); }

.explain { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.explain > div { background: var(--paper-warm); border-radius: 26px; padding: 26px 28px; }
.explain h2 { font-size: 20px; }
.explain p { margin-top: 10px; color: var(--ink-soft); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* The language switch: English | Afrikaans, each in its own language */

.lang-switch { display: inline-flex; border: 2px solid var(--edge); border-radius: 999px; padding: 2px; gap: 2px; }
.lang-switch button {
	font: inherit; font-size: 14px; font-weight: 700; color: var(--ink-soft);
	background: none; border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.lang-switch button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.signin { position: relative; }
.signin > .lang-switch { position: absolute; top: 20px; right: 20px; z-index: 1; background: var(--paper); }

/* The plan, and the fake payment page */

.plan .actions { margin-top: 6px; }
/* What can be bought, as the site's pricing page shows it: the yearly picked out. */
/* A screen-wide part of the Account tab: the plan, and the payments. */
.panel { background: var(--paper-warm); border-radius: 26px; padding: 26px 28px; display: flex; flex-direction: column; gap: 10px; }
.panel h2 { font-size: 20px; }
.panel > p { color: var(--ink-soft); }
.panel .offers { margin-top: 18px; }
.offer-current { border: 3px solid var(--cc-yellow); }
.offer-current .offer-flag { background: var(--cc-yellow); color: var(--cc-plum); }
.offer-status { color: var(--ink); font-weight: 600; }
.offer-note { font-size: 15px; }
.offer .actions .btn { width: auto; flex: 1 1 auto; margin-top: 0; text-align: center; text-decoration: none; }

/* A voucher's code, under the plans: the label, the box and its button on one
   line where there is room. */
.voucher { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; }
.voucher label { flex: 1 1 100%; font-weight: 600; color: var(--ink); }
.voucher input {
	flex: 1 1 12em; max-width: 22em; min-height: 48px; padding: 12px 16px; font: inherit; font-size: 17px;
	border: 2px solid var(--edge); border-radius: 14px; color: var(--ink); background: var(--cc-surface);
	text-transform: uppercase; letter-spacing: 0.06em;
}
.voucher .btn { flex: 0 0 auto; width: auto; margin-top: 0; }
.seller { margin-top: 18px; }

/* The payment history: a line each. */
.history { list-style: none; margin: 4px 0 0; padding: 0; }
.history li { display: flex; align-items: baseline; gap: 6px 14px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.history .when { flex: 0 0 7em; color: var(--ink-quiet); font-size: 15px; font-variant-numeric: tabular-nums; }
.history .what { flex: 1 1 180px; color: var(--ink-soft); }
.history .amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.history .why { flex: 1 1 100%; padding-left: calc(7em + 14px); color: var(--ink-quiet); font-size: 15px; }
@media (max-width: 560px) { .history .why { padding-left: 0; } }

.offers { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: stretch; margin-top: 28px; }
.offer { border: 2px solid var(--edge); border-radius: 26px; padding: 30px 26px 26px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.offer-pick { border: 3px solid var(--green); background: var(--green-wash); }
.offer-asked { outline: 3px solid var(--cc-yellow); outline-offset: 4px; }
.offer-flag { position: absolute; top: -15px; left: 26px; background: var(--green); color: var(--cc-plum); font-size: 14px; font-weight: 700; padding: 5px 14px; border-radius: 999px; }
.offer h2 { font-size: 20px; }
.offer-price { font-family: var(--display); font-size: 38px; font-weight: 700; line-height: 1; }
.offer-price small { font-family: var(--body); font-size: 17px; font-weight: 400; color: var(--ink-soft); }
.offer p, .offer ul { color: var(--ink-soft); }
.offer ul { margin: 0; padding-left: 20px; line-height: 1.8; }
.offer .btn { margin-top: auto; width: 100%; }
.test-controls { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; }
.test-controls .btn { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.fake-pay { width: min(520px, 100% - 32px); margin: 56px auto; display: flex; flex-direction: column; gap: 18px; }
.fake-pay > .lang-switch { align-self: flex-end; }
.fake-pay-what { font-size: 24px; font-weight: 700; }
/* The contact page (contact.html): the logo and the language switch, then
   one column of form. */
.contact { width: min(560px, 100% - 32px); margin: 40px auto 56px; display: flex; flex-direction: column; gap: 18px; }
.contact-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.contact-top .logo { height: 40px; width: auto; }
.contact h1, .contact p { margin: 0; }
.contact-form { display: flex; flex-direction: column; gap: 10px; }
.contact-form label { font-weight: 700; margin-top: 6px; }
.contact-form input, .contact-form select, .contact-form textarea {
	font: inherit; padding: 12px 14px; border-radius: 12px;
	border: 1px solid var(--edge); background: var(--paper-warm); color: var(--ink);
}
.contact-form textarea { resize: vertical; min-height: 160px; }
.contact-form .btn { align-self: flex-start; margin-top: 8px; }
/* Sent: the notice, then Back as a button, as the help page's Write to us. */
.contact-done { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
/* The "For schools" card's form (app.js schools): the school search's
   results as a short list to tap, ticks on one line with their words. */
.schools-form fieldset { margin-top: 6px; }
/* The grades: plain ticks like the terms one above them, not the pill
   buttons other fieldsets have (optional, for our statistics only). */
#schools-grades { gap: 10px 24px; }
#schools-grades label { display: flex; align-items: center; gap: 10px; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; font-weight: 600; }
#schools-grades legend { padding: 0; font-size: inherit; }
#schools-grades input { width: 20px; height: 20px; flex: 0 0 auto; }
.schools-form .tick, .emails .tick { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.schools-form .tick input, .emails .tick input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--ink); }
.school-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.school-results button { width: 100%; text-align: left; font: inherit; color: var(--ink); background: var(--cc-surface);
	border: 2px solid var(--edge); border-radius: 14px; padding: 10px 14px; cursor: pointer; }
.school-results button:hover, .school-results button:focus-visible { border-color: var(--ink); }
.school-results .town { color: var(--ink-quiet); font-size: 15px; }
.school-picked { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-weight: 700; }

/* The help's column is the portal's width, so the bar and the page line up
   as on every other tab; its running text stops at a readable length. */
.help article p, .help article ol { max-width: 75ch; }
.help { padding-top: 40px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 18px; }
.help h1, .help p { margin: 0; }
#help-body { display: flex; flex-direction: column; gap: 18px; }
#help-search {
	font: inherit; padding: 12px 14px; border-radius: 12px;
	border: 1px solid var(--edge); background: var(--paper-warm); color: var(--ink);
}
.help-parts { display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: var(--paper-warm); align-self: flex-start; }
.help-parts a { padding: 8px 18px; border-radius: 999px; text-decoration: none; font-weight: 700; color: var(--ink-quiet); }
.help-parts a[aria-current="page"] { background: var(--paper); color: var(--ink); }
#help-topics { display: flex; flex-wrap: wrap; gap: 8px 16px; }
#help-topics[hidden], #help-body[hidden] { display: none; }
#help-articles article { display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }
#help-articles h2 { margin: 0; }
#help-articles section { scroll-margin-top: 16px; }
#help-articles h3 { margin: 0 0 6px; }
#help-articles ol { margin: 0 0 8px; padding-left: 1.4em; }
#help-articles section p { margin: 0 0 8px; }
.help-anchor { color: var(--ink-quiet); text-decoration: none; font-weight: 400; }
.help-pictures { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 12px; }
/* Every picture is a phone's screen: its room is kept before it loads, so an
   address to a section further down still lands on it. */
.help-pictures img { width: min(220px, 100%); height: auto; aspect-ratio: 1082 / 2202; object-fit: contain; border-radius: 14px; border: 1px solid var(--edge); background: var(--paper-warm); }
.help-write { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 20px; border-radius: 16px; background: var(--paper-warm); }
.help-write h2 { margin: 0; }
.help-anchor:hover, .help-anchor:focus { text-decoration: underline; }

.device-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
#pair-code { font-size: 1.5rem; letter-spacing: 0.15em; text-transform: uppercase; text-align: center; }

.link-button { font: inherit; color: var(--ink); text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }
.link-qr { width: min(240px, 70vw); margin: 0 auto; }
.link-qr svg { display: block; width: 100%; height: auto; border-radius: 12px; }
/* A child's avatar: the game's figures in the children's colours */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.avatar-pick label.figure { padding: 4px 8px; min-height: 0; }
.avatar-pick label.figure img { height: 56px; width: auto; display: block; }
.avatar-pick label.figure input, .swatches input { position: absolute; opacity: 0; pointer-events: none; }
/* Each colour from the stylesheet: the page's policy allows no inline style. */
.swatch[data-colour="violet"] { --swatch: var(--cc-avatar-violet); }
.swatch[data-colour="lime"] { --swatch: var(--cc-avatar-lime); }
.swatch[data-colour="orange"] { --swatch: var(--cc-avatar-orange); }
.swatch[data-colour="cobalt"] { --swatch: var(--cc-avatar-cobalt); }
.swatch[data-colour="raspberry"] { --swatch: var(--cc-avatar-raspberry); }
.swatch[data-colour="fuchsia"] { --swatch: var(--cc-avatar-fuchsia); }
.swatch[data-colour="emerald"] { --swatch: var(--cc-avatar-emerald); }
.swatch[data-colour="gold"] { --swatch: var(--cc-avatar-gold); }
.swatches label.swatch { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; background: var(--swatch); border: 3px solid transparent; }
.swatches label.swatch:has(input:checked) { border-color: var(--ink); background: var(--swatch); box-shadow: 0 0 0 3px var(--cc-page) inset; }
.avatar-pick label.figure img { height: 48px; }
.avatar-pick label:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.rows .avatar { width: 52px; height: 52px; object-fit: contain; flex: 0 0 auto; }

/* A child's progress, folded under their row as a teacher's devices are:
   the week, their level, a card for each game, then words and letters. */
.child-progress { flex-basis: 100%; margin: 0 0 0 68px; }
.child-progress summary { cursor: pointer; color: var(--ink); font-size: 16px; font-weight: 700; padding: 10px 0; }
.child-progress[open] summary { margin-bottom: 4px; }
@media (max-width: 560px) { .child-progress { margin-left: 0; } }
.progress { display: flex; flex-direction: column; gap: 16px; }
.progress .tracks, .progress .more { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.progress .tracks > div { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.progress .more { gap: 16px 28px; }
/* In a game's card, its name over its level: side by side, a long name
   ("Pick the picture in Afrikaans") wrapped to three lines. */
.progress .tracks .track { flex-direction: column; align-items: flex-start; gap: 6px; }
.progress h3 { font-size: 17px; margin: 0 0 4px; }
.progress p { margin: 0; }
.progress .track { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.progress .level { font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.progress .child-level { width: 100%; height: 12px; accent-color: var(--cc-yellow); margin: 4px 0; }
.btn-small { min-width: 36px; min-height: 36px; padding: 0 10px; font-size: 18px; }
.progress .meta { color: var(--ink-quiet); font-size: 15px; }

#pair-link { display: flex; flex-direction: column; gap: 18px; }
#pair-link-text { width: 100%; min-width: 0; font-size: 14px; }
/* Copy and Share side by side under the link, sharing the width; Copy alone
   fills it where the browser cannot share. */
.link-actions { display: flex; gap: 10px; margin: 0; }
.link-actions .btn { flex: 1 1 0; white-space: nowrap; }
.link-actions .btn[hidden] { display: none; }

/* The add/rename dialog */

/* A dialog is not part of the page's background: without its own, the
   browser paints it white, under white text. */
dialog {
	border: 2px solid var(--edge); border-radius: 26px; padding: 0; width: min(460px, calc(100vw - 32px));
	color: var(--ink); background: var(--paper);
}
dialog::backdrop { background: rgb(0 0 0 / 0.55); }
dialog form { padding: 28px; display: flex; flex-direction: column; gap: 18px; }
dialog label { display: flex; flex-direction: column; gap: 8px; font-weight: 700; font-size: 15px; }
dialog input:not([type="radio"]) {
	min-height: 48px; padding: 12px 16px; font: inherit; font-size: 17px;
	border: 2px solid var(--edge); border-radius: 14px; color: var(--ink); background: var(--cc-surface);
}
dialog select {
	min-height: 48px; padding: 12px 16px; font: inherit; font-size: 17px;
	border: 2px solid var(--edge); border-radius: 14px; color: var(--ink); background: var(--cc-surface);
}
/* Who plays on a device: the child, then anyone or only them, then what
   the game will do. */
.who-plays { display: flex; flex-direction: column; gap: 10px; }
.who-plays[hidden], .who-plays fieldset[hidden] { display: none; }
.who-plays p { margin: 0; }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
legend { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
fieldset label { flex-direction: row; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 2px solid var(--edge); border-radius: 999px; font-weight: 600; cursor: pointer; }
fieldset label:has(input:checked) { border-color: var(--ink); background: var(--paper-warm); }
fieldset input { width: 18px; height: 18px; accent-color: var(--ink); }
dialog .actions { justify-content: flex-end; }
/* A choice of two, each a sentence: one under the other, the whole line tappable. */
fieldset.choice { flex-direction: column; flex-wrap: nowrap; }
fieldset.choice label { align-items: flex-start; border-radius: 18px; padding: 12px 16px; font-weight: 600; line-height: 1.4; }
fieldset.choice input { margin-top: 2px; flex: 0 0 auto; }

/* Phones */

@media (max-width: 760px) {
	.signin { grid-template-columns: 1fr; }
	.signin-about { padding: 32px 16px; }
	.bar { flex-wrap: wrap; gap: 8px 16px; }
	.bar nav { order: 3; flex-basis: 100%; }
	.bar nav a { flex: 1 1 0; justify-content: center; padding: 0 6px; }
	.who { margin-left: auto; }
	#who-email { display: none; }
}
/* The smallest phones, in Afrikaans: "Toestelle" and "Rekening" need the room. */
@media (max-width: 360px) {
	.bar nav { gap: 2px; }
	.bar nav a { padding: 0 2px; font-size: 15px; }
}

/* The footer, the marketing site's (footer.js) ----------------------------- */

.site-foot { border-top: 1px solid var(--edge); margin-top: 24px; }
.site-foot .wrap {
	max-width: var(--page-max); margin: 0 auto; padding: 28px var(--gutter);
	display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center;
	font-size: 15px; color: var(--ink-quiet);
}
.site-foot a { text-decoration: none; }
.site-foot .grow { flex-grow: 1; }
.site-foot .ver { font-variant-numeric: tabular-nums; }

/* A school's teacher's dialog (app.js openTeacher): buttons in a row from
   the left, under each heading, and the holder's one-time code large. */
dialog .actions.start { justify-content: flex-start; }
#teacher-dialog h3 { margin: 18px 0 4px; font-size: 1rem; }
#teacher-dialog .rows { margin: 8px 0; }
#teacher-code-value { font: 700 1.6rem/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.15em; }

/* The ways in (copycub-game docs/schools.md §6.1): a family's few figures,
   a school's crowd of them. */
.choose { min-height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 56px 16px; background: var(--paper); position: relative; text-align: center; }
.choose > .lang-switch { position: absolute; top: 20px; right: 20px; }
.choose .logo { height: 44px; }
.choose h1 { margin: 0; }
.choose-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); gap: 24px; width: 100%; justify-content: center; }
.choose-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 24px; border-radius: 22px; background: var(--paper-warm); border: 3px solid transparent; color: var(--ink-soft); text-decoration: none; font-size: 17px; }
.choose-card strong { color: var(--ink); font-size: 24px; }
.choose-card:hover, .choose-card:focus-visible { border-color: var(--green); }
.crowd { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; height: 132px; align-content: center; }
.crowd img { width: 64px; height: 64px; object-fit: contain; }
.crowd-few img { width: 84px; height: 84px; margin: 0 4px; }
.crowd-many { width: 260px; }
.crowd-many img { width: 52px; height: 52px; margin: -8px -6px; }
@media (max-width: 640px) {
	.choose { padding-top: 84px; }
	.choose-cards { grid-template-columns: minmax(0, 1fr); }
}
.notice-warn { background: rgba(246, 200, 95, 0.14); color: var(--ink); }
#door-note { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
#door-note p { margin: 0; flex: 1 1 260px; }

/* A school's bill laid out before paying for added teachers (§6.8), and the
   licence card's pick of how many teachers. */
.breakdown { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-soft); }
.offer-teachers { align-items: center; gap: 10px; font-weight: 600; }
.offer-teachers select, #schools-add-n { min-height: 44px; padding: 6px 12px; font: inherit; }

/* A school's teacher: their own devices, folded under their row
   (copycub-game docs/schools.md §6.6). */
.teacher-devices { flex-basis: 100%; margin: 4px 0 0 68px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.teacher-devices summary { cursor: pointer; color: var(--ink-soft); font-size: 15px; font-weight: 600; }
.teacher-devices ul { list-style: none; margin: 8px 0 0; padding: 0; border-left: 3px solid var(--line); width: 100%; }
.rows .teacher-devices li { display: flex; align-items: center; gap: 12px; padding: 8px 0 8px 16px; flex-wrap: wrap; border: 0; }
.teacher-devices li .what { flex: 1 1 200px; }
.teacher-devices li h3 { font-size: 16px; margin: 0; }
.teacher-devices li p { margin: 2px 0 0; color: var(--ink-quiet); font-size: 14px; }
.teacher-devices .btn { min-height: 36px; padding: 4px 14px; font-size: 14px; margin-top: 4px; }
.teacher-devices.count { color: var(--ink-quiet); font-size: 15px; margin-top: 0; }
@media (max-width: 560px) { .teacher-devices { margin-left: 0; } }

/* Deleting's warnings (copycub-game docs/privacy-requests.md). */
.warnings { margin: 0; padding-left: 20px; line-height: 1.6; display: flex; flex-direction: column; gap: 6px; }

/* Maintenance mode (app.js, admin side src/settings.js): a strip across the
   top while the site is paused, and greyed-out paying with a tiny tag. */
.maintenance-banner {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--cc-yellow);
	color: var(--cc-page);
	padding: 10px 16px;
	text-align: center;
	font-weight: 700;
	line-height: 1.4;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.maintenance-banner-note { display: block; font-weight: 600; opacity: 0.85; }
.maintenance-banner-note:empty { display: none; }

/* A pay button greyed out while maintenance mode holds. */
.btn.btn-maint, .btn.btn-maint:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	filter: grayscale(0.6);
}

/* The tiny "under maintenance" tag beside a greyed pay button. */
.maint-tag {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-left: 8px;
	font-size: 12px;
	font-weight: 700;
	color: var(--cc-yellow);
	vertical-align: middle;
}
.maint-tag-dot { font-size: 13px; line-height: 1; }
