/* ===========================================================================
   student.css — the child's weighting of the system.

   Loaded by layouts/panel.blade.php ONLY when data-panel="student", after
   site.css and panel.css. Admin and franchise never see a byte of it.

   WHY THIS FILE EXISTS. Design standards §3 asks for "two themes from one
   system — Professional (public site, franchise, admin) and Student (brighter,
   rounder, more colour), same tokens, different weightings". §7 lets student
   gamified content use emoji for badges and celebration where the rest of the
   platform may not, §6 says "student screens large and playful", and §9 says
   "student screens may celebrate".

   panel.css delivered the first half of that — 15px rows, a larger radius,
   44px targets — and stopped there. The result was the admin surface in roomier
   clothes: grey hairline cards, 13px labels, a definition list where the score
   should be. Correct, accessible and no fun, which for a nine-year-old is the
   same as broken. This file is the rest of the weighting.

   WHAT IT DOES NOT DO, so the ban list (§7.1) still holds:
   - no gradient surfaces and no gradient blobs — every block here is ONE flat
     colour; the only gradients are a 34px bead rail, a stripe on a 20px bar and
     the 7px confetti squares
   - no glassmorphism, nothing translucent stacked on anything
   - shadow still means "this floats": the hero, the sticky HUD and the stamp
     have one, cards carry a flat bottom edge instead
   Colour comes from the logo artwork, not from a template palette: red
   #E8272D, amber #F7AE44, green #7FC141, sampled from the client's own JPEG.
   The logo's amber and green cannot carry white text, so each has a deepened
   ink twin for type — the same split panel.css already makes for yellow.
   ======================================================================== */

[data-panel="student"] {
  /* The logo's own three, as the student surface's accents. */
  --s-red:       #E8272D;
  --s-red-deep:  #C01D23;   /* the red that can carry white text — 5.6:1     */
  --s-amber:     #F7AE44;
  --s-amber-ink: #A05E00;   /* amber as TEXT on cream — 5.1:1                */
  --s-amber-pale:#FFF0D6;
  --s-green:     #7FC141;
  --s-green-ink: #3E7714;   /* green as TEXT on white — 5.2:1                */
  --s-green-pale:#EEF8E2;

  /* A warmer ground than the panel's clinical #F6F9FF. Paper, not software. */
  --ground:      #FFF9EF;
  --line:        #EFE2CC;   /* hairlines warm up with the ground             */
  --r-panel:     22px;      /* panel.css had 16px; a child's card is rounder */
  --row-y:       16px;
}

/* A card on this surface loses the drop shadow and gains a bottom edge, the
   way a printed card stacks. Flat, but not weightless. */
[data-panel="student"] .pcard {
  box-shadow: 0 2px 0 var(--line);
  border-color: var(--line);
}
[data-panel="student"] .pcard__head { padding: 15px 18px; }
[data-panel="student"] .pcard__head h3 { font-size: 17px; font-weight: 800; }
[data-panel="student"] .pcard__body { padding: 18px; }

/* Buttons a child hits with a thumb, not a mouse. The 2px drop on :active is
   the whole of why a flat button feels pressable. */
[data-panel="student"] .btn {
  min-height: 48px; border-radius: 14px; font-weight: 800; font-size: 15px;
  box-shadow: 0 3px 0 rgba(20, 38, 77, .18);
}
[data-panel="student"] .btn:active { transform: translateY(2px); box-shadow: none; }
[data-panel="student"] .btn--sm { min-height: 40px; font-size: 13.5px; }
/* The primary action on this surface is the logo red, DEEPENED. White on the
   logo's own #E8272D is 4.41:1 — under the 4.5 a 15px bold label needs, by a
   hair. #C01D23 is 5.6:1 and still unmistakably the brand's red. This is the
   same paint/write split site.css already makes for yellow; the logo red itself
   stays on the mascot, the plus signs and the card spines, where nothing is
   written on top of it. */
