/* Phone first: the base styles fit 360px; wider layouts are added with min-width queries.
   One "sky" look for every screen: a night-blue sky with aurora and starlight, gold for mastery, an owl. The --sky-* tokens are
   the source; the older names (--bg, --surface, ...) point at them so every screen follows the same look. */
:root {
  /* always dark, as in mathly1: there is no light set */
  --sky-bg: #060a19; --sky-surface: #121b3b; --sky-ink: #e9edfb; --sky-mute: #9aa6cf; --sky-line: #27335f;
  --sky-accent: #8ea6ff; --sky-on-accent: #0b1220; --sky-aurora: #46e0c8; --sky-gold: #ffd166; --sky-danger: #ff9a7a;
  --sky-night: #0e1532; --sky-star: #eaf0ff; --sky-glow: .32;
  --sky-owl: #b88458; --sky-owl-belly: #f2d8b8; --sky-owl-eye: #fff7e6; --sky-owl-pupil: #1b2140; --sky-beak: #e08a1e;
  --bg: var(--sky-bg); --surface: var(--sky-surface); --text: var(--sky-ink); --muted: var(--sky-mute);
  --line: var(--sky-line); --accent: var(--sky-accent); --accent-text: var(--sky-on-accent); --danger: var(--sky-danger);
  --gutter: 16px; --radius: 12px; color-scheme: dark;
}
/* Nothing moves when the device asks for less motion. */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  /* the sky: two soft glows as in mathly1, and small stars; nothing moves, so it needs no reduced-motion rule */
  background:
    radial-gradient(1.5px 1.5px at 12% 20%, var(--sky-star), transparent), radial-gradient(1px 1px at 70% 35%, var(--sky-star), transparent),
    radial-gradient(1.5px 1.5px at 40% 12%, var(--sky-star), transparent), radial-gradient(1px 1px at 88% 15%, var(--sky-star), transparent),
    radial-gradient(1px 1px at 25% 60%, var(--sky-star), transparent), radial-gradient(1.5px 1.5px at 92% 70%, var(--sky-star), transparent),
    radial-gradient(1px 1px at 55% 85%, var(--sky-star), transparent), radial-gradient(1px 1px at 6% 90%, var(--sky-star), transparent),
    radial-gradient(120% 60% at 85% -10%, rgb(52 70 170 / var(--sky-glow)), transparent 60%),
    radial-gradient(90% 50% at 0% 40%, rgb(120 60 160 / calc(var(--sky-glow) / 2)), transparent 70%),
    var(--bg);
  background-attachment: fixed; color: var(--text);
  font: 16px/1.5 system-ui, "Segoe UI", Arial, "Noto Sans Hebrew", sans-serif;
  overflow-x: hidden;
}
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px var(--gutter); background: var(--surface); border-bottom: 1px solid var(--line);
}
.top h1 { margin: 0; font-size: 20px; }
main { padding: var(--gutter); max-width: 960px; margin: 0 auto; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--gutter); margin-block: 12px;
}
.card h2 { margin: 0 0 8px; font-size: 18px; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
button, .button {
  font: inherit; min-height: 44px; padding: 8px 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
input, textarea, select {
  font: inherit; width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
textarea { min-height: 120px; }
label { display: block; margin-block: 8px 4px; font-weight: 600; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; justify-content: space-between; }
ul.plain li:last-child { border-bottom: 0; }
.formula { direction: ltr; unicode-bidi: isolate; }
@media (min-width: 720px) { main { padding: 24px; } }
.m { font-family: "STIX Two Math", "Cambria Math", serif; direction: ltr; unicode-bidi: isolate; white-space: nowrap; font-size: 1.05em; }
.m.m-img { font-size: 1.12em; }
.m-img svg { display: inline-block; overflow: visible; max-width: none; }

/* Bank figures and graphs (figures.js). Always left-to-right: they are coordinates and letters. */
.mx-figure, .mx-plot { direction: ltr; margin: 8px auto; width: 100%; max-width: 340px; text-align: center; }
.mx-figure svg, .mx-plot svg { display: block; width: 100%; height: auto; }
.mx-figure .s { stroke: var(--accent); stroke-width: 2.2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.mx-figure .d { stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 5 4; fill: none; }
.mx-figure .mk { stroke: var(--text); stroke-width: 1.4; fill: none; opacity: .75; }
.mx-figure .g, .mx-plot .g { stroke: var(--line); stroke-width: 1; }
.mx-figure .ax { stroke: var(--muted); stroke-width: 1.4; }
.mx-figure circle { fill: var(--accent); }
.mx-figure text { text-anchor: middle; fill: var(--text); font: 600 13px system-ui, sans-serif; }
.mx-figure .v { font-style: italic; font-weight: 700; font-size: 15px; }
.mx-figure .n { font-weight: 500; font-size: 9px; fill: var(--muted); }
.mx-figure .t { font-weight: 500; font-size: 13px; fill: var(--muted); }
.mx-figure p { margin: 2px 0 4px; font-weight: 600; }
.mx-figure small { font-size: 12px; color: var(--muted); }
.mx-plot .a { stroke: var(--muted); stroke-width: 1.5; }
.mx-plot .c { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.mx-plot circle { fill: var(--accent); }
.mx-plot text { font: 11px system-ui, sans-serif; fill: var(--muted); }

/* Student screens */
.tabs { display: flex; gap: 8px; margin-block: 4px 0; }
.tabs a { flex: 1; text-align: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text); background: var(--surface); }
.tabs a[aria-current="page"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }
.goal { display: flex; gap: 12px; align-items: center; background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.grow { flex: 1; }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.lesson h3 { margin: 0 0 6px; font-size: 16px; }
.lesson h3 small { font-weight: 400; font-size: 13px; }
ul.skills li a { flex: 1; color: var(--text); text-decoration: none; padding-block: 6px; }
.tag { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; white-space: nowrap; color: var(--muted); }
.tag.st-mastered { border-color: var(--ok, #15803d); color: var(--ok, #15803d); font-weight: 700; background: color-mix(in srgb, var(--ok, #15803d) 12%, transparent); }
.tag.st-learning { border-style: dashed; color: var(--text); }
:root { --ok: #6ee7a0; --warn: #fbbf6a; }

/* The owl */
.sky-owl { display: block; overflow: visible; margin-inline: auto; }
.sky-owl .o-b { fill: var(--sky-owl); } .sky-owl .o-belly { fill: var(--sky-owl-belly); } .sky-owl .o-eye { fill: var(--sky-owl-eye); }
.sky-owl .o-pupil { fill: var(--sky-owl-pupil); } .sky-owl .o-glint { fill: #fff; }
.sky-owl .o-feather { fill: none; stroke: var(--sky-owl); stroke-width: 1.6; opacity: .45; }
.sky-owl .o-glass { fill: none; stroke: var(--sky-gold); stroke-width: 3; }
.sky-owl .o-beak { fill: var(--sky-beak); } .sky-owl .o-feet { fill: none; stroke: var(--sky-beak); stroke-width: 3; stroke-linecap: round; }
.sky-owl .o-lid { fill: var(--sky-owl); transform-box: fill-box; transform-origin: center; transform: scaleY(0); animation: sky-blink 5.5s infinite; }
@keyframes sky-blink { 0%, 94%, 100% { transform: scaleY(0); } 96%, 98% { transform: scaleY(1); } }

/* The sign-in page */
.signin { display: grid; place-content: center; gap: 14px; text-align: center; min-height: 70vh; padding: 24px 16px;
  background: linear-gradient(180deg, var(--sky-night), var(--bg)); border-radius: var(--radius); }
.signin .logo { font-size: 30px; font-weight: 800; letter-spacing: .5px; margin: 0; }
.signin .status { color: var(--muted); margin: 0; }
.signin form { text-align: start; width: min(100%, 320px); margin-inline: auto; }
.pill { border-radius: 999px; min-height: 44px; padding: 10px 24px; border: 0; font-weight: 700; cursor: pointer;
  background: var(--sky-aurora); color: #04211b; }
.hint { background: var(--bg); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--muted); }

/* Header: role chips, access link, sign-out */
.top nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.roles { display: flex; flex-wrap: wrap; gap: 6px; }
.roles button { border-radius: 999px; min-height: 40px; padding: 6px 14px; }
.roles button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }

/* Manager, teacher and admin screens: cards that use a wide screen, tables that scroll inside their box */
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.cards .card { margin-block: 0; }
.hrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hrow .grow { flex: 1 1 auto; }
.tag { display: inline-block; font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; color: var(--muted); white-space: nowrap; }
.subtabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.subtabs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { border-collapse: collapse; width: 100%; }
table.data th, table.data td { padding: 8px 10px; text-align: start; border-bottom: 1px solid var(--line); font-size: 14px; }
table.data th { background: var(--sky-night); }
.checks { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.checks label { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 400; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.checks input { width: auto; }
.switch { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.switch input { width: auto; }
button.danger { color: var(--danger); border-color: var(--danger); }

/* A role tag with a remove button: the pill stays slim, the button keeps a 44px target */
.tag:has(button) { display: inline-flex; align-items: center; padding-inline-start: 10px; padding-block: 0; }
.tag button { border: 0; background: transparent; color: inherit; min-width: 44px; min-height: 44px; padding: 0; }

/* ---- The path: a trail of lessons, each a hub with its skills as stars in a ring ---- */
.path-top { margin-bottom: 4px; }
.trail { display: flex; flex-direction: column; align-items: center; gap: 28px; margin-top: 18px; }
.trail > * { position: relative; width: 100%; }
.trail > *:not(:first-child)::before { content: ""; position: absolute; bottom: 100%; left: 50%; width: 6px; height: 28px; margin-left: -3px;
  background: var(--line); border-radius: 3px; }
.trail .mark { text-align: center; color: var(--muted); }
.trail .mark b { display: block; }
.trail .start b { color: var(--sky-aurora); }
.orbit { container-type: inline-size; }
.orbit .stage { --R: min(112px, 31cqw); position: relative; height: calc(var(--R) * 2.2 + 140px); }
.orbit .ring { position: absolute; left: 50%; top: 50%; width: calc(var(--R) * 2); height: calc(var(--R) * 2.2);
  transform: translate(-50%, -50%); pointer-events: none; overflow: visible; }
.orbit .ring path { fill: none; stroke: var(--line); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.orbit .ring path.on { stroke: var(--accent); }
.orbit .ring path.back { opacity: .45; stroke-dasharray: 2 7; }
.orbit .hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 112px; text-align: center; z-index: 1;
  background: var(--surface); border: 2px solid var(--accent); border-radius: 16px; padding: 7px 5px; }
.orbit .hub h3 { margin: 0; font-size: 13px; line-height: 1.25; }
.orbit .hub .count { display: inline-block; margin-top: 4px; font-size: 11px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--muted); }
.orbit.completed .hub { box-shadow: 0 0 0 3px var(--sky-gold); }
.orbit.behind .hub { box-shadow: 0 0 0 3px var(--sky-warn, #ff9f6b); }
.lesson-status { margin: 0 auto 6px; text-align: center; font-size: 13px; font-weight: 600; }
.lesson-status.late, .behind-note { color: var(--sky-warn, #ff9f6b); }
.lesson-status.done { color: var(--sky-gold); }
.behind-note { margin: 8px 0 0; font-weight: 600; }
.star { position: absolute; left: calc(50% + var(--dx) * var(--R)); top: calc(50% + var(--dy) * var(--R) * 1.1); transform: translate(-50%, -26px);
  width: 84px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--text); border-radius: 12px; }
.star:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.star .node { position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface);
  border: 3px solid var(--line); }
.star .node svg { width: 24px; height: 24px; fill: var(--line); }
.star .num { position: absolute; top: -7px; inset-inline-end: -7px; min-width: 20px; height: 20px; border-radius: 999px; background: var(--surface);
  border: 2px solid var(--line); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.star .lbl { font-size: 11.5px; text-align: center; line-height: 1.2; }
.star .lbl em { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); }
.star.st-learning .node { border-color: var(--accent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 30%, var(--surface)) 50%, var(--surface) 50%); }
.star.st-learning .node svg { fill: var(--accent); }
.star.st-mastered .node { border-color: var(--sky-gold); background: color-mix(in srgb, var(--sky-gold) 22%, var(--surface)); }
.star.st-mastered .node svg { fill: var(--sky-gold); width: 28px; height: 28px; }
.star.st-mastered .num { border-color: var(--sky-gold); }
.star.next .node { width: 62px; height: 62px; border-color: var(--sky-aurora); box-shadow: 0 0 0 5px color-mix(in srgb, var(--sky-aurora) 25%, transparent); animation: sky-pulse 1.8s ease-out infinite; }
.star.next .node svg { fill: var(--text); }
.star .perch { position: absolute; top: -26px; inset-inline-start: -30px; width: 30px; pointer-events: none; }
@keyframes sky-pulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--sky-aurora) 8%, transparent); } }

/* ---- The exercise screen (the sheet itself is styled in board.css, with the board) ---- */
.ex-chip { display: inline-block; font-size: 12px; font-weight: 700; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; background: var(--sky-night); color: var(--text); text-decoration: none; }
a.ex-chip.link { color: var(--accent); border-color: var(--accent); margin-inline-end: 4px; }
.mx-sheet h3 { margin: 6px 0 0; font-size: 22px; line-height: 1.2; }
.ex-done { font-size: 13px; font-weight: 700; color: var(--ok, #15803d); border: 1px solid var(--ok, #15803d); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.ex-help { min-width: 44px; min-height: 44px; border-radius: 999px; font-weight: 800; font-size: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.ex-help[aria-expanded="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.mx-x { min-width: 44px; min-height: 44px; }
.ex-explain { margin: 0; color: var(--muted); font-size: 14px; }
.ex-note { margin: 0; background: color-mix(in srgb, var(--sky-gold) 16%, var(--surface)); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.ex-progress { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.ex-dots { display: flex; flex-wrap: wrap; gap: 3px; justify-content: flex-end; }
.ex-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--line); display: grid; place-items: center; }
.ex-dots i.ok { background: var(--ok, #15803d); }
.mx-q { background: var(--bg); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ex-text { margin: 0; font-size: 19px; text-align: center; }
.ex-choices { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
@media (max-width: 420px) { .ex-choices { grid-template-columns: 1fr; } }
.ex-choice { position: relative; min-height: 48px; border: 2px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; font-size: 17px; padding: 10px; text-align: center; cursor: pointer; direction: ltr; }
.ex-choice:disabled { cursor: default; opacity: .85; }
.ex-choice.right { border-color: var(--ok, #15803d); background: color-mix(in srgb, var(--ok, #15803d) 14%, var(--surface)); opacity: 1; }
.ex-choice.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); opacity: 1; }
.ex-choice .burst { position: absolute; inset-inline-end: 10px; top: 4px; color: var(--sky-gold); font-size: 14px; pointer-events: none; animation: ex-burst .9s ease-out forwards; }
@keyframes ex-burst { from { opacity: 1; transform: translateY(6px) scale(.8); } to { opacity: 0; transform: translateY(-14px) scale(1.4); } }
.ex-fb:empty { display: none; }
.ex-ok, .ex-bad { border-radius: 12px; padding: 10px 12px; }
.ex-ok { background: color-mix(in srgb, var(--ok, #15803d) 14%, transparent); border: 1px solid var(--ok, #15803d); }
.ex-bad { background: color-mix(in srgb, var(--danger) 10%, transparent); border: 1px solid var(--danger); }
.ex-ok p, .ex-bad p { margin: 6px 0 0; }
.ex-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.ex-actions span { flex: 1; color: var(--muted); font-size: 14px; }
.ex-actions button { min-height: 44px; }
.ex-helpbox { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.ex-helpbox h4 { margin: 8px 0 4px; }
.ex-helpbox p { margin: 4px 0; }
.ex-eq { font-size: 18px; direction: ltr; text-align: center; }
.ex-steps { padding-inline-start: 22px; margin: 6px 0; }
.ex-steps li { margin-block: 6px; }
.ex-related { margin: 0; font-size: 13px; }

/* Sign-in logo (mathly1's animated logo) */
.signin img.logo { width: min(300px, 75vw); height: auto; margin: auto; }

/* Subjects: the first screen of a student */
.subjects { display: grid; gap: 12px; }
.subjects h2 { margin: 0; font-size: 20px; }
.subject-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(130deg, color-mix(in srgb, var(--sky-accent) 14%, var(--surface)), var(--surface)); color: var(--text); text-decoration: none; min-height: 72px; }
.subject-card .grow { display: grid; gap: 4px; }
.subject-card small { color: var(--muted); }
.subject-icon { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; font-weight: 700;
  background: color-mix(in srgb, var(--sky-accent) 22%, var(--bg)); color: var(--sky-accent); }
.back { display: inline-block; padding: 10px 4px; color: var(--sky-accent); font-weight: 700; text-decoration: none; }

/* A faded star: mastered, but not practiced for 14 days. Only a cue; the word "דועך" says so too. */
.star.faded .node { opacity: .55; filter: saturate(.5); box-shadow: none; }
.star.faded .node svg { fill: color-mix(in srgb, var(--sky-gold) 45%, var(--sky-mute)); }
.star.faded .lbl em { color: var(--muted); }

/* Rewards: constellations, comets */
.cons { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.con-card { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 10px; border: 1px solid var(--line);
  border-radius: 16px; background: var(--surface); text-align: center; }
.con-card figcaption { display: grid; gap: 2px; font-weight: 700; font-size: 14px; }
.con { width: 100%; max-width: 130px; height: 110px; overflow: visible; }
.con line { stroke: var(--sky-gold); stroke-opacity: .9; stroke-width: 6; stroke-linecap: round; }
.con path { fill: var(--sky-gold); }
#done-skills li.faded a { color: var(--muted); }
.comets { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.comet-tile { aspect-ratio: 3 / 4; max-width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: center; cursor: pointer; font: inherit; min-height: 44px; }
.comet-tile .sym, .comet-card .sym { font-size: 26px; font-weight: 600; line-height: 1.1; direction: ltr; color: var(--muted); }
.comet-tile small { font-size: 12px; color: var(--muted); }
.comet-tile.have { border-color: var(--sky-gold); background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--sky-gold) 22%, var(--surface)), var(--surface) 70%); }
.comet-tile.have .sym, .comet-card .sym { color: var(--sky-gold); }
.comet-tile.have small { color: var(--text); }
.comet-card { display: grid; justify-items: center; gap: 4px; padding: 14px; border-radius: 14px; background: var(--sky-night); }
.comet-dialog { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; }
.comet-dialog .scrim { position: absolute; inset: 0; background: rgb(0 0 0 / .6); }
.comet-dialog .sheet { position: relative; width: min(100%, 360px); background: var(--surface); border: 1px solid var(--sky-gold); border-radius: 18px; padding: 16px; display: grid; gap: 10px; text-align: center; }
.comet-dialog h2 { margin: 0; font-size: 18px; }
.comet-dialog p { margin: 0; }
.comet { position: fixed; z-index: 70; top: 16%; left: -130px; width: 120px; height: 56px; border: 0; padding: 0; background: none; cursor: pointer; animation: comet-fly 4s linear forwards; }
.comet svg { width: 100%; height: 100%; filter: drop-shadow(0 0 8px var(--sky-gold)); }
@keyframes comet-fly { from { transform: translate(0, 0) rotate(14deg); } to { transform: translate(calc(100vw + 260px), 40vh) rotate(14deg); } }
.comet.still { position: static; width: auto; height: auto; min-height: 44px; animation: none; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--sky-gold); background: color-mix(in srgb, var(--sky-gold) 18%, var(--surface)); color: var(--text); font-weight: 700; }

/* Lesson quizzes */
.quiz-node { display: flex; align-items: center; justify-content: center; gap: 10px; width: min(100%, 300px); min-height: 56px; margin: 4px auto 14px; padding: 8px 18px;
  border: 2px dashed var(--sky-accent); border-radius: 999px; color: var(--text); text-decoration: none; background: color-mix(in srgb, var(--sky-accent) 10%, var(--surface)); }
.quiz-node b { display: block; font-size: 16px; }
.quiz-node em { display: block; font-style: normal; font-size: 13px; color: var(--muted); }
.quiz-node.graded { border-style: solid; border-color: var(--sky-gold); }
.quiz-node.open { border-color: var(--sky-aurora); }
.qz-icon svg { width: 26px; height: 26px; fill: var(--sky-gold); }
.qz-bar { display: flex; justify-content: space-between; align-items: center; margin-block: 6px; }
.qz-timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 20px; padding: 2px 12px; border-radius: 999px; background: var(--sky-night); border: 1px solid var(--line); }
.qz-dots { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.qz-dot { width: 24px; height: 24px; min-width: 24px; min-height: 24px; padding: 0; border-radius: 50%; border: 2px solid var(--line); background: transparent; cursor: pointer; position: relative; }
.qz-dot::after { content: ""; position: absolute; inset: -10px; }                       /* the touch target is 44px */
.qz-dot.done { background: var(--sky-accent); border-color: var(--sky-accent); }
.qz-dot.cur { box-shadow: 0 0 0 3px color-mix(in srgb, var(--sky-gold) 60%, transparent); }
.qz-choice.picked { border-color: var(--sky-accent); background: color-mix(in srgb, var(--sky-accent) 22%, var(--surface)); font-weight: 700; }
.qz-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.qz-nav button { min-height: 44px; }
.qz-result { text-align: center; }
.qz-grade { margin: 6px 0; display: grid; justify-items: center; }
.qz-grade b { font-size: 56px; line-height: 1; color: var(--sky-gold); }
.qz-grade span { color: var(--muted); }
.qz-missed { padding-inline-start: 22px; display: grid; gap: 12px; }
.qz-actions { display: flex; gap: 8px; flex-wrap: wrap; }
ul.grades li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
ul.grades .gr-num { font-size: 28px; font-weight: 800; color: var(--sky-gold); grid-row: 1; grid-column: 2; }
ul.grades .bar, ul.grades .muted { grid-column: 1 / -1; }
.mx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The student's tab bar sits at the bottom of the screen, above the page and below the sheets */
.tabs { position: fixed; inset-inline: 0; bottom: 0; z-index: 40; margin: 0; gap: 4px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line); }
.tabs a { min-height: 44px; display: grid; place-items: center; border: 0; border-radius: 10px; font-weight: 600; font-size: 14px; padding-inline: 2px; min-width: 44px; flex: 1 1 auto; }
body:has(.tabs) main { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

/* Home */
.test-card h2 { margin: 0 0 4px; font-size: 20px; }
.readiness { margin-block: 10px; }
.rd-top { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.rd-num { font-size: 44px; line-height: 1; color: var(--sky-gold); }
.rd-label { font-weight: 700; }
.rd-bar { height: 12px; margin-block: 6px; }
.rd-note { margin: 6px 0 0; font-size: 14px; color: var(--sky-gold); }
.today { display: grid; gap: 6px; margin-block: 10px; }
.big-task, .primary-link { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 56px; padding: 12px 18px; border-radius: 16px;
  background: var(--accent); color: var(--accent-text); font-weight: 800; font-size: 18px; text-decoration: none; }
.primary-link { background: color-mix(in srgb, var(--sky-accent) 14%, var(--surface)); color: var(--text); border: 1px solid var(--sky-accent); font-size: 16px; }
.required { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; padding: 10px 16px; margin-block: 8px; border-radius: 14px;
  border: 2px solid var(--sky-gold); background: color-mix(in srgb, var(--sky-gold) 12%, var(--surface)); color: var(--text); text-decoration: none; }
.required b { color: var(--sky-gold); }

/* A test's card */
ol.plan { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
ol.plan li { display: flex; gap: 10px; align-items: flex-start; }
ol.plan .mark { font-weight: 800; color: var(--muted); }
ol.plan li.done .mark { color: var(--sky-aurora); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--sky-accent);
  color: var(--text); text-decoration: none; font-weight: 700; background: transparent; }
.button.primary { background: var(--accent); color: var(--accent-text); }
#exercises li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.req { color: var(--sky-gold); }

/* The teacher's tests tab */
.test-form { display: grid; gap: 6px; margin-top: 8px; }
.test-form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.test-form .check { display: block; padding: 4px 0; }
.test-form .two { display: flex; gap: 12px; }
.test-form .two > span { flex: 1; }
.sim-missing { margin: 4px 0; }
.readiness-list li { display: flex; justify-content: space-between; gap: 10px; }
.test-row { margin-block: 10px; }
.danger { border-color: var(--danger); color: var(--danger); }

/* The thinking indicator: the tapped choice spins while the server checks it, the others step back */
.ex-choice.dim { opacity: .45; }
.ex-choice.pending { opacity: 1; border-color: var(--sky-accent); background: color-mix(in srgb, var(--sky-accent) 14%, var(--surface)); }
.ex-choice.pending::after { content: ""; position: absolute; inset-inline-end: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--sky-accent) 30%, transparent); border-top-color: var(--sky-accent); animation: ex-spin .8s linear infinite; }
@keyframes ex-spin { to { transform: rotate(360deg); } }
.ex-thinking { margin: 4px 0; color: var(--muted); font-weight: 700; }

/* A wrong choice: clearly marked, with a word and a symbol on the choice (never colour alone) */
.ex-choice.wrong { border-width: 3px; background: color-mix(in srgb, var(--danger) 18%, var(--surface)); }
.ex-choice .verdict { position: absolute; inset-inline-end: 10px; top: 6px; font-size: 13px; font-weight: 800; color: var(--danger); }

/* Rounds: dots filled or marked wrong, and the round's result */
.ex-dots i.bad { background: color-mix(in srgb, var(--danger) 25%, transparent); box-shadow: inset 0 0 0 1.5px var(--danger); color: var(--danger); font-style: normal; font-size: 10px; font-weight: 800; line-height: 1; }
.ex-round { display: grid; gap: 10px; }
.ex-score { margin: 0; font-size: 18px; }
.ex-score b { font-size: 44px; line-height: 1; color: var(--sky-gold); }
.ex-missed { padding-inline-start: 22px; display: grid; gap: 12px; }

/* My assignments */
ul.assignments li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; }
ul.assignments li a { color: var(--text); text-decoration: none; }
ul.assignments li .tag { grid-column: 2; grid-row: 1 / span 2; white-space: nowrap; }
ul.assignments li[data-state="returned"] .tag, ul.assignments li[data-state="not_handed"] .tag { border-color: var(--sky-gold); color: var(--text); }

/* An assignment */
.pages { display: grid; gap: 10px; }
.pages img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.qz-written { padding-inline-start: 22px; display: grid; gap: 14px; }
.drafts { display: flex; flex-wrap: wrap; gap: 10px; }
.drafts li { position: relative; list-style: none; border: 1px solid var(--line); border-radius: 10px; padding: 4px; max-width: 46%; }
.drafts img { display: block; max-width: 100%; max-height: 160px; border-radius: 8px; background: #fff; }
.drafts .remove { position: absolute; inset-block-start: -8px; inset-inline-end: -8px; width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 50%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button.file { cursor: pointer; }
.returned { border: 2px solid var(--sky-gold); border-radius: 12px; padding: 10px 14px; background: color-mix(in srgb, var(--sky-gold) 12%, var(--surface)); }
.grade-big b { font-size: 40px; color: var(--sky-gold); }
.teacher-note { margin: 6px 0; }

/* The photo request */
.photo-request { border: 2px dashed var(--sky-accent); border-radius: 14px; padding: 10px 14px; margin-top: 8px; }
.code { font-size: 34px; letter-spacing: 6px; color: var(--sky-gold); }
.old-requests { margin-top: 6px; font-size: 14px; color: var(--muted); }
.photo-window { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 16px; background: rgb(0 0 0 / .7); }
.photo-window .sheet { width: min(100%, 360px); background: var(--surface); border: 2px solid var(--sky-gold); border-radius: 18px; padding: 16px; display: grid; gap: 6px; text-align: center; }
.photo-window h3 { margin: 0; }

/* The teacher's work tab */
.assignment-form { display: grid; gap: 8px; margin-top: 8px; }
.assignment-form label { display: grid; gap: 4px; }
.assignment-form label.check, .assignment-form label.file { display: inline-flex; gap: 6px; align-items: center; }
.assignment-form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.tag.waiting { border-color: var(--sky-gold); font-weight: 700; }

.open-submission { width: 100%; min-height: 56px; text-align: start; }

/* A button whose action takes time: a spinner, and a second press does nothing (busy.js). With reduced motion: "…" */
.busy { pointer-events: none; opacity: .85; }
.busy::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-inline-start: 8px; vertical-align: -2px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; animation: ex-spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .busy::after { content: "…"; width: auto; height: auto; border: 0; border-radius: 0; animation: none; vertical-align: baseline; } }

/* The number of items in a teacher's tab */
.tab-count { display: inline-block; min-width: 22px; padding: 0 6px; margin-inline-start: 4px; border-radius: 999px; font-size: 13px; line-height: 20px; text-align: center;
  background: color-mix(in srgb, var(--text) 16%, transparent); font-weight: 800; }
.tab-count:empty { display: none; }
[aria-pressed="true"] > .tab-count { background: color-mix(in srgb, var(--accent-text) 22%, transparent); }

/* The submissions tab */
.group { margin-top: 12px; }
.group h3 { margin: 0 0 6px; font-size: 16px; }

/* A student's row on the teacher's class card: the address, its state and two buttons must wrap on a phone */
ul.students li { flex-wrap: wrap; }
ul.students li [dir="ltr"] { overflow-wrap: anywhere; min-width: 0; }
.curriculum li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.curriculum label { flex: 1 1 200px; }
.curriculum input[type=date] { flex: 0 0 auto; }
/* the teacher's progress tab: heat map, coverage, readiness */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#progress select { max-width: 100%; margin-bottom: 8px; }
.hm { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.hm th, .hm td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: center; white-space: nowrap; }
.hm .lesson-col { white-space: normal; min-width: 90px; max-width: 150px; font-size: 12px; border-inline-start: 1px solid var(--line); }
.hm .skill-col { font-weight: 400; color: var(--muted); padding: 2px 4px; min-width: 28px; }
.hm .sticky { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--surface); text-align: start; border-inline-end: 1px solid var(--line); max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.hm td.c { width: 28px; min-width: 28px; font-weight: 700; }
.hm .c-m { background: color-mix(in srgb, var(--sky-gold) 28%, var(--surface)); color: var(--sky-gold); }
.hm .c-l { background: color-mix(in srgb, var(--sky-accent) 22%, var(--surface)); color: var(--sky-accent); }
.hm .c-n { color: var(--muted); }
.legend { margin: 6px 0 0; font-size: 12px; }
#progress, #progress .tablewrap { min-width: 0; max-width: 100%; }
#progress .tablewrap { position: relative; }   /* so the hidden words inside it (absolute) are clipped by its scrolling, not by the page */
.hm td.cov { min-width: 84px; padding: 6px 8px; }
.pbar { position: relative; height: 18px; border-radius: 9px; background: var(--line); overflow: hidden; }
.pbar i { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--sky-accent); opacity: .75; }
.hm td.cov.done .pbar i { background: var(--sky-gold); opacity: 1; }
.pbar span { position: relative; display: block; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; color: var(--ink); text-shadow: 0 0 3px var(--surface); }
.qgrade { margin-top: 3px; font-size: 13px; font-weight: 600; }
.qgrade .warn { color: var(--sky-danger); }

/* Photo help (STU-6): the student's sheet; it opens above the exercise sheet */
.ai-window { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 12px; background: rgb(0 0 0 / .72); }
.ai-window .sheet { width: min(100%, 460px); max-height: 92vh; overflow: auto; background: var(--surface); border: 2px solid var(--sky-gold); border-radius: 18px; padding: 14px 16px; display: grid; gap: 8px; }
.ai-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-top h3 { margin: 0; }
.ai-window img { max-width: 100%; max-height: 220px; border-radius: 10px; }
.ai-steps { display: grid; gap: 10px; padding: 0; list-style: none; }
.ai-hint { margin: 0 0 4px; }
.ai-work { margin: 0; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--sky-accent) 14%, var(--surface)); }
.ai-card { border: 2px dashed var(--sky-accent); border-radius: 14px; padding: 10px 14px; margin-top: 8px; display: grid; gap: 6px; }
.ai-card ul { margin: 0; }
.ai-check { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-top: 6px; }
/* The review tab: cards grouped by skill */
.review-group { margin-top: 14px; }
.review-group h3 { margin: 0 0 2px; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.review-card { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-top: 10px; background: var(--surface); }
.review-card.done { opacity: .75; border-color: var(--sky-gold); }
.review-card .ex-text { margin: 4px 0 8px; }
.review-group [hidden] { display: none; }        /* the heading's flex layout would otherwise show it */
/* The lessons behind the curriculum and the weak practice tests, on the home: a row is a name and one link; the grade is a chip inside the link */
.behind-list li { border-top: 1px solid var(--line); padding: 8px 0; }
.behind-list li:first-child { border-top: 0; }
.behind-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.behind-row .grow { flex: 1 1 140px; min-width: 0; }
.behind-row .late { color: var(--sky-danger); font-weight: 600; white-space: nowrap; }
.button.with-chip { display: inline-flex; align-items: center; gap: 8px; padding-inline: 14px 8px; }
.grade-chip { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 9px; border-radius: 999px; font-weight: 800; font-size: 14px;
  background: color-mix(in srgb, var(--sky-gold) 24%, transparent); color: var(--sky-gold); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sky-gold) 55%, transparent); }
.grade-chip.none { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.weak-tests { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; }
.weak-tests > p { margin: 0 0 2px; }
/* The readiness number's info button and tooltip */
.rd-top { position: relative; }
.info-tip { display: inline-block; }                                                      /* the tooltip is placed against the row, so it spans the card and never leaves the screen */
.info-tip .info { min-height: 28px; min-width: 28px; width: 28px; height: 28px; padding: 0; border-radius: 50%; font-size: 15px; line-height: 1; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.info-tip .tip { position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 6px); display: grid; gap: 4px; padding: 10px 12px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--sky-accent); box-shadow: 0 6px 20px rgb(0 0 0 / .45); font-size: 13px; line-height: 1.45; font-weight: 400; text-align: start; }
.info-tip .tip[hidden] { display: none; }
@media (hover: hover) { .info-tip:hover .tip[hidden] { display: grid; } }                 /* a mouse hovering shows it too (not on a touch screen, where hover sticks) */
.info-tip .info:focus-visible + .tip[hidden] { display: grid; }                          /* so does keyboard focus */
/* The readiness parts: a row each, in plain Hebrew */
.rd-parts { display: grid; gap: 4px; margin: 8px 0 0; font-size: 14px; }
.rd-parts .rd-part { display: flex; align-items: baseline; gap: 10px; }
.rd-parts .grow { flex: 1; min-width: 0; }
.rd-parts .rd-val { min-width: 42px; text-align: end; color: var(--sky-gold); }

/* The developer's status card (developer.js). */
.st-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.st-top h2 { margin: 0; }
.st-head { display: flex; align-items: center; gap: 10px; margin-block: 12px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.st-dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 700; font-size: 14px; flex: none; }
.st-ok { color: var(--sky-aurora); } .st-warn { color: var(--sky-gold); } .st-error { color: var(--danger); } .st-off { color: var(--muted); }
.st-dot.st-ok, .st-head.st-ok .st-dot { background: color-mix(in srgb, var(--sky-aurora) 18%, transparent); }
.st-dot.st-warn, .st-head.st-warn .st-dot { background: color-mix(in srgb, var(--sky-gold) 18%, transparent); }
.st-dot.st-error, .st-head.st-error .st-dot { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.st-dot.st-off { background: color-mix(in srgb, var(--muted) 18%, transparent); }
.st-head.st-ok { border-color: var(--sky-aurora); } .st-head.st-warn { border-color: var(--sky-gold); } .st-head.st-error { border-color: var(--danger); }
.st-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin: 0 0 8px; }
.st-facts div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.st-facts dt { color: var(--muted); font-size: 13px; }
.st-facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.st-checks li > span:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.st-word { font-size: 13px; font-weight: 600; flex: none; }
.st-foot { margin: 8px 0 0; font-size: 13px; }

/* The developer's activity chart (developer.js): one column per day, a single series. */
.ac-range { display: inline-flex; gap: 4px; }
.ac-range button { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.ac-range button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.ac-tiles { margin-top: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.ac-plot { position: relative; height: 200px; margin: 16px 0 44px 28px; }
.ac-grid { position: absolute; inset: 0; pointer-events: none; }
.ac-tick { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.ac-tick span { position: absolute; left: -28px; width: 22px; text-align: right; transform: translateY(-50%); font-size: 12px; color: var(--muted); }
.ac-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), 1fr); list-style: none; margin: 0; padding: 0; }
.ac-col { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 100%; outline: none; cursor: default; }
.ac-col:hover, .ac-col:focus-visible { background: color-mix(in srgb, var(--text) 6%, transparent); border-radius: 6px; }
.ac-col:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.ac-bar { position: relative; width: min(24px, 70%); background: #6f8af0; border-radius: 4px 4px 0 0; min-height: 0; }
.ac-bar:not([style*="height:0%"]) { min-height: 2px; }
.ac-val { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 4px; font-size: 13px; color: var(--text); white-space: nowrap; }
.ac-x { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); padding-top: 6px; font-size: 12px; line-height: 1.3; color: var(--muted); text-align: center; white-space: nowrap; }
.ac-tip { display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 2; direction: rtl; text-align: right;
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.5; white-space: nowrap; }
.ac-col:hover .ac-tip, .ac-col:focus .ac-tip { display: block; }
.ac-col:first-child .ac-tip { left: 0; transform: none; }
.ac-col:last-child .ac-tip { left: auto; right: 0; transform: none; }
.ac-table summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.ac-table table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.ac-table th, .ac-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.ac-table th { color: var(--muted); font-weight: 600; }

/* The manager's subjects tab (subjects_tab.js). */
.sb-icons { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.sb-icon { position: relative; margin: 0; }
.sb-icon input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sb-icon > span[aria-hidden] { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; font-size: 20px; }
.sb-icon input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.sb-icon input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.sb-lessons li { gap: 6px; }
.sb-lessons li button { min-height: 36px; padding: 4px 10px; }
.sb-state { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); margin-inline-start: 6px; }
.sb-published { color: var(--sky-aurora); border-color: var(--sky-aurora); }
.sb-failed { color: var(--danger); border-color: var(--danger); }
.sb-drafting { color: var(--sky-gold); border-color: var(--sky-gold); }
.c-subjects { border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.c-subjects legend { font-weight: 600; padding: 0 4px; }
.c-subjects p { flex-basis: 100%; margin: 4px 0 0; font-size: 14px; }
.test-form .check[hidden] { display: none; }

/* The lesson editor (lesson_editor.js): the worksheet beside the draft on a wide screen, one above the other on a phone. */
.le-layout { display: grid; gap: 12px; }
@media (min-width: 900px) { .le-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
  .le-sheet { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; } }
.le-sheet { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; background: var(--surface); }
.le-sheet img { display: block; width: 100%; height: auto; border-radius: 6px; margin-bottom: 8px; background: #fff; }
.le-text { white-space: pre-wrap; font: inherit; margin: 0; }
.le-draft label { font-weight: 600; }
.le-question { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.le-question textarea { min-height: 60px; }
.le-choices { margin: 8px 0; }
.le-choice { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px 0; border: 0; }
.le-choice input.grow { flex: 1 1 160px; width: auto; }
.le-choice select { flex: 1 1 140px; width: auto; }
.le-choice button, .le-skill .hrow button, .le-question .hrow button { min-height: 36px; padding: 4px 10px; }
.le-right { display: inline-flex; gap: 4px; align-items: center; margin: 0; font-weight: 400; white-space: nowrap; }
.le-right input { width: auto; }
.le-source { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.le-ai { color: var(--sky-gold); border-color: var(--sky-gold); }
.le-preview { margin-top: 6px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 10px; font-size: 14px; }
.le-preview p { margin: 0 0 4px; }
.le-preview ul { margin: 0; padding-inline-start: 18px; }
.le-mistake { display: flex; flex-wrap: wrap; gap: 6px; }
.le-mistake input { flex: 1 1 140px; width: auto; }
.le-status { margin: 8px 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.st-facts dd.st-title { font-weight: 400; font-size: 14px; color: var(--muted); margin-top: 4px; }

/* ---------- home: one screen, like a game's level select (game-home-lesson-rounds) ---------- */
.quest { margin-block: 0 8px; }
body:has(#lesson-map) #to-subjects { display: inline-block; margin-block: -8px 0; font-size: 14px; }
body:has(#lesson-map) p:has(> #to-subjects) { margin-block: 0 4px; }
.quest-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 0 8px; }
.quest-stats span { font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.quest-stats .goal-chip.done { border-color: var(--sky-aurora); color: var(--sky-aurora); }
.play { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border-radius: 18px; text-decoration: none; color: var(--sky-on-accent);
  background: linear-gradient(135deg, var(--sky-gold), #ffb347); box-shadow: 0 5px 0 #c9852a, 0 8px 20px rgb(0 0 0 / .35); font-size: 17px; }
.play:active { transform: translateY(4px); box-shadow: 0 1px 0 #c9852a; }
.play:focus-visible { outline: 3px solid var(--sky-ink); outline-offset: 3px; }
.play small { display: block; font-size: 12.5px; font-weight: 600; opacity: .8; }
.play b { display: block; line-height: 1.2; }
.play .play-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--sky-on-accent); color: var(--sky-gold); flex: none; }
.play .lstars { letter-spacing: 1px; }
.all-perfect { margin: 0; padding: 14px; border-radius: 16px; text-align: center; font-weight: 700; background: color-mix(in srgb, var(--sky-gold) 20%, var(--surface)); }

.lesson-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 6px 2px; margin-block: 10px 6px; }
.lnode { display: flex; flex-direction: column; align-items: center; min-width: 0; text-decoration: none; color: var(--text); border-radius: 12px; padding-block: 2px; }
.lnode:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lnode .disc { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 17px; font-weight: 800;
  background: var(--sky-night); border: 2px solid var(--line); box-shadow: 0 3px 0 color-mix(in srgb, var(--sky-night) 60%, black); }
.lnode.s1 .disc, .lnode.s2 .disc { border-color: var(--sky-accent); background: color-mix(in srgb, var(--sky-accent) 22%, var(--sky-night)); }
.lnode.perfect .disc { border-color: var(--sky-gold); background: radial-gradient(circle at 35% 30%, #fff3c4, var(--sky-gold) 55%, #c9852a); box-shadow: 0 3px 0 #8a5a17, 0 0 14px color-mix(in srgb, var(--sky-gold) 50%, transparent); }
.lnode.next .disc { border-color: var(--sky-aurora); border-width: 3px; animation: sky-pulse 1.8s ease-out infinite; box-shadow: 0 0 0 4px color-mix(in srgb, var(--sky-aurora) 25%, transparent); }
.lnode .badge { position: absolute; top: -6px; inset-inline-end: -8px; font-style: normal; font-size: 12px; line-height: 1; padding: 2px; border-radius: 999px; background: var(--sky-bg); }
.lnode .badge.open { color: var(--sky-aurora); }
.lnode.behind .disc { border-color: var(--sky-danger); }
.lnode .lstars { margin-top: 3px; font-size: 12px; line-height: 1; letter-spacing: 1px; color: var(--line); }
.lnode.s1 .lstars, .lnode.s2 .lstars, .lnode.s3 .lstars { color: var(--sky-gold); }
.lnode .lname { max-width: 100%; margin-top: 2px; font-size: 10.5px; line-height: 1.2; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.strip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-block: 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.strip .strip-main { flex: 1; min-width: 0; display: flex; flex-direction: column; text-decoration: none; color: var(--text); }
.strip h2 { margin: 0; font-size: 15px; }
.strip .muted { font-size: 13px; }
.today-btn { flex: 0 1 auto; max-width: 58%; min-height: 44px; display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 14px;
  color: var(--accent-text); background: var(--accent); }
.today-btn small { font-weight: 600; opacity: .8; }
.hchips { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 4px; }
.hchips-ai { display: contents; }
.hchip { margin: 0; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; }
.hchip.required, .hchip.late { border-color: var(--sky-gold); }
.hchip.required b { color: var(--sky-gold); }

/* ---------- the lesson round's sheet ---------- */
.rd-skill { margin: 0 0 4px; font-size: 13px; }
.rd-result { text-align: center; }
.rd-bigstars { margin: 8px 0 0; font-size: 56px; line-height: 1; letter-spacing: 6px; color: var(--line); }
.rd-bigstars span { display: inline-block; }
.rd-bigstars span.on { color: var(--sky-gold); text-shadow: 0 0 18px color-mix(in srgb, var(--sky-gold) 60%, transparent);
  animation: rd-pop .5s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: calc(var(--i) * .25s); }
@keyframes rd-pop { from { transform: scale(0) rotate(-30deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.rd-title { margin: 8px 0 0; font-size: 22px; }
.rd-mastered { font-weight: 700; color: var(--sky-gold); }
.rd-almost { color: var(--sky-aurora); }
.rd-result .ex-missed { text-align: start; }

/* The developer's prompter card (prompter_card.js); the full-screen prompter brings its own styles (prompter.js). */
.pr-layout { display: grid; gap: 12px; }
@media (min-width: 900px) { .pr-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; } }
.pr-list li { padding: 0; }
.pr-pick { width: 100%; text-align: start; border: 0; background: none; padding: 10px 6px; min-height: 44px; }
.pr-list li[aria-current="true"] .pr-pick { background: color-mix(in srgb, var(--accent) 15%, transparent); border-radius: 8px; }
.pr-form textarea { min-height: 180px; }
.pr-actions { flex-wrap: wrap; }
.pr-help pre { background: color-mix(in srgb, currentColor 8%, transparent); padding: 8px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; }

/* The home's lessons by date (home.js board): the current lesson on its own, past and coming lessons folded under it. */
.lesson-groups { margin-block: 10px 6px; display: grid; gap: 8px; }
.lnow { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 14px; background: color-mix(in srgb, var(--sky-aurora) 10%, transparent); border: 1px solid color-mix(in srgb, var(--sky-aurora) 35%, transparent); }
.lnow-title { margin: 0; font-size: 15px; flex: none; }
.lnow-title .muted { display: block; font-size: 13px; font-weight: 400; }
.lnow .lnode { flex-direction: row; gap: 10px; flex: 1; justify-content: flex-start; }
.lnow .lnode .lname { font-weight: 700; font-size: 16px; color: var(--text); white-space: normal; margin: 0; }
.lnow .lnode .lstars { order: 3; margin-inline-start: auto; }
.lfold { border-radius: 12px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.lfold > summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; min-height: 44px; cursor: pointer; font-weight: 600; }
.lfold .lesson-board { margin: 0; padding: 0 8px 8px; }
.lfold-late { color: var(--sky-danger); font-size: 14px; }

/* ---------- the work on the board: the student's prompt and the teacher's check (board-work) ---------- */
.qz-need-work { border-color: var(--sky-gold); }
.work-list li { flex-wrap: wrap; }
.work-q .work-choices li { padding: 6px 8px; border-radius: 8px; }
.work-q .work-choices li.right { background: color-mix(in srgb, var(--ok, #15803d) 18%, transparent); }
.work-q .work-choices li.picked:not(.right) { background: color-mix(in srgb, var(--danger) 16%, transparent); }
.work-q .work-pic { display: block; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.work-points { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.work-points button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.work-points .work-now { margin-inline-start: auto; font-size: 18px; }
.qz-review { margin-block: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--sky-accent) 6%, var(--surface)); }
.qz-review h4 { margin: 0 0 6px; }
.qz-review-list li { display: block; padding: 8px 0; }
.qz-review-list li p { margin: 4px 0; }
.qz-review-list li.v-correct .tag { border-color: var(--ok, #15803d); }
.qz-review-list li.v-wrong .tag { border-color: var(--danger); }
.qz-review .spin, .rv-steps .spin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.work-ai { margin: 4px 0 8px; }
.work-ai-panel p { margin: 4px 0; }
.work-ai-panel button { margin-top: 6px; }

/* the steps of an AI review while it runs */
.rv-steps { margin: 6px 0; }
.rv-steps li { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.rv-steps li.rv-done { color: var(--muted); }
.rv-steps li.rv-now { font-weight: 600; }
.rv-steps .rv-ok { color: var(--ok, #15803d); }
.rv-time { margin: 2px 0 0; font-size: .9em; }
.rd-context { margin-bottom: 6px; }
.rd-context p { margin: 4px 0 0; }
.focus-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.rv-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 6px 0; }
.rv-bar i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.work-ai-run { font-size: .9em; padding: 4px 10px; }

/* ---------- readiness: the home's test block, the test's page, the gain on a result ---------- */
.test-strip { flex-direction: column; align-items: stretch; gap: 4px; padding: 6px 10px; margin-block: 4px; }
.test-strip .strip-main { flex-direction: row; align-items: center; gap: 10px; }
.test-strip .strip-main .grow { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.test-strip .strip-main small { font-size: 12px; }
.strip-more { font-size: 18px; color: var(--accent); }
.test-strip .readiness { margin: 0; }
.test-strip .rd-num { font-size: 30px; line-height: 1; min-width: 1.4em; text-align: center; }
.test-strip .rd-bar { height: 5px; margin: 3px 0 0; }
.rd-top { align-items: center; }
.rd-next { font-size: 13px; }
.rd-up { display: inline-block; margin-inline-start: 6px; padding: 0 6px; border-radius: 999px; background: var(--sky-gold); color: #111; font-weight: 800; font-size: 13px;
  animation: rd-pop .6s cubic-bezier(.2, 1.6, .4, 1) .9s both; }
.rd-bar { position: relative; }
.rd-bar i { transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.rd-bar s { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .35; text-decoration: none; }
.readiness.grew .rd-num { animation: rd-pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.rd-how-line { margin: 0; font-size: 13px; }
.test-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.test-btn { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 4px 6px; border-radius: 12px; text-decoration: none; white-space: nowrap; font-size: 14px;
  font-weight: 800; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.test-btn.sim { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.test-btn small { font-weight: 800; font-size: 12px; padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--sky-gold) 30%, transparent); }
.gain-hint { display: block; font-size: 12px; font-weight: 700; opacity: .85; }
.big-btn { min-height: 52px; min-width: 220px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; }
.rd-how summary { cursor: pointer; color: var(--accent); font-weight: 700; margin-top: 6px; }
.rd-how ul { margin: 6px 0 0; padding-inline-start: 20px; font-size: 14px; }
.modes { display: grid; gap: 8px; margin-block: 8px; }
.mode { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.mode.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.mode.off { opacity: .55; cursor: default; }
.mode input { margin-top: 4px; }
#focus-skills { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 6px; }
#focus-skills[hidden], #manual-skills[hidden] { display: none; }
#manual-skills { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin-block: 6px; }
.pick-lesson { margin: 8px 0 2px; font-weight: 700; }
.pick { display: flex; gap: 6px; align-items: center; min-height: 40px; }
.trail li a { display: flex; gap: 8px; align-items: center; padding: 8px 0; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.trail .grow { flex: 1; min-width: 0; }
.gain { min-width: 44px; text-align: center; font-weight: 800; color: var(--sky-gold); }
.gain.zero { color: var(--muted); font-weight: 600; }
.qz-ready { text-align: center; margin-block: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--sky-gold) 8%, var(--surface)); }
.qz-ready p { margin: 4px 0; }
.qz-gain { font-size: 48px; line-height: 1; font-weight: 900; color: var(--sky-gold); text-shadow: 0 0 18px color-mix(in srgb, var(--sky-gold) 60%, transparent);
  animation: rd-pop .7s cubic-bezier(.2, 1.6, .4, 1) .2s both; }
.qz-level { font-size: 18px; font-weight: 800; color: var(--sky-gold); animation: rd-pop .6s cubic-bezier(.2, 1.6, .4, 1) .9s both; }
.qz-more { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .rd-up, .qz-gain, .qz-level, .readiness.grew .rd-num { animation: none; } .rd-bar i { transition: none; } }
.quest-stats .hchips { display: contents; }
.quest-stats .hchip, .quest-stats .hchips-ai .hchip { min-height: 30px; padding: 3px 8px; font-size: 14px; font-weight: 700; border-radius: 999px; }
.quest-stats { gap: 4px; }
.quest-stats span { padding: 3px 8px; }
.quest-stats .hchips { padding: 0; border: 0; background: none; }
.mode > span { flex: 1; min-width: 0; }
.mode input { flex: none; width: 20px; height: 20px; }