[data-panel="student"] .btn--red { background: var(--s-red-deep); color: #FFF; }
[data-panel="student"] .btn--red:hover { background: #A2151A; color: #FFF; }

/* ---------------------------------------------------------------------------
   1. THE MASCOT
   An abacus bead with a face, drawn in SVG (partials/student-mascot). It is on
   the hero, in every empty state and on the result screen, and its mood changes
   with what the screen is saying — the one thing on the portal that reacts.

   PROPOSAL, not final art: the client has commissioned no character. It is one
   SVG partial, so real illustration replaces it in a single file.
   ------------------------------------------------------------------------ */
.smasc { display: block; flex: 0 0 auto; }
.smasc__body { fill: var(--s-red); }
.smasc__ring { fill: none; stroke: #FFF; stroke-width: 3; opacity: .5; }
.smasc__eye  { fill: #14264D; }
.smasc__glint{ fill: #FFF; }
.smasc__mouth{ fill: none; stroke: #14264D; stroke-width: 3.4; stroke-linecap: round; }
.smasc__blush{ fill: #FFF; opacity: .28; }
.smasc--amber .smasc__body { fill: var(--s-amber); }
.smasc--green .smasc__body { fill: var(--s-green); }

/* A slow idle bob, so the character is alive without being a distraction. */
@media (prefers-reduced-motion: no-preference) {
  .smasc--bob { animation: sbob 3.4s ease-in-out infinite; }
  @keyframes sbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
}

/* ---------------------------------------------------------------------------
   2. THE HERO — who you are and what you have earned (S1)
   One navy block instead of four grey cards. Navy because it is the brand's
   ink and because the logo's red and amber only sing against something dark;
   on cream they are a warning and a highlighter.
   ------------------------------------------------------------------------ */
.shero {
  position: relative; overflow: hidden;
  background: var(--navy); color: var(--on-navy);
  border-radius: 26px; padding: 22px 24px;
  box-shadow: 0 4px 0 #0C1833;
}

/* The bead rail: flat discs across the top edge, the abacus the whole product
   is about. Pure decoration, so it is a repeating radial-gradient here rather
   than ten elements in the markup. */
.shero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 34px;
  background: radial-gradient(circle 7px at 17px 17px, #2C4478 99%, transparent 100%);
  background-size: 34px 34px;
  opacity: .85; pointer-events: none;
}

.shero__in {
  position: relative; display: flex; flex-wrap: wrap; align-items: center;
  gap: 18px 22px; padding-top: 14px;
}
.shero__who { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1 1 280px; }
.shero__hi { min-width: 0; }
.shero__hi h2 {
  margin: 0; color: #FFF;
  font: 800 clamp(22px, 3.2vw, 30px)/1.12 var(--display); letter-spacing: -.02em;
}
.shero__sub {
  margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  font: 500 13.5px/1.4 var(--text); color: var(--on-navy-3);
}

/* The level chip. Amber on navy, and the number is the loud part. */
.slvl {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 12px 4px 9px; border-radius: 999px;
  background: var(--s-amber); color: #4A2B00;
  font: 800 13px/1.3 var(--text);
}

/* ---------------------------------------------------------------------------
   3. THE EARNING BAR — points towards the next coin (S1)
   Not "XP to the next level": the centre moves a child up a level, not their
   points (SOW §4.2, F12), and S3 tells them so. This measures the one earning
   rule that is real and daily. A chunky bar, with the figure on the line above
   it rather than in a caption under it.
   ------------------------------------------------------------------------ */
.sxp { flex: 1 1 100%; }
.sxp__top {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  font: 700 13px/1.3 var(--text); color: var(--on-navy-3);
  margin-bottom: 8px;
}
.sxp__top b { color: #FFF; font-weight: 800; }
.sxp__top span { margin-left: auto; font-weight: 500; }
.sxp__track {
  display: block; position: relative; height: 20px; border-radius: 999px;
  background: #0C1833; overflow: hidden; border: 2px solid #2C4478;
}
.sxp__fill {
  display: block; height: 100%; border-radius: 999px;
  background: var(--s-green);
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.22) 0 8px, transparent 8px 17px);
  transition: width .6s cubic-bezier(.2, .8, .2, 1);
}

/* ---------------------------------------------------------------------------
   4. THE THREE COUNTERS — points, coins, streak
   Solid tiles on the navy, each one colour, the figure at 30px. The markup
   stays a <dl> because a label/value pair IS a definition list, and because a
   test checks the dashboard's coin balance is the one its own points mint.
   ------------------------------------------------------------------------ */
.scount { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; flex: 0 1 auto; min-width: 0; }
.scount > div {
  min-width: 108px; padding: 11px 14px 12px; border-radius: 16px;
  background: #1E3260; border: 2px solid #2C4478;
}

/* On a phone the three tiles are 26px wider than the hero, and a <dl> sized to
   its max-content will not wrap to fix that. So below the break it takes the
   whole row and the tiles go two-up, which also makes them bigger — the figures
   are the reward for coming back and a phone is where a child reads them. */
@media (max-width: 599px) {
  .scount { flex: 1 1 100%; }
  .scount > div { flex: 1 1 calc(50% - 5px); min-width: 0; }
}
.scount dt {
  font: 800 10.5px/1 var(--mark); letter-spacing: .1em; text-transform: uppercase;
  color: var(--on-navy-4);
}
.scount dd {
  margin: 7px 0 0; display: flex; align-items: center; gap: 7px;
  font: 800 clamp(24px, 2.6vw, 30px)/1 var(--display); color: #FFF;
  font-variant-numeric: tabular-nums;
}
.scount--coins { background: #4A3410; border-color: var(--s-amber); }
.scount--coins dd { color: var(--s-amber); }
.scount--streak { background: #4A1214; border-color: var(--s-red); }
.scount--streak dd { color: #FF8A8E; }

/* The streak as lit pips, one per day of the week, so a child can see the gap
   they are about to make in it. */
.spips { display: flex; gap: 4px; margin-top: 9px; }
.spips i {
  width: 12px; height: 12px; border-radius: 4px; display: block;
  background: #2C4478;
}
.spips i.is-on { background: var(--s-red); }
.spips i.is-today { background: var(--s-amber); }

/* ---------------------------------------------------------------------------
   5. QUEST CARDS — what to do today (S1)
   A row is a list item; a quest is a thing you take on. So these are cards
   with a coloured spine, a reward badge and one button, not table rows with a
   chevron on the end.
   ------------------------------------------------------------------------ */
.squests { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(252px, 1fr)); }
.squest {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 16px 16px 16px 21px; border-radius: 18px;
  background: #FFF; border: 2px solid var(--line);
  text-decoration: none; color: inherit;
  transition: transform .14s ease-out, box-shadow .14s ease-out;
}
.squest::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 6px;
  border-radius: 0 6px 6px 0; background: var(--s-amber);
}
a.squest:hover { transform: translateY(-3px); box-shadow: 0 6px 0 var(--line); }
a.squest:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.squest__top { display: flex; align-items: flex-start; gap: 11px; }
.squest__ico {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--s-amber-pale); color: var(--s-amber-ink);
}
.squest b { display: block; font: 800 16px/1.25 var(--display); color: var(--navy); }
.squest small { display: block; margin-top: 4px; font: 400 13px/1.45 var(--text); color: var(--muted); }
.squest__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: auto; }

/* The reward, as a coin badge rather than a status chip. */
.sprize {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px 5px 8px; border-radius: 999px;
  background: var(--s-amber); color: #4A2B00;
  font: 800 13px/1.3 var(--text);
}
.sprize--got { background: var(--s-green); color: #1C3606; }

/* Done. Green, ticked, and it stays on the board — a finished quest that
   vanishes takes the sense of progress with it. */
.squest--done { background: var(--s-green-pale); border-color: #C7E5A8; }
.squest--done::before { background: var(--s-green); }
.squest--done .squest__ico { background: var(--s-green); color: #1C3606; }

/* Locked behind a package. Dashed, because dashed reads "not yet" where flat
   grey reads "broken". */
.squest--locked { background: var(--ground); border-style: dashed; border-color: #DCCBB0; }
.squest--locked::before { background: var(--muted); }
.squest--locked .squest__ico { background: #EFE2CC; color: var(--muted); }

/* ---------------------------------------------------------------------------
   6. THE BADGE SHELF
   Stickers, not icons. §7 allows emoji in here and nowhere else on the
   platform, and an emoji inside a coloured medallion reads as sticker art
   rather than as interface — which is the distinction that rule is drawing.
   ------------------------------------------------------------------------ */
.sbadges {
  display: grid; gap: 20px 12px;
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  text-align: center;
}
.sbadge { display: grid; gap: 7px; justify-items: center; align-content: start; }
.sbadge__disc {
  position: relative;
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center; font-size: 27px; line-height: 1;
  background: var(--s-amber); border: 3px solid #FFF;
  box-shadow: 0 0 0 2px var(--s-amber-ink);
  transform: rotate(-4deg);
}
.sbadge:nth-child(even) .sbadge__disc { transform: rotate(5deg); }
.sbadge b { font: 800 12.5px/1.3 var(--text); color: var(--navy); }
.sbadge small { font: 400 11.5px/1.35 var(--text); color: var(--muted); }

/* The sticker sits in its own span so a locked badge can fade the art without
   fading the padlock on top of it. */
.sbadge__art { display: block; }

/* Locked. The colour and the sticker STAY — greyed out, a child cannot see what
   they are working towards, which is the whole point of showing it. The padlock
   is the shape that carries the state, so colour is never doing it alone. */
.sbadge--off .sbadge__disc {
  background: #DCE5F5; box-shadow: 0 0 0 2px #B6C6E4; transform: rotate(0);
}
.sbadge--off .sbadge__art { opacity: .5; filter: grayscale(.55); }
.sbadge--off b { color: var(--muted); }

.sbadge__lock {
  position: absolute; right: -5px; bottom: -3px;
  width: 23px; height: 23px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--navy); color: #FFF; border: 2px solid #FFF;
}

/* What the badge pays, on a corner flag — the idea is LogiQids', which prints
   the gem value on every locked achievement so a badge is a priced quest rather
   than a surprise. Ours appears only where the Rewards Master has a rule. */
.sbadge__pays {
  position: absolute; right: -10px; top: -6px;
  padding: 2px 7px; border-radius: 999px;
  background: var(--s-amber); color: #4A2B00; border: 2px solid #FFF;
  font: 800 10.5px/1.5 var(--text); white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   7. SECTION TILES — picking what to practise (S3)
   panel.css draws these as small bordered boxes. Here each one is a card with
   its own colour, its sheet count as the largest thing on it, and a Start
   button that looks pressable.
   ------------------------------------------------------------------------ */
[data-panel="student"] .ssecs {
  display: grid; gap: 13px;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
}
[data-panel="student"] .ssec {
  position: relative; display: flex; flex-direction: column; gap: 9px;
  padding: 15px; border-radius: 18px;
  background: #FFF; border: 2px solid var(--line);
  text-decoration: none; color: inherit;
  transition: transform .14s ease-out, box-shadow .14s ease-out;
}
[data-panel="student"] a.ssec:hover { transform: translateY(-3px); box-shadow: 0 6px 0 var(--line); }
[data-panel="student"] a.ssec:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

[data-panel="student"] .ssec__top { display: flex; align-items: center; gap: 9px; }
/* Solid, not tinted. A pale chip behind a 20px glyph is invisible at tile size
   — the first pass used --blue-chip and its three pale cousins, and on a white
   card at 36px all four read as white. A child navigates eleven sections by
   colour before they navigate them by reading, so the disc has to carry one. */
[data-panel="student"] .ssec__ico {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--blue); color: #FFF;
}
[data-panel="student"] .ssec__name { font: 800 15px/1.2 var(--display); color: var(--navy); }

/* The count is the decision, so it is 30px rather than 13px in a caption. */
[data-panel="student"] .ssec__n {
  display: flex; align-items: baseline; gap: 6px;
  font: 400 12.5px/1.3 var(--text); color: var(--muted);
}
[data-panel="student"] .ssec__n b {
  font: 800 30px/1 var(--display); color: var(--navy); font-variant-numeric: tabular-nums;
}
[data-panel="student"] .ssec__foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto;
}
[data-panel="student"] .ssec__go {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 13px; border-radius: 11px;
  background: var(--blue); color: #FFF; font: 800 13px/1 var(--text);
  box-shadow: 0 2px 0 var(--blue-deep);
}

/* Four colour families, rotated across the tiles so eleven sections do not read
   as one grey wall. Set with data-hue in the markup. The logo's amber and green
   cannot carry white text, so those two take a dark ink instead. */

/* panel.css sets `.ssec__top .ico { color: var(--accent-ink) }` — on the SVG
   ITSELF, not on its parent. A colour applied directly always beats one that
   would be inherited, so without this line the glyph stays blue whatever the
   disc is, and on the blue disc it disappears altogether. */
[data-panel="student"] .ssec__ico .ico { color: inherit; }
[data-panel="student"] .ssec[data-hue="amber"] .ssec__ico { background: var(--s-amber); color: #4A2B00; }
[data-panel="student"] .ssec[data-hue="green"] .ssec__ico { background: var(--s-green); color: #1C3606; }
[data-panel="student"] .ssec[data-hue="red"]   .ssec__ico { background: var(--s-red);   color: #FFF; }

[data-panel="student"] .ssec--locked {
  background: var(--ground); border-style: dashed; border-color: #DCCBB0;
}
[data-panel="student"] .ssec--locked .ssec__ico { background: #EFE2CC; color: var(--muted); }
[data-panel="student"] .ssec--locked .ssec__n b { color: var(--muted); }

/* The mode picker gets the same pressable treatment as a button — three big
   pills a thumb can hit, not three radio dots. */
[data-panel="student"] .ppick--mode label {
  min-height: 48px; border-radius: 14px; border-width: 2px;
  font-weight: 800; font-size: 14.5px;
}
[data-panel="student"] .ppick--mode label.is-on {
  background: var(--navy); border-color: var(--navy); color: #FFF;
}

/* ---------------------------------------------------------------------------
   8. SOLVING THE SHEET (S4)
   The screen this whole redesign is for. What changes:
   - the HUD is one solid navy bar that sticks, with the clock as the loud thing
   - progress is BEADS, one per question, filling as answers are typed
   - a question is a big card with a 56px input, not a row in a table
   - a card that has an answer in it turns green at the edge — not marked, just
     "you did this one", which is the feedback a paper sheet cannot give
   Marking still happens on submit, server side. Nothing here tells a child
   whether they are right; that would make the clock meaningless.
   ------------------------------------------------------------------------ */
[data-panel="student"] .sbar {
  background: var(--navy); border: none; border-radius: 18px;
  padding: 14px 18px; gap: 14px 20px;
  box-shadow: 0 4px 0 #0C1833;
}
[data-panel="student"] .sbar__what { color: #FFF; font: 800 15px/1.3 var(--display); }
[data-panel="student"] .sbar__what span { color: var(--on-navy-3); font: 500 12.5px/1.4 var(--text); }
[data-panel="student"] .sprog__n { color: var(--on-navy-3); }
[data-panel="student"] .sprog__n b { color: #FFF; }

/* The clock. Big, tabular, and in the last minute it turns red and nudges
   twice — panel.js already adds .is-warn; this gives it a body. */
[data-panel="student"] .stimer {
  padding: 7px 14px 7px 11px; border-radius: 14px;
  background: #1E3260; border: 2px solid #2C4478; color: var(--on-navy-3);
}
[data-panel="student"] .stimer b {
  font: 800 clamp(22px, 2.4vw, 27px)/1 var(--display); color: #FFF;
  font-variant-numeric: tabular-nums;
}
[data-panel="student"] .stimer.is-warn { background: #4A1214; border-color: var(--s-red); color: #FFC7C9; }
[data-panel="student"] .stimer.is-warn b { color: #FF8A8E; }
@media (prefers-reduced-motion: no-preference) {
  [data-panel="student"] .stimer.is-warn { animation: snudge .5s ease-in-out 2; }
  @keyframes snudge {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
  }
}

/* The bead rail: one bead per question, filling left to right. */
.sbeads { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.sbeads i {
  width: 11px; height: 11px; border-radius: 50%; display: block;
  background: #0C1833; border: 1.5px solid #3D5A94;
  transition: background .2s ease-out, border-color .2s ease-out;
}
.sbeads i.is-on { background: var(--s-green); border-color: var(--s-green); }

/* A short line that changes as the sheet fills. Encouragement, not a score. */
.scheer {
  margin: 0; padding: 12px 16px; border-radius: 14px;
  background: var(--s-amber-pale); border: 2px solid #F3D9A6;
  font: 700 14px/1.45 var(--text); color: var(--s-amber-ink);
  display: flex; align-items: center; gap: 11px;
}

[data-panel="student"] .sqs {
  display: grid; gap: 13px;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
}
[data-panel="student"] .sq {
  padding: 14px 14px 16px; border-radius: 18px;
  background: #FFF; border: 2px solid var(--line);
  box-shadow: 0 2px 0 var(--line);
  transition: border-color .18s ease-out, box-shadow .18s ease-out;
}
[data-panel="student"] .sq__n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 24px; padding: 0 8px; border-radius: 8px;
  background: var(--blue-chip); color: var(--blue-deep);
  font: 800 12.5px/1 var(--mark); letter-spacing: .04em;
}

/* The column of terms. Bigger than panel.css set it: this is what the child is
   reading off their abacus, and it was 15px. */
[data-panel="student"] .sq__col {
  display: grid; grid-template-columns: 18px 1fr; gap: 3px 4px;
  margin: 12px 0 0; font-variant-numeric: tabular-nums;
}
[data-panel="student"] .sq__col b {
  font: 700 17px/1.3 var(--display); color: var(--s-red); text-align: center;
}
[data-panel="student"] .sq__col i {
  font: 800 21px/1.3 var(--display); color: var(--navy); font-style: normal; text-align: right;
}
[data-panel="student"] .sq__rule {
  margin: 9px 0 11px; border: none; border-top: 3px solid var(--navy); border-radius: 2px;
}

/* 56px tall, 22px type, centred. A nine-year-old types this with a thumb. */
[data-panel="student"] .sq .input {
  height: 56px; border-radius: 14px; border-width: 2px;
  text-align: center; font: 800 22px/1 var(--display); color: var(--navy);
  font-variant-numeric: tabular-nums; background: var(--ground);
}
[data-panel="student"] .sq .input:focus {
  background: #FFF; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-tint);
}

/* Answered. The card edge goes green — "kept", not "right". */
[data-panel="student"] .sq.is-filled { border-color: var(--s-green); box-shadow: 0 2px 0 #C7E5A8; }
[data-panel="student"] .sq.is-filled .sq__n { background: var(--s-green); color: #14260A; }
[data-panel="student"] .sq.is-filled .input { background: var(--s-green-pale); }

/* The submit bar sticks to the bottom on a phone, because twenty cards is a
   long scroll and the button must not be at the end of it. */
[data-panel="student"] .ssubmit {
  border-radius: 18px; border: 2px solid var(--line); background: #FFF;
  padding: 14px 16px; gap: 12px;
}
@media (max-width: 719px) {
  [data-panel="student"] .ssubmit {
    /* 56px is .pbottom min-height (panel.css §27) plus an 8px gap, so the
       submit bar sits just clear of the mobile nav rather than on it. */
    position: sticky; bottom: calc(56px + 8px + env(safe-area-inset-bottom)); z-index: 20;
    box-shadow: 0 -4px 18px rgba(20, 38, 77, .13);
  }
  [data-panel="student"] .ssubmit .btn { flex: 1 1 auto; }
  [data-panel="student"] .ssubmit__note { flex: 1 1 100%; order: -1; }
}

/* ---------------------------------------------------------------------------
   9. THE RESULT (S5)
   The one screen standards §9 says may celebrate. So it does: the ring sweeps
   from zero, the score lands as a stamp, and a good sheet throws confetti.
   A hard sheet gets a DIFFERENT celebration rather than a lesser one — amber
   ring, the mascot thinking rather than cheering, nothing called a failure.
   ------------------------------------------------------------------------ */
[data-panel="student"] .sresult {
  position: relative; overflow: hidden;
  background: var(--navy); color: var(--on-navy);
  border: none; border-radius: 26px; box-shadow: 0 4px 0 #0C1833;
  padding: 24px; gap: 24px;
}
[data-panel="student"] .sresult h2 { color: #FFF; font-size: clamp(23px, 3.2vw, 31px); }
[data-panel="student"] .sresult > div > p { color: var(--on-navy-3); }
[data-panel="student"] .sresult .pfacts dt { color: var(--on-navy-4); }
[data-panel="student"] .sresult .pfacts dd { color: #FFF; font-weight: 800; }
[data-panel="student"] .sresult .pfacts > div { border-color: #2C4478; }

[data-panel="student"] .sring__track { stroke: #0C1833; }
[data-panel="student"] .sring__arc { stroke: var(--s-green); stroke-linecap: round; }
[data-panel="student"] .sring--low .sring__arc { stroke: var(--s-amber); }
[data-panel="student"] .sring__mid b { color: #FFF; font-size: 34px; font-weight: 800; }
[data-panel="student"] .sring__mid span { color: var(--on-navy-4); }

/* The sweep. --sweep-from is set on the element in the markup, so the arc runs
   from empty to its real offset without the number living in two places. */
@media (prefers-reduced-motion: no-preference) {
  [data-panel="student"] .sring__arc { animation: ssweep 1.1s cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes ssweep { from { stroke-dashoffset: var(--sweep-from); } }
}

/* The score, stamped. Rotated a degree and a half, because a stamp is never
   straight and that is the whole of why it reads as one. */
.sstamp {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 16px; border-radius: 13px;
  background: var(--s-green); color: #14260A;
  font: 800 15px/1.3 var(--display);
  transform: rotate(-1.5deg);
  box-shadow: 0 3px 0 #4E8A1C;
}
.sstamp--low { background: var(--s-amber); color: #4A2B00; box-shadow: 0 3px 0 #C07F1A; }

/* Confetti — 7px squares that fall once. It is decoration on a celebration and
   the only motion on the page not tied to a value, so it is the first thing
   reduced-motion drops. */
.sconf { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sconf i {
  position: absolute; top: -14px; width: 7px; height: 7px; border-radius: 2px;
  display: block; opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .sconf i { animation: sfall 2.4s cubic-bezier(.3, .6, .4, 1) both; }
  @keyframes sfall {
    0%   { opacity: 0; transform: translateY(0) rotate(0); }
    12%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(340px) rotate(520deg); }
  }
}

/* Marked answers. panel.css draws these as tinted rows; here right and wrong
   are a tick disc and a cross disc, so shape carries the meaning as well as
   colour (§3: never colour alone). */
[data-panel="student"] .sans { border-radius: 14px; border-width: 2px; padding: 12px 14px; }
[data-panel="student"] .sans--ok { background: var(--s-green-pale); border-color: #C7E5A8; }
[data-panel="student"] .sans--no { background: #FFF2F2; border-color: #F4C3C5; }
[data-panel="student"] .sans__n {
  min-width: 34px; height: 24px; border-radius: 8px;
  display: inline-grid; place-items: center;
  font: 800 12.5px/1 var(--mark); letter-spacing: .04em;
}
[data-panel="student"] .sans--ok .sans__n { background: var(--s-green); color: #14260A; }
[data-panel="student"] .sans--no .sans__n { background: #B4181D;      color: #FFF; }
[data-panel="student"] .sans__sum { font: 700 15px/1.4 var(--display); color: var(--navy); }
[data-panel="student"] .sans__val { font: 800 17px/1.2 var(--display); }
[data-panel="student"] .sans--ok .sans__val { color: var(--s-green-ink); }
[data-panel="student"] .sans--no .sans__val { color: #B4181D; }

/* ---------------------------------------------------------------------------
   10. Shared odds
   ------------------------------------------------------------------------ */

/* A hand-written line over a band of cards. One script face, at most once per
   screen — §4 allows the site's Caveat as an accent, and this is that accent
   indoors. */
.swrit {
  margin: 0 0 5px; font: 700 clamp(19px, 2.4vw, 23px)/1.2 var(--script, cursive);
  color: var(--s-red);
}

/* An empty state on this surface gets the mascot instead of a line icon. */
[data-panel="student"] .pempty__ico { display: none; }
[data-panel="student"] .pempty h3 { font-size: 20px; }
[data-panel="student"] .pempty .smasc { margin: 0 auto 14px; }

/* The mobile bottom nav, warmed to match the ground. */
[data-panel="student"] .pbottom { border-top-color: var(--line); }

/* The design-preview banner sits over a cream page now, so its own tint has to
   stop being the same cream. */
[data-panel="student"] .pdemo { background: var(--blue-tint); border-color: #C3DCF6; }

/* ---------------------------------------------------------------------------
   11. THE BOARD AS A PRICE LIST (S8)
   A board that only ranks is a scoreboard. Naming what each place pays turns it
   into something a child at rank eleven can still read a reason out of — the
   idea is LogiQids', the figures and the currency are ours (see the note in
   config/preview.php on why the prize is coins and never points).
   ------------------------------------------------------------------------ */

/* The prize table. One row per band, the medal on the left and the coins on the
   right, so it reads as a list of prices rather than a paragraph of rules. */
.sprizes { display: grid; gap: 8px; }
.sprizes__row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 14px;
  background: var(--ground); border: 2px solid var(--line);
}
.sprizes__row:first-child { background: var(--s-amber-pale); border-color: #F3D9A6; }
.sprizes__place { display: flex; align-items: center; gap: 11px; min-width: 0; }
.sprizes__place b { font: 800 15px/1.3 var(--display); color: var(--navy); }
.sprizes__medal {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; font-size: 19px; line-height: 1;
  background: #FFF; border: 2px solid var(--line);
}
.sprizes__medal--plain {
  font: 800 14px/1 var(--display); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.sprizes__row .sprize { margin-left: auto; }

/* ---------------------------------------------------------------------------
   12. THE MASTERY LADDER on a section tile (S3)
   LogiQids' topics screen puts a five-step ladder under every skill and it is
   the best idea on that screen: a section stops being a bucket of sheets and
   becomes something you climb. Ours is named rather than numbered — see the
   note in config/preview.php on why a second "Level" could not go here.
   ------------------------------------------------------------------------ */
.smast { display: grid; gap: 5px; }
.smast__top {
  display: flex; align-items: baseline; gap: 8px;
  font: 400 11.5px/1.3 var(--text); color: var(--muted);
}
.smast__top b { font: 800 12.5px/1.3 var(--text); color: var(--s-green-ink); }
.smast__top span { margin-left: auto; font-variant-numeric: tabular-nums; }

.smast__track {
  display: block; height: 8px; border-radius: 999px;
  background: var(--ground); border: 1px solid var(--line); overflow: hidden;
}
.smast__fill {
  display: block; height: 100%; border-radius: 999px;
  background: var(--s-green);
  /* The same stripe as the hero bar, at half the pitch, so the two read as the
     same kind of thing at two sizes. */
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.3) 0 4px, transparent 4px 9px);
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}

/* One pip per step, under the bar. LogiQids labels theirs LV1…LV5; ours are
   unlabelled because the names are long and the chip above already says which
   step you are on — the pips are there to show how many there are. */
.smast__pips { display: flex; justify-content: space-between; }
.smast__pips i {
  width: 7px; height: 7px; border-radius: 50%; display: block;
  background: var(--line);
}
.smast__pips i.is-on { background: var(--s-green); }

/* The tile grows a little to hold the ladder, so the grid needs the room. */
[data-panel="student"] .ssecs {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

/* ---------------------------------------------------------------------------
   13. PRACTICE MODE — the focus screen (S4b)
   Solving is the one thing in this portal that is a SESSION rather than a page,
   so it gets the whole screen: no sidebar, no topbar, no bottom nav, one way
   out and it asks first. The idea is LogiQids', which takes the browser full
   screen for a thinksheet; the palette and the arithmetic are ours.
   ------------------------------------------------------------------------ */
body.sfocus {
  min-height: 100dvh; margin: 0;
  background: var(--navy);
  /* A field of beads rather than a field of stars — the same decoration as the
     hero on S1, at the size of a whole screen. Two flat dot layers, no
     gradient surface: the ban list is about gradient BACKGROUNDS and blobs. */
  background-image:
    radial-gradient(circle 2px at 20px 20px, #22355F 99%, transparent 100%),
    radial-gradient(circle 1.5px at 60px 70px, #1E2F55 99%, transparent 100%);
  background-size: 110px 110px, 150px 150px;
}
@supports not (min-height: 100dvh) { body.sfocus { min-height: 100vh; } }

body.sfocus .pdemo { margin: 0; border-radius: 0; }

.sfx {
  max-width: 880px; margin: 0 auto; padding: 18px 16px 28px;
  display: grid; gap: 16px;
}

/* --- the HUD ------------------------------------------------------------ */
/* The way out stands BESIDE the bar rather than on it. Inside the card it read
   as a piece of the sheet's own furniture and crowded the title; out here it is
   plainly the way back, and it costs the screen no height because it sits in
   the row the bar was already taking. Client, 5 October 2026. */
.sfx__top { display: flex; align-items: center; gap: 12px; }
.sfx__top > .sfx__hud { flex: 1 1 auto; min-width: 0; }

.sfx__hud {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 12px 14px; border-radius: 18px;
  background: #1E3260; border: 2px solid #2C4478;
}
.sfx__mark { display: grid; line-height: 1.1; }
.sfx__mark b { font: 800 14px/1.2 var(--display); color: #FFF; }
.sfx__mark span {
  font: 700 9.5px/1.2 var(--mark); letter-spacing: .12em; text-transform: uppercase;
  color: var(--on-navy-4);
}

/* One segment per question. Green when it was right, red when it was not —
   this bar is the session's marking history, which the bar on S4 cannot be
   because nothing is marked there until the end. */
.sfx__segs { flex: 1 1 200px; display: flex; gap: 3px; min-width: 120px; }
.sfx__segs i {
  flex: 1 1 auto; height: 8px; border-radius: 3px; display: block;
  background: #0C1833;
  transition: background .25s ease-out;
}
.sfx__segs i.is-right { background: var(--s-green); }
.sfx__segs i.is-wrong { background: var(--s-red); }

.sfx__combo, .sfx__xp, .sfx__clock {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  padding: 6px 12px; border-radius: 999px;
  background: #0C1833; border: 2px solid #2C4478;
  color: var(--on-navy-3); font: 700 13px/1 var(--text);
}
.sfx__clock { color: var(--on-navy-4); }
.sfx__xp b, .sfx__clock b {
  font: 800 16px/1 var(--display); color: #FFF; font-variant-numeric: tabular-nums;
}
.sfx__xp span {
  font: 800 10px/1 var(--mark); letter-spacing: .1em; text-transform: uppercase;
  color: var(--on-navy-4);
}

/* The run, and what it is multiplying by. Cold until it is worth something. */
.sfx__combo b { font: 800 16px/1 var(--display); color: #FFF; }
.sfx__combo span { font: 800 13px/1 var(--display); color: var(--on-navy-4); }
.sfx__combo.is-hot {
  background: #4A1214; border-color: var(--s-red); color: #FF8A8E;
}
.sfx__combo.is-hot span { color: var(--s-amber); }
@media (prefers-reduced-motion: no-preference) {
  .sfx__combo.is-hot { animation: sflare .45s ease-out; }
  @keyframes sflare { from { transform: scale(1.18); } to { transform: scale(1); } }
}

.sfx__x {
  margin-left: auto; flex: 0 0 auto;
  background: #0C1833; border-color: #2C4478; color: var(--on-navy-3);
}
.sfx__x:hover { color: #FFF; background: #0C1833; }

/* --- one question ------------------------------------------------------- */
.sfx__stage { display: grid; }
.sfq { display: grid; gap: 14px; }

/* The question column: the sum, and under it the box that says what the answer
   was. Those two belong together, and keeping them in one wrapper is what lets
   the row beside them hold only the options and the verdict. align-content:start
   so the question keeps its own height instead of stretching to match whatever
   the other column grew to. */
.sfq__main { display: grid; gap: 14px; align-content: start; }

/* One column, and then the wrapper must not reorder anything: display:contents
   drops it out of the box tree so the four blocks are siblings again and read in
   the order a phone needs — question, options, verdict, then the working. */
@media (max-width: 899px) {
  .sfq__main { display: contents; }
  .sfq__ask  { order: 1; }
  .sfq__side { order: 2; }
  .ssol      { order: 3; }
}

.sfq__ask {
  background: #FFF; border: 3px solid var(--line); border-radius: 24px;
  padding: 22px 22px 24px; text-align: center;
  box-shadow: 0 4px 0 rgba(12, 24, 51, .35);
  transition: border-color .2s ease-out;
}
.sfq.is-right .sfq__ask { border-color: var(--s-green); }
.sfq.is-wrong .sfq__ask { border-color: var(--s-red); }

.sfq__n {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 5px 13px; border-radius: 999px;
  background: var(--blue-chip); color: var(--blue-deep);
  font: 800 15px/1 var(--display); font-variant-numeric: tabular-nums;
}
.sfq__n span { font: 700 11px/1 var(--text); }
.sfq__what {
  margin: 9px 0 0;
  font: 700 11px/1.3 var(--mark); letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}

/* The column, at the size it is worth reading. This is the whole question. */
.sfq__col {
  display: grid; grid-template-columns: 26px auto; gap: 4px 8px;
  justify-content: center; margin: 18px 0 0;
  font-variant-numeric: tabular-nums;
}
.sfq__col b {
  font: 700 clamp(22px, 4vw, 30px)/1.25 var(--display); color: var(--s-red); text-align: center;
}
.sfq__col i {
  font: 800 clamp(28px, 5vw, 40px)/1.25 var(--display); color: var(--navy);
  font-style: normal; text-align: right; min-width: 2.4ch;
}
.sfq__rule {
  width: min(190px, 60%); margin: 12px auto 16px;
  border: none; border-top: 4px solid var(--navy); border-radius: 2px;
}

.sfq__in { display: block; max-width: 220px; margin: 0 auto; }
.sfq__in .input {
  height: 72px; border-radius: 18px; border-width: 3px; text-align: center;
  font: 800 clamp(28px, 5vw, 38px)/1 var(--display); color: var(--navy);
  font-variant-numeric: tabular-nums; background: var(--ground);
}
.sfq__in .input:focus {
  background: #FFF; border-color: var(--blue); box-shadow: 0 0 0 5px var(--blue-tint);
}
.sfq.is-right .sfq__in .input { background: var(--s-green-pale); border-color: var(--s-green); }
.sfq.is-wrong .sfq__in .input { background: #FFF2F2; border-color: var(--s-red); }

/* --- the verdict and the working ---------------------------------------- */
.sfq__said {
  background: #FFF; border: 2px solid var(--line); border-radius: 20px;
  padding: 16px 18px 18px;
}
.sfq__verdict {
  margin: 0 0 14px; padding: 11px 15px; border-radius: 14px;
  font: 800 15px/1.35 var(--display);
}
.sfq__verdict.is-right { background: var(--s-green-pale); border: 2px solid #C7E5A8; color: var(--s-green-ink); }
.sfq__verdict.is-wrong { background: #FFF2F2; border: 2px solid #F4C3C5; color: #B4181D; }

.sfq__how-h {
  margin: 0 0 10px; display: flex; align-items: center; gap: 7px;
  font: 800 13px/1.3 var(--display); color: var(--navy);
}

/* The column walked one term at a time. What a child needs when they got it
   wrong is not "the answer was 110" — it is where their own column went
   astray, and a running total is the only thing that shows that. */
.sfq__run { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.sfq__run li {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 12px; border-radius: 11px; background: var(--ground);
  font: 400 13.5px/1.4 var(--text); color: var(--muted);
}
.sfq__run li b { color: var(--navy); font-weight: 800; font-variant-numeric: tabular-nums; }
.sfq__run li > b:last-child { margin-left: auto; font-size: 16px; }
.sfq__ans {
  margin: 11px 0 0; padding-top: 11px; border-top: 2px dashed var(--line);
  font: 700 14px/1.4 var(--text); color: var(--muted);
}
.sfq__ans b { font: 800 20px/1 var(--display); color: var(--s-green-ink); }

/* Stuck? One tap to the support flow, carrying the question with it. */
.sfq__doubt {
  margin-top: 14px; display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 999px;
  border: 2px dashed var(--line); background: var(--ground);
  font: 800 13px/1 var(--text); color: var(--blue-deep); text-decoration: none;
}
.sfq__doubt:hover { border-style: solid; border-color: var(--blue); color: var(--blue-deep); }

/* --- the buttons -------------------------------------------------------- */
.sfx__act {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 18px;
  background: #1E3260; border: 2px solid #2C4478;
}
.sfx__hint {
  margin: 0; flex: 1 1 200px; min-width: 0;
  font: 500 13px/1.45 var(--text); color: var(--on-navy-3);
}
/* Dead until there is an answer in the box. The client asked for this twice,
   and it is right HERE and wrong on S4 — see the note in the Blade file. */
.sfx__act .btn[disabled] {
  opacity: .45; cursor: not-allowed; box-shadow: none; transform: none;
}

.sfx__notes { max-width: 880px; margin: 0 auto 32px; padding: 0 16px; }

@media (max-width: 599px) {
  .sfx__hud { gap: 8px 10px; }
  .sfx__mark { flex: 1 1 100%; }
  .sfx__segs { flex: 1 1 100%; order: 5; }
  .sfx__act .btn { flex: 1 1 auto; }
  .sfx__hint { flex: 1 1 100%; order: -1; }
}

/* ---------------------------------------------------------------------------
   14. THE JOURNEY (S3)
   LogiQids frames its worksheet section as a voyage — a rocket creeping along a
   dotted line towards Venus — and it is the strongest idea on their screens,
   because progress stops being a number and becomes a place you are getting to.
   Ours is the thing the product is about: a rod of beads. One bead per section,
   pushed across as that section is mastered, and the mascot riding along.
   It reads the mastery ladder rather than a second set of figures.
   ------------------------------------------------------------------------ */
.sjny { flex: 1 1 100%; margin-top: 4px; }

.sjny__top {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  margin: 0 0 12px;
  font: 700 13px/1.3 var(--text); color: var(--on-navy-3);
}
.sjny__top b { color: #FFF; font-weight: 800; }
.sjny__top span { margin-left: auto; font-weight: 500; color: var(--on-navy-4); }

/* The rod. 44px tall because the mascot rides on it and a 20px bar would have
   nowhere to put him. */
.sjny__rod {
  position: relative; height: 46px;
  padding: 0 26px 0 6px;
}

/* The wire, and the part of it already travelled. */
.sjny__wire, .sjny__done {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  height: 6px; border-radius: 999px;
}
.sjny__wire { right: 26px; background: #0C1833; border: 1px solid #2C4478; }
.sjny__done {
  background: var(--s-amber);
  max-width: calc(100% - 32px);
}

/* One bead per section, spread along the rod. The further up its ladder a
   section is, the more solid its bead — grey, then amber, then the logo green
   when it is mastered. */
.sjny__beads {
  position: absolute; inset: 0 26px 0 6px;
  display: flex; align-items: center; justify-content: space-between;
}
.sjny__bead {
  width: 15px; height: 15px; border-radius: 50%; display: block;
  background: #0C1833; border: 2px solid #2C4478;
}
.sjny__bead[data-at="1"] { background: #3D5A94; border-color: #5478B8; }
.sjny__bead[data-at="2"] { background: var(--s-amber-ink); border-color: var(--s-amber); }
.sjny__bead[data-at="3"] { background: var(--s-amber); border-color: #FFD79B; }
.sjny__bead[data-at="4"] {
  background: var(--s-green); border-color: #C7E5A8;
  width: 19px; height: 19px;
}

/* The mascot, riding. Positioned rather than animated — it moves when the
   figures move, which is the only honest reason for anything to move here. */
.sjny__me {
  position: absolute; top: 50%; z-index: 2;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 3px 0 #0C1833);
  transition: left .6s cubic-bezier(.2, .8, .2, 1);
  pointer-events: none;
}

/* The end of the rod. Not a prize — a flag, and the line under the rod says
   who plants it. */
.sjny__flag {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: #0C1833; border: 2px solid var(--s-amber); color: var(--s-amber);
}

.sjny__foot {
  margin: 12px 0 0;
  font: 400 12px/1.55 var(--text); color: var(--on-navy-4);
}
.sjny__foot b { color: var(--on-navy-3); font-weight: 700; }

@media (max-width: 599px) {
  /* Eleven beads in 340px is a row of dots nobody can tell apart, so they
     shrink and the mascot comes down a size with them. */
  .sjny__bead { width: 11px; height: 11px; }
  .sjny__bead[data-at="4"] { width: 15px; height: 15px; }
  .sjny__me .smasc { width: 32px; height: 32px; }
}

/* ---------------------------------------------------------------------------
   15. THE BIG BACK BUTTON
   The client's note, 30 September 2026: "back jaane k liye bachonk hisaab se
   buttons". LogiQids puts a 56px gold disc with a fat arrow in the top-left of
   every child-facing screen, and it is right — a child does not reach for the
   browser's back button and should not have to find a 13px text link.

   It is deliberately NOT the .icon-btn used across the panels: that one is a
   32px square for an adult with a mouse.
   ------------------------------------------------------------------------ */
.sback {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--s-amber); color: #4A2B00;
  border: 3px solid #FFF;
  box-shadow: 0 4px 0 var(--s-amber-ink);
  text-decoration: none;
  transition: transform .12s ease-out, box-shadow .12s ease-out;
}
/* A fatter arrow than the family draws at this size. The icon set is stroke
   2 for a 20px glyph in a table row; inside a 54px disc that reads as a
   hairline, and a back button a child cannot see is not a back button. */
.sback .ico { stroke-width: 2.8; }

.sback:hover { color: #4A2B00; background: #FFC167; }
.sback:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--s-amber-ink); }
.sback:focus-visible { outline: 3px solid #FFF; outline-offset: 3px; }

/* On the cream surfaces the white ring disappears, so it takes the page's own
   line colour instead. */
[data-panel="student"] .pwrap .sback { border-color: var(--line); }

@media (max-width: 599px) {
  .sback { width: 46px; height: 46px; border-width: 2px; }
}

/* ---------------------------------------------------------------------------
   16. OPTION CARDS — picking an answer instead of typing it
   The client's note, 30 September 2026: "questions select che questions astil,
   sagle type karayla nastil". Most questions are picked; some are still typed.

   Four cards, not a radio list. A 9-year-old on a phone gets a 64px target
   with the number at 26px, and the whole card is the label — nobody has to hit
   a 14px circle. The real <input type="radio"> is still there, visually
   hidden, so the keyboard and a screen reader get a proper radio group and the
   arrow keys work without a line of script.

   THE KEY LETTER IS NOT DECORATION. A child saying "I picked C" to a teacher
   is how a doubt gets asked out loud, and a wrong answer that is discussed is
   worth more than one that is silently re-tried.

   Used by S4 and S4b, which is why it is its own section and not inside
   either — the two screens ask the same questions and must offer them the
   same way.
   ------------------------------------------------------------------------ */
/* A <fieldset>, because four options are one question and a screen reader
   should say so. Which means the browser's own border, padding and min-width
   all have to go first. */
.sopts {
  display: grid; gap: 11px; margin: 4px 0 0; padding: 0; min-width: 0;
  border: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 479px) {
  /* One per row below 480px. Two 26px numbers side by side in 340px leaves
     each card 150px wide, and a four-digit answer then wraps under its key. */
  .sopts { grid-template-columns: minmax(0, 1fr); }
}

/* The label IS the button. The input inside it is hidden with the sr-only
   technique rather than display:none, which would take it out of the tab order
   and off the accessibility tree along with it. */
.sopt {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 10px 16px 10px 12px;
  border-radius: 18px; background: #FFF; border: 3px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
  cursor: pointer;
  transition: border-color .15s ease-out, box-shadow .15s ease-out, transform .1s ease-out;
}
.sopt input {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.sopt:hover { border-color: #D8C4A4; }
.sopt:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }

/* A, B, C, D. */
.sopt__k {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--ground); border: 2px solid var(--line);
  font: 800 15px/1 var(--mark); color: var(--muted);
}
.sopt__v {
  font: 800 clamp(22px, 4vw, 26px)/1.1 var(--display); color: var(--navy);
  font-variant-numeric: tabular-nums;
}

/* Picked, and not yet marked. GOLD, which is the state LogiQids uses and the
   right choice: green would read as "correct" on a screen where nothing has
   been marked yet. */
/* The :has() rule is the same state without JavaScript. It is written out in
   full beside the class rather than grouped with it, so a browser too old for
   :has() drops that rule alone and still gets the class the script sets.

   THE :not() PAIR IS LOAD-BEARING, and leaving it off cost an hour. :has()
   takes the specificity of its most specific argument, so .sopt:has(input:checked)
   scores (0,2,1) — HIGHER than .sopt.is-wrong at (0,2,0), no matter which comes
   later in the file. A wrong answer went red on the border and stayed amber
   underneath. Excluding the marked states here is what lets the marked states
   win, because once a question is checked "you picked this" has been overtaken
   by "and it was wrong". */
.sopt:has(input:checked):not(.is-right):not(.is-wrong):not(.is-shown) {
  border-color: var(--s-amber); box-shadow: 0 3px 0 var(--s-amber-ink);
  background: var(--s-amber-pale);
}
.sopt:has(input:checked):not(.is-right):not(.is-wrong):not(.is-shown) .sopt__k {
  background: var(--s-amber); border-color: var(--s-amber-ink); color: #4A2B00;
}
.sopt.is-picked {
  border-color: var(--s-amber); box-shadow: 0 3px 0 var(--s-amber-ink);
  background: var(--s-amber-pale);
}
.sopt.is-picked .sopt__k { background: var(--s-amber); border-color: var(--s-amber-ink); color: #4A2B00; }

/* Keyboard focus has to be drawn on the label, because the input it belongs to
   is one pixel wide and nobody would see a ring on it. */
.sopt:focus-within { outline: 3px solid var(--blue); outline-offset: 2px; }

/* Marked. Only S4b uses these — S4 marks nothing until the sheet is sent. */
.sopt.is-right {
  border-color: var(--s-green); box-shadow: 0 3px 0 var(--s-green-ink);
  background: var(--s-green-pale);
}
.sopt.is-right .sopt__k { background: var(--s-green); border-color: var(--s-green-ink); color: #14260A; }
.sopt.is-wrong {
  border-color: var(--s-red); box-shadow: 0 3px 0 var(--s-red-deep);
  background: #FFF2F2;
}
.sopt.is-wrong .sopt__k { background: var(--s-red-deep); border-color: var(--s-red-deep); color: #FFF; }

/* The tick or the cross, at the right-hand end. The SHAPE carries the verdict
   so colour is never doing it alone (§9, and WCAG 1.4.1). */
.sopt__mark { margin-left: auto; flex: 0 0 auto; display: none; }
.sopt.is-right .sopt__mark--ok { display: block; color: var(--s-green-ink); }
.sopt.is-shown .sopt__mark--ok { display: block; color: var(--s-green-ink); }
.sopt.is-wrong .sopt__mark--no { display: block; color: var(--s-red-deep); }

/* Once the question is marked, the cards stop being buttons. */
.sfq.is-right .sopt, .sfq.is-wrong .sopt { cursor: default; }
.sfq.is-right .sopt:active, .sfq.is-wrong .sopt:active { transform: none; }

/* The one a child SHOULD have picked, when they picked another. Dashed rather
   than solid: it was not their answer, and a solid green card beside a solid
   red one reads as though they somehow got both. */
.sopt.is-shown {
  border-style: dashed; border-color: var(--s-green);
  box-shadow: none; background: var(--s-green-pale);
}
.sopt.is-shown .sopt__k { color: var(--s-green-ink); }

/* Which kind of question this is, said on the card. A child who has typed four
   answers and then meets a picked one should not have to work out why the box
   has gone. */
.sfq__kind {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  background: var(--blue-chip); color: var(--blue-deep);
  font: 700 11px/1.45 var(--text);
}

/* ---------------------------------------------------------------------------
   17. THE SHEET, ONE QUESTION AT A TIME (S4)
   The client's note, 30 September 2026: "sheet madhe questions single single
   nahi yet" — the sheet was twenty cards on one page and it should be one
   question at a time.

   So S4 now uses the same full-screen shell and the same question stage as S4b
   and shares every component with it. What still separates the two, and it is
   the whole reason both exist:

     S4  is the TEST. A clock counts DOWN, nothing is marked until the sheet is
         sent, you can go back over your answers, and a review step lists what
         is still blank before it goes (SOW §4.3.4, M5).
     S4b is the DRILL. No clock to run out, marked as you go, and the working
         is shown before the next question.

   Written as overrides of .sfx rather than a second set of components, because
   two nearly-identical stages is how the two screens would stop matching.
   ------------------------------------------------------------------------ */

/* The clock counts down here, so it is the loud thing rather than a footnote —
   the opposite weighting from S4b, where it is only a stopwatch. */
/* Bigger on a laptop — taller and in a larger figure, the client, 5 October
   2026. Every size here is clamped against vw and NOT against vh: the top of
   each range is what a 1366 screen gets, and the bottom is what the phone keeps.
   Clamping the padding against vh instead would have grown the bar on a tall
   844px phone, which is the one window on which this screen has no height to
   spare. */
/* IT WAS .sfx__clock--down AND A RED WARNING STATE until 12 October 2026, when
   the client took the limit off the sheet. Renamed rather than aliased, because
   a class called --down on a clock that counts up is the kind of thing that is
   still there in a year. The .is-warn rules went with it: there is no threshold
   left to cross, and a red clock on a sheet nobody can fail is a fright for
   nothing. */
.sfx__clock--up {
  background: #1E3260; border-color: #2C4478; color: var(--on-navy-3);
  padding: clamp(7px, 1.1vw, 13px) clamp(15px, 1.3vw, 22px)
           clamp(7px, 1.1vw, 13px) clamp(12px, 1.1vw, 18px);
  border-radius: 16px;
}
.sfx__clock--up .ico { width: clamp(20px, 1.8vw, 26px); height: clamp(20px, 1.8vw, 26px); }
.sfx__clock--up b { font: 800 clamp(21px, 2.9vw, 34px)/1 var(--display); }

/* A segment per question, and on THIS screen it can only say "answered" —
   amber, the same gold a picked option takes, because that is exactly what it
   is recording. Nothing green, nothing red: the sheet has not been marked. */
.sfx__segs i.is-done { background: var(--s-amber); }
/* Where you are now. A ring rather than a colour, so it reads on top of both
   the answered and the untouched state. */
.sfx__segs i.is-at { box-shadow: 0 0 0 2px #FFF; }

/* Moving about the sheet. Back, Skip and Next, and Next is dead until the
   question has an answer — the client's rule, twice stated. Skip is the escape
   hatch that keeps it humane: a child stuck on question seven must not be held
   there while a clock runs down, and what they skip comes back at the review.
   Skip is quiet on purpose. It is a way out, not a suggestion. */
.sfx__skip {
  background: none; border: 2px dashed #2C4478; color: var(--on-navy-3);
  padding: 9px 15px; border-radius: 999px;
  font: 700 13px/1 var(--text); cursor: pointer;
}
.sfx__skip:hover { border-style: solid; color: #FFF; }

/* --- the review step ---------------------------------------------------- */
/* Before it goes. Twenty chips, one per question, and the blank ones say so
   and are the ones you can tap. A confirm dialogue saying "3 left blank" tells
   a child the count; this tells them WHICH, which is the only version of that
   fact they can act on. */
.srev {
  background: #FFF; border: 3px solid var(--line); border-radius: 24px;
  padding: 22px; box-shadow: 0 4px 0 rgba(12, 24, 51, .35);
}
.srev__h { margin: 0; font: 800 clamp(19px, 3vw, 23px)/1.25 var(--display); color: var(--navy); }
.srev__p { margin: 8px 0 0; font: 400 14px/1.6 var(--text); color: var(--muted); max-width: 60ch; }

.srev__grid {
  display: grid; gap: 9px; margin: 18px 0 0;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
}
.srev__q {
  display: grid; gap: 2px; justify-items: center; padding: 9px 6px 10px;
  border-radius: 13px; border: 2px solid var(--line); background: var(--ground);
  font: 800 12px/1 var(--mark); color: var(--muted);
  text-decoration: none; cursor: pointer;
}
.srev__q b {
  font: 800 17px/1.2 var(--display); color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.srev__q--done { border-color: var(--s-green); background: var(--s-green-pale); color: var(--s-green-ink); }
.srev__q--blank {
  border-color: var(--s-amber); border-style: dashed;
  background: var(--s-amber-pale); color: var(--s-amber-ink);
}
.srev__q--blank b { color: var(--s-amber-ink); }
.srev__q:hover { border-style: solid; border-color: var(--blue); }
.srev__q:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.srev__foot {
  margin: 18px 0 0; padding-top: 16px; border-top: 2px dashed var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
.srev__count { margin: 0; flex: 1 1 220px; font: 700 14px/1.45 var(--text); color: var(--muted); }
.srev__count b { color: var(--navy); }

/* ---------------------------------------------------------------------------
   18. STARS, THE RIBBON AND WHAT THE SHEET DID (S5)
   From the client's photographs of the LogiQids result screen: three stars and
   a COMPLETED ribbon above the score, a card counting the correct answers and
   what they paid, and a card showing what the sheet did to your standing.

   The stars are not a second opinion on the percentage. config/preview.php sets
   the second star at exactly points_rules.accuracy_bonus_at, so two stars and
   the accuracy bonus are the same event said two ways.
   ------------------------------------------------------------------------ */
.sstars { display: flex; align-items: center; gap: 4px; }
.sstars .ico { color: #D9CDB8; }
.sstars .ico.is-lit {
  color: var(--s-amber); fill: currentColor;
  filter: drop-shadow(0 2px 0 var(--s-amber-ink));
}

/* The lit ones land one after another, left to right. The delay is set inline
   from the index, so adding a fourth star is adding a star and nothing else. */
@media (prefers-reduced-motion: no-preference) {
  .sstars .ico.is-lit { animation: sstar .45s cubic-bezier(.2, 1.5, .4, 1) both; }
  @keyframes sstar {
    from { transform: scale(0) rotate(-40deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
  }
}

/* COMPLETED. A plaque, not a gradient banner — §7.1 bans the ribbon-with-a-
   shine that every certificate template on the internet uses. Flat navy, white
   letter-spaced caps, two notched ends cut with clip-path. */
.sribbon {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 22px; background: var(--navy); color: #FFF;
  font: 800 12px/1.4 var(--mark); letter-spacing: .18em; text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 50%, 100% 100%, 0 100%, 9px 50%);
}
.sribbon--low { background: var(--s-amber-ink); }

/* The two together, above the score. */
.scrown {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin: 0 0 14px;
}

/* --- what the sheet paid, itemised ------------------------------------- */
/* LogiQids prints "17 Correct Answers +85 XP" as one card, and the shape is
   right: the count and the reward on one line, where a child looks first.
   Ours cannot keep their arithmetic, though — we do not pay per answer. The
   sheet pays a flat amount for finishing plus a bonus for accuracy (S9, M5),
   so the rows below are OUR two rules, and inventing a per-question rate to
   match the screenshot would have been promising points nothing would pay. */
.sbreak {
  display: grid; gap: 10px; margin: 16px 0 0;
  padding: 15px 17px; border-radius: 18px;
  background: var(--s-amber-pale); border: 2px solid #F3D9A6;
}
.sbreak__row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  font: 500 13.5px/1.45 var(--text); color: var(--s-amber-ink);
}
.sbreak__row b { font-weight: 800; }
.sbreak__row .ico { flex: 0 0 auto; }
.sbreak__row span { margin-left: auto; font: 800 16px/1 var(--display); font-variant-numeric: tabular-nums; }
.sbreak__sum {
  margin-top: 2px; padding-top: 11px; border-top: 2px dashed #E3C489;
  display: flex; align-items: baseline; gap: 10px;
  font: 700 13px/1.4 var(--text); color: var(--s-amber-ink);
}
.sbreak__sum b {
  margin-left: auto; font: 800 clamp(24px, 4vw, 30px)/1 var(--display); color: #4A2B00;
}

/* --- what it did to the board ------------------------------------------- */
/* A result screen that says "+35 points" and stops has told a child about a
   number. This says what the number DID, which is the thing they actually
   care about and the reason the sheet felt worth finishing. */
.simpact { display: grid; gap: 14px; }
.simpact__move {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
}
.simpact__was, .simpact__now {
  display: grid; gap: 1px; justify-items: center; min-width: 78px;
  padding: 11px 14px; border-radius: 16px;
}
.simpact__was { background: var(--ground); border: 2px solid var(--line); }
.simpact__now { background: var(--s-green-pale); border: 2px solid var(--s-green); }
.simpact__was b, .simpact__now b {
  font: 800 clamp(24px, 4vw, 30px)/1 var(--display); color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.simpact__now b { color: var(--s-green-ink); }
.simpact__was span, .simpact__now span {
  font: 700 10px/1.4 var(--mark); letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.simpact__arrow { flex: 0 0 auto; color: var(--s-green); }
.simpact__said { margin: 0; flex: 1 1 200px; font: 400 14px/1.6 var(--text); color: var(--muted); }
.simpact__said b { color: var(--navy); font-weight: 800; }

/* No movement at all is a real outcome and gets its own colour rather than a
   green card pretending something happened. */
.simpact--still .simpact__now { background: var(--ground); border-color: var(--line); }
.simpact--still .simpact__now b { color: var(--navy); }
.simpact--still .simpact__arrow { color: var(--muted); }

/* ---------------------------------------------------------------------------
   19. THE QUESTION SUMMARY (S5)
   The client's screenshot: a row per question with your answer, the right
   answer, how many students got it right, and the solution.

   It is a second TAB on the marking card rather than a second card, because
   the quick marks above it are the same twenty questions and two lists of the
   same thing on one page is the reader's problem, not the designer's.

   HOW MANY GOT IT RIGHT is the interesting column and the reason this exists.
   A child who got question 12 wrong, where barely half the level got it right,
   has learnt something different from a child who got question 1 wrong.
   ------------------------------------------------------------------------ */
.sqsum { display: grid; gap: 10px; }

.sqsum__row {
  border-radius: 18px; border: 2px solid var(--line); background: #FFF;
  overflow: hidden;
}
.sqsum__row--no { border-color: #F4C3C5; }

/* The <summary>. The whole strip opens the solution, so the target is the row
   and not a 13px "show" link at the end of it. */
.sqsum__top {
  display: grid; align-items: center; gap: 4px 14px;
  grid-template-columns: 44px minmax(0, 1fr) auto auto 22px;
  padding: 12px 14px; cursor: pointer; list-style: none;
}
.sqsum__top::-webkit-details-marker { display: none; }
.sqsum__top:hover { background: var(--ground); }
.sqsum__row[open] .sqsum__top { background: var(--ground); border-bottom: 2px solid var(--line); }
.sqsum__top:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }

.sqsum__n {
  display: grid; place-items: center; height: 26px; border-radius: 8px;
  background: var(--blue-chip); color: var(--blue-deep);
  font: 800 12.5px/1 var(--mark);
}
.sqsum__row--no .sqsum__n { background: #FFE4E5; color: #B4181D; }

.sqsum__sum {
  font: 700 14px/1.4 var(--text); color: var(--navy);
  font-variant-numeric: tabular-nums; min-width: 0;
}

/* Yours, then the right one. Side by side and labelled, because on a screen
   where three of twenty are wrong the two columns are identical seventeen
   times and nobody should have to remember which is which. */
.sqsum__pair { display: flex; align-items: center; gap: 10px; }
.sqsum__cell { display: grid; gap: 1px; justify-items: end; min-width: 58px; }
.sqsum__cell span {
  font: 700 9.5px/1.3 var(--mark); letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted);
}
.sqsum__cell b { font: 800 17px/1.1 var(--display); font-variant-numeric: tabular-nums; color: var(--navy); }
.sqsum__cell--mine b { color: var(--s-green-ink); }
.sqsum__row--no .sqsum__cell--mine b { color: #B4181D; text-decoration: line-through; }
.sqsum__cell--mine em { font: 800 13px/1.35 var(--text); color: #B4181D; font-style: normal; }

/* How many got it right. A bar rather than a bare percentage: the figure is
   only meaningful next to the other nineteen, and a bar is that comparison. */
.sqsum__peer { display: grid; gap: 4px; justify-items: end; min-width: 92px; }
.sqsum__peer b { font: 800 13px/1 var(--display); color: var(--muted); }
.sqsum__peer i {
  display: block; width: 76px; height: 6px; border-radius: 999px;
  background: var(--line); overflow: hidden;
}
.sqsum__peer i em { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
/* Under half the level got it right: that is a hard question, and it is worth
   a child knowing so. */
.sqsum__peer--hard b { color: var(--s-amber-ink); }
.sqsum__peer--hard i em { background: var(--s-amber); }

.sqsum__caret { color: var(--muted); transition: transform .18s ease-out; }
.sqsum__row[open] .sqsum__caret { transform: rotate(180deg); }

.sqsum__body { padding: 15px 16px 17px; }

@media (max-width: 719px) {
  /* Five columns in 340px is four columns of nothing. The summary becomes two
     rows: the sum on top, the numbers under it. */
  .sqsum__top { grid-template-columns: 44px minmax(0, 1fr) 22px; }
  .sqsum__pair { grid-column: 1 / -1; }
  .sqsum__peer { grid-column: 1 / -1; justify-items: start; }
  .sqsum__peer i { width: 100%; }
}

/* ---------------------------------------------------------------------------
   20. DOUBTS (S20b)
   A doubt is about a sum and the child's own teacher answers it; a support
   ticket is about the software and head office answers it. Two queues, two
   readers, two screens — see the note in config/preview.php.
   ------------------------------------------------------------------------ */
.sdbt { display: grid; gap: 14px; }

.sdbt__item {
  border-radius: 20px; border: 2px solid var(--line); background: #FFF;
  overflow: hidden;
}
.sdbt__item--open { border-color: var(--s-amber); }

/* Which question it is about. This strip is the reason the screen works: a
   doubt with no question attached takes two replies to answer. */
.sdbt__about {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  padding: 10px 15px; background: var(--ground); border-bottom: 2px solid var(--line);
  font: 700 12.5px/1.4 var(--text); color: var(--muted);
}
.sdbt__about b { color: var(--navy); font-weight: 800; }
.sdbt__about .st { margin-left: auto; }

.sdbt__body { padding: 15px 16px 16px; display: grid; gap: 13px; }

/* A message. The child's is on the left in the page's own colours; the
   teacher's is on the right in blue, which is the convention every child
   already knows from every chat app they have ever seen. */
.sdbt__msg { display: flex; gap: 11px; align-items: flex-start; }
.sdbt__msg--them { flex-direction: row-reverse; }
.sdbt__who {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--s-amber); color: #4A2B00; border: 2px solid #FFF;
  box-shadow: 0 0 0 2px var(--s-amber-ink);
  font: 800 12px/1 var(--mark);
}
.sdbt__msg--them .sdbt__who {
  background: var(--blue); color: #FFF; box-shadow: 0 0 0 2px var(--blue-deep);
}
.sdbt__said {
  flex: 0 1 auto; max-width: 62ch;
  padding: 11px 15px 12px; border-radius: 16px;
  background: var(--ground); border: 2px solid var(--line);
}
.sdbt__msg--them .sdbt__said { background: var(--blue-chip); border-color: #BBD3F5; }
.sdbt__said p { margin: 0; font: 400 14px/1.6 var(--text); color: var(--ink); }
.sdbt__said small {
  display: block; margin-top: 6px;
  font: 500 11.5px/1.4 var(--text); color: var(--muted);
}

/* Waiting. Not an empty space — it says who is answering and roughly when,
   because a child who asked at 4:40 and sees nothing assumes it went nowhere. */
.sdbt__wait {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 15px; border-radius: 16px;
  background: var(--s-amber-pale); border: 2px dashed #E3C489;
  font: 700 13.5px/1.5 var(--text); color: var(--s-amber-ink);
}

/* ---------------------------------------------------------------------------
   21. THE BADGE SHELF, FULL (S9b)
   The shelf on S1 shows eight badges and no working. This screen shows the same
   eight with the distance left on each, which is the thing that makes a locked
   badge a target rather than an ornament.
   ------------------------------------------------------------------------ */
.sbdz { display: grid; gap: 13px; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }

.sbdz__card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 15px 16px; border-radius: 20px;
  background: #FFF; border: 2px solid var(--line);
}
.sbdz__card--got { border-color: var(--s-green); background: var(--s-green-pale); }

.sbdz__text { min-width: 0; flex: 1 1 auto; }
.sbdz__text b { display: block; font: 800 15px/1.3 var(--display); color: var(--navy); }
.sbdz__text p { margin: 3px 0 0; font: 400 13px/1.5 var(--text); color: var(--muted); }

/* How far off. Only on the locked ones — a bar at 100% under a badge already
   earned is a sentence nobody needs to read. */
.sbdz__bar { display: block; margin-top: 10px; }
.sbdz__bar i {
  display: block; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden;
}
.sbdz__bar i em { display: block; height: 100%; background: var(--s-amber); border-radius: 999px; }
.sbdz__bar small {
  display: block; margin-top: 5px;
  font: 700 11.5px/1.4 var(--text); color: var(--s-amber-ink);
}

/* Earned, and when. */
.sbdz__got {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 9px;
  font: 800 12px/1.4 var(--text); color: var(--s-green-ink);
}

/* ---------------------------------------------------------------------------
   22. MARKED WHILE SOLVING (S4)
   The client's note, 30 September 2026: "quetion solve zala ki correct asel tr
   green and wrong asel tr red color zala pahije tithe sheet solve karta na" —
   marked as you go, on the sheet, not only at the end.

   The option card already had green and red (§16); what this adds is the rest
   of the screen agreeing with it — the segment, the review chip, and the line
   that says the verdict in words for anyone the colour does not reach.
   ------------------------------------------------------------------------ */

/* A wrong answer on the review step. Dashed gold is still blank, green is right,
   and this is the third state that did not exist while nothing was marked. */
.srev__q--wrong {
  border-color: var(--s-red); background: #FFF2F2; color: #B4181D;
}
.srev__q--wrong b { color: #B4181D; }

/* The verdict, under the options. The colour is the fast signal; this is the one
   that survives colour blindness, a screen reader and a phone in the sun. It is
   the same component S4b uses under its working, so the two screens say a right
   answer the same way. */
[data-sheet] .sfq__verdict {
  margin: 18px auto 0; max-width: 460px; text-align: center;
}

/* Once a question is checked there is nothing left to press. The gold ring on
   the focused label would otherwise still invite one. */
.sfq.is-right .sopt:focus-within,
.sfq.is-wrong .sopt:focus-within { outline: none; }

/* ---------------------------------------------------------------------------
   23. THE SOLVING SCREEN, IN TWO COLUMNS (S4, S4b)
   From the client's photographs of the LogiQids solving screen, 30 September
   2026: the question is a card on the LEFT and the four options are four cards,
   two by two, on the RIGHT, with the verdict and the solution appearing under
   them. (The options moved across on 1 October; before that they sat under the
   question and the right column held only the verdict.)

   IT IS NOT DECORATION. With the working underneath, answering a question makes
   the page grow and the Next button jump down the screen — so the child's eye
   and their mouse both have to go looking for it, every single question. Beside
   it, nothing moves: the answer is where it was, the explanation appears where
   there was empty space, and Next has not gone anywhere.

   Below 900px there is no room for two columns and it stacks, which is the
   right order anyway — question, your answer, then what it was.
   ------------------------------------------------------------------------ */
@media (min-width: 900px) {
  /* Two columns need more than the 880px reading measure the single column
     wanted. The question keeps the larger share: it is the thing being read. */
  .sfx, .sfx__notes { max-width: 1160px; }

  .sfq {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: start;
    gap: 18px;
  }

  /* The panel follows a long column of terms down the screen rather than
     scrolling off the top of it. */
  .sfq__side { position: sticky; top: 14px; }
}

/* Before anything is checked the right-hand column is empty, and an empty
   bordered box is worse than nothing — so it is a dashed outline with one line
   in it saying what will appear there. */
.sfq__wait {
  display: grid; gap: 8px; place-items: center; text-align: center;
  padding: 26px 22px; border-radius: 20px;
  border: 2px dashed #2C4478; background: rgba(12, 24, 51, .35);
  font: 500 13.5px/1.55 var(--text); color: var(--on-navy-3);
}
.sfq__wait .ico { color: var(--on-navy-4); }
@media (max-width: 899px) {
  /* Stacked, it would be a box saying "something will appear below this box".
     On a phone the something simply appears. */
  .sfq__wait { display: none; }
}

/* --- the verdict, as a card ---------------------------------------------- */
/* Two lines rather than one: the headline is the verdict and the line under it
   is what to do about it. The icon carries the same fact as the colour, for
   everybody the colour does not reach (§9, WCAG 1.4.1). */
/* It sits clear of the options rather than against them. Flush, the verdict
   read as a fifth card stuck to the bottom of the four — and the one it was
   stuck to is the one already outlined in green or red, so the two ran together.
   The client, 5 October 2026: thoda khali.

   Two columns only. Stacked on a phone the options and the verdict are already
   separated by the column gap, and that screen has no height to give away. */
@media (min-width: 900px) {
  .sfq__side > .sverdict { margin-top: 14px; }
  /* The waiting box is the same story before anything is checked: flush under
     the four cards it read as a fifth one, open at the bottom. */
  .sfq__side > .sfq__wait { margin-top: 14px; }
}

.sverdict {
  display: flex; align-items: flex-start; gap: 12px; margin: 0;
  padding: 15px 17px; border-radius: 18px;
  border: 2px solid var(--line); background: #FFF;
}
.sverdict b { display: block; font: 800 15.5px/1.35 var(--display); }
.sverdict span > span {
  display: block; margin-top: 3px;
  font: 400 13.5px/1.55 var(--text); color: var(--muted);
}

.sverdict__ico {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
}
.sverdict__ok, .sverdict__no { display: none; }

.sverdict.is-right { border-color: var(--s-green); background: var(--s-green-pale); }
.sverdict.is-right b { color: var(--s-green-ink); }
.sverdict.is-right .sverdict__ico { background: var(--s-green); color: #14260A; }
.sverdict.is-right .sverdict__ok { display: block; }

.sverdict.is-wrong { border-color: #F4C3C5; background: #FFF2F2; }
.sverdict.is-wrong b { color: #B4181D; }
.sverdict.is-wrong .sverdict__ico { background: var(--s-red-deep); color: #FFF; }
.sverdict.is-wrong .sverdict__no { display: block; }

/* --- the solution panel --------------------------------------------------- */
/* In the question column the grid gap already spaces it, so its own margin
   would be that gap twice. */
.sfq__main > .ssol { margin-top: 0; }

.ssol {
  margin-top: 12px; padding: 16px 18px 18px;
  border-radius: 20px; border: 2px solid var(--line); background: #FFF;
}
.ssol__h {
  margin: 0 0 12px; display: flex; align-items: center; gap: 8px;
  font: 800 14px/1.3 var(--display); color: var(--navy);
}
.ssol__h .ico { color: var(--s-amber-ink); }

/* The question number, in the corner of its own card — their "8/10" chip. It
   leaves the middle of the top line to the thing that says what kind of sum
   this is, which is what a child reads first. */
.sfq__ask { position: relative; }
.sfq__n {
  position: absolute; top: 14px; left: 14px;
  padding: 5px 12px;
}
.sfq__what { margin: 4px 44px 0; }

/* The kind chip, where a sheet mixes them, moves to the opposite corner so the
   two never fight for the middle. */
.sfq__kind { position: absolute; top: 15px; right: 14px; }

@media (max-width: 479px) {
  /* 340px of card cannot hold a chip, a label and a chip on one line. */
  .sfq__n { position: static; display: inline-flex; }
  .sfq__kind { position: static; display: inline-flex; margin-left: 6px; }
  .sfq__what { margin: 10px 0 0; }
}
