/* ============================================================
   قدراتي — styled 1:1 after "DuoLingo Design System (Community)"
   Figma file sCGqaL307LkNrY35xnV66O. All colors/radii/sizes are
   exact values extracted from the Figma nodes.
   Font: the file uses "DIN 2014 Rounded VF" (no Arabic glyphs);
   Baloo Bhaijaan 2 is the rounded Arabic equivalent.
   ============================================================ */
:root {
  /* exact palette from Figma */
  --green: #58CC02;        --green-dk: #58A700;
  --blue: #1CB0F6;         --blue-dk: #1899D6;
  --blue-light: #DDF4FF;   --blue-border: #63C9F9;
  --purple: #CE82FF;       --purple-dk: #A568CC;
  --purple-tint: #EDD1FF;  --purple-pale: #DBC3EB;  --purple-shine: #DAA0FF;
  --gold: #FFC800;         --gold-dk: #E6A000;
  --gold-shine: #FFE700;   --gold-soft: #FBE56D;    --brown: #AA572A;    --gold-star: #C57A1C;  --gold-band: #FFD940;    --brown-dk: #7A3B12;
  --lime: #A5D92B;
  --red: #FF4B4B;          --red-soft: #FFB2B2;
  --orange: #FF9600;       --orange-dk: #E07800;    --orange-bg: #FFEFD6;    --gold-bg: #FFF4BF;
  --ink: #4B4B4B;          --gray: #777777;         --gray-icon: #AFAFAF;
  --gray-shadow: #B7B7B7;  --line: #E5E5E5;         --divider: #D9D9D9;
  --disabled: #D9D9D9;     --snow: #FFFFFF;       --surface-hover: #F7F7F7;
  --node-ghost: #CFCFCF;   /* the shadow a jumping path node leaves (Duolingo's node_complete) */
  --green-lip: #478700;    /* exact lip under #58CC02 button (Figma) */
  --green-pale: #A5ED6E;   --green-pale-lip: #79C83A;
  --green-bg: #D6FFB8;     --red-bg: #FFDFE0;       --red-dk2: #EA2B2B;
  --font: 'Baloo Bhaijaan 2', 'Segoe UI', Tahoma, sans-serif;
  --nav-h: 80px;
  --scrim: rgba(40, 40, 48, .55);   /* one dim for every overlay */
  --chest: #1E3A8A;       --chest-dot: #FFE9A8;   /* the daily chest's navy and the pale gold of its tap dots */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
body {
  margin: 0; min-height: 100%;
  background: #ECECEC;
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.app {
  max-width: 430px; margin: 0 auto; min-height: 100vh;
  background: var(--snow);
  box-shadow: 0 0 0 1px var(--line), 0 18px 60px rgba(75,75,75,.18);
  position: relative; display: flex; flex-direction: column;
}
@media (max-width: 470px) { .app { box-shadow: none; } }

h1,h2,h3 { margin: 0; font-weight: 700; }
button { font-family: var(--font); cursor: pointer; }
svg.ic { display: block; }

/* ============================================================
   Buttons — Figma "Button": 398x48 slot, face 43px r13,
   5px darker lip below, 16px/700 uppercase label
   ============================================================ */
.btn {
  display: block; width: 100%;
  border: 0; border-radius: 13px;
  height: 43px; margin-bottom: 5px;
  font-size: 16px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: #fff; background: var(--green);
  box-shadow: 0 5px 0 var(--green-lip);
  transition: transform .08s, box-shadow .08s;
  user-select: none;
}
.btn:active { transform: translateY(5px); box-shadow: 0 0 0 var(--green-lip); }
.btn:disabled {
  /* #D9D9D9 on #777 measured 3.18:1 and read as "gone" rather than "not yet" */
  background: #E5E5E5; color: var(--ink);
  box-shadow: none; cursor: default; transform: none;
}
.btn-blue   { background: var(--blue);   box-shadow: 0 5px 0 var(--blue-dk); }
.btn-blue:active   { box-shadow: 0 0 0 var(--blue-dk); }
.btn-red    { background: var(--red);    box-shadow: 0 5px 0 var(--red-dk2); }
.btn-red:active    { box-shadow: 0 0 0 var(--red-dk2); }
.btn-white  {
  background: #fff; color: var(--purple);
  box-shadow: 0 5px 0 var(--purple-pale);
}
.btn-white:active  { box-shadow: 0 0 0 var(--purple-pale); }
.btn-ghost {
  background: #fff; color: var(--blue);
  border: 2px solid var(--line); box-shadow: 0 2px 0 var(--line);
}
.btn-ghost:active { box-shadow: 0 0 0 var(--line); transform: translateY(2px); }

/* ============================================================
   Context bar — Figma "Context Bar" 430x54, white, counters:
   icon + 16px/700 number (streak #FF9600, gem #1CB0F6, ♥ #FF4B4B)
   ============================================================ */
/* Three counters, not a bar: they stay pinned as you scroll but have no
   surface of their own, so the path passes behind them. */
.statbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: center;
  height: 54px; padding: 0 16px;
  /* Opaque, like Duolingo's: with no background the lesson labels scrolled
     up under it and showed through between the counters. */
  background: var(--snow);
}
.statbar > * { pointer-events: auto; }
.stat { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 16px; }
.stat-streak { color: var(--orange); }
/* Arabic-Indic zero is a dot on the baseline, so a broken streak read as a
   flame next to a speck. Dim the flame so it says "not started" instead. */
.stat-streak.zero { color: var(--gray-icon); }
.stat-streak.zero img { filter: grayscale(1); opacity: .45; }
.stat-xp     { color: var(--blue); }
.stat-hearts { color: var(--red); }
/* it is a <button> so the league is one tap away — but a button with no
   reset wears the browser's grey face and border, which is what showed in the
   bar. Strip the chrome; it is a counter like the two beside it. */
.stat-rank { background: none; border: 0; padding: 0; margin: 0; color: var(--ink); font: inherit; font-weight: 700; line-height: 1; }
.stat-rank:active { transform: translateY(1px); }

/* The lesson intro: the rule before the quiz, on a first attempt only. */
.lesson-intro { padding: 0 0 96px; position: relative; }
.li-x { position: absolute; top: 8px; left: 8px; z-index: 3; }
.li-head {
  margin: 14px 16px 18px; padding: 16px 18px 14px;
  border-radius: 16px; color: #fff;
}
.li-kicker { font-size: 12.5px; font-weight: 800; opacity: .85; letter-spacing: .3px; }
.li-head h1 { font-size: 23px; line-height: 1.25; margin-top: 2px; }
.li-body { padding: 0 16px; }
/* A wall of four justified paragraphs is not something a seventeen-year-old
   reads at eleven at night. One card per step, a numbered disc to anchor the
   eye, and a short lead line in the unit colour it can scan in a second. */
.li-step {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 2px solid var(--line); border-radius: 15px;
  padding: 13px 14px 12px; margin-bottom: 10px;
  box-shadow: 0 2px 0 var(--line);
  animation: fadeUp .35s var(--d, 0s) ease backwards;
}
.li-num {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--li-c, var(--green)); color: #fff;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 800; line-height: 1;
  box-shadow: 0 2px 0 var(--li-s, var(--green-dk));
}
.li-txt { flex: 1; min-width: 0; }
.li-lead {
  display: block; font-size: 16.5px; font-weight: 800; color: var(--ink);
  line-height: 1.45; margin-bottom: 2px;
}
.li-rest { display: block; font-size: 14.5px; font-weight: 600; color: var(--gray); line-height: 1.65; }
/* a step with no natural lead clause would otherwise be one bold wall */
.li-solo { display: block; font-size: 15.5px; font-weight: 700; color: var(--ink); line-height: 1.62; }
.li-body .ex-tip { margin-top: 4px; }
/* the imported curriculum: goal under the title, then rule = name / formula /
   when-to-use as three rows, and the book's own key drawing above them */
.li-goal { margin: 8px 0 0; font-size: 14px; font-weight: 600; line-height: 1.55; opacity: .92; }
.li-formula { display: block; font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.65; }
.li-when { display: block; font-size: 13.5px; font-weight: 600; color: var(--gray); line-height: 1.6; margin-top: 2px; }
.li-when::before { content: "متى؟ "; color: var(--li-c, var(--green)); font-weight: 800; }
.li-fig {
  display: flex; justify-content: center; margin-bottom: 10px; padding: 10px;
  background: #fff; border: 2px solid var(--line); border-radius: 15px; box-shadow: 0 2px 0 var(--line);
}
.li-fig svg { max-width: 100%; height: auto; }

/* ---- teaching cards (js/data/teach.js): one rule, one tap, then its questions ---- */
.screen-full.screen-teach {
  padding-bottom: calc(110px + env(safe-area-inset-bottom));
  /* the check is a lesson question, so its card is the session's option card;
     these are .screen-session's own values, declared again so the two skins
     cannot drift apart */
  --hair: #e5e5e5;      --card-radius: 15px;
  --grn-face: #d0ffb5;  --grn-edge: #95ed63;  --grn-ink: #58a700;
  --red-face: #ffdfe0;  --red-edge: #ff8f8f;  --red-ink: #ea2b2b;
}
/* the teach bar IS .progress — same 16px r64 track, same inset shine line.
   Only the tint is local, through the hooks fxPaintBar() already uses. */
/* the bar keeps the session's width: hearts sit here in a lesson, nothing here in a card */
.tc-back-ph { width: 44px; flex-shrink: 0; }
/* the teach column is the session column, at every tier.
   A two-line rule card used to sit under the header with the rest of the screen
   empty beneath it — five hundred pixels of nothing on a desktop display. The
   card centres in the space it has, with the same auto-margin pair .q-area
   uses, so a long card still starts at the top and scrolls. */
.teach-body {
  width: 100%; max-width: var(--col-max); margin-inline: auto;
  padding: 18px 16px 0;
  flex: 1; display: flex; flex-direction: column; min-height: 0;
}
.teach-body > :first-child { margin-top: auto; }
.teach-body > :last-child { margin-bottom: auto; }
.teach-card {
  background: #fff; border: 2px solid var(--line); border-radius: 16px;
  padding: 16px; box-shadow: 0 2px 0 var(--line);
  animation: fadeUp .35s ease backwards;
}
.tc-kicker { font-size: 12.5px; font-weight: 800; color: var(--li-c, var(--green)); letter-spacing: .3px; margin-bottom: 10px; }
.tc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.tc-title { font-size: 20px; font-weight: 700; color: var(--ink); margin: 0; line-height: 1.3; }
.tc-say { font-size: 15.5px; font-weight: 700; color: var(--ink); line-height: 1.62; margin: 0 0 14px; }
/* A formula is read, not tapped. It keeps .choice.sel's blue face and border,
   but not its 0 2px 0 lip — the lip is what makes a card look pressable, and
   a static panel in this file (.fb-solution, .ex-tip) is r12 with no lip. */
.tc-formula {
  font-size: 17px; font-weight: 800; color: var(--blue-dk); line-height: 1.6; text-align: center;
  background: var(--blue-light); border: 2px solid var(--blue-border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 14px;
}
/* the example is an .ex-step: the same 3px spine on the reading-start edge */
.tc-eg {
  font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.7;
  border-right: 3px solid var(--line); padding: 7px 14px 7px 4px;
}
/* a rule's picture sits between the words and the formula; the hook is the
   one line to keep when everything else fades */
.tc-fig { display: flex; justify-content: center; margin: 0 0 14px; }
.tc-fig svg { max-width: 100%; height: auto; }
.tc-hook { margin-top: 12px; font-size: 14.5px; font-weight: 700; color: var(--ink); line-height: 1.6; }
.tc-eg-l { display: inline-block; font-size: 12.5px; font-weight: 800; color: var(--li-c, var(--green)); margin-left: 8px; }
.tc-hero { text-align: center; padding: 24px 16px 20px; }
.tc-chunk-title { font-size: 26px; font-weight: 700; color: var(--ink); margin: 4px 0 10px; line-height: 1.25; text-wrap: balance; }
.tc-chunk-goal { font-size: 15px; font-weight: 600; color: var(--gray); line-height: 1.7; margin: 0 0 16px; }
/* the file's pill is a tinted fill with no border (.pf-goal, .pf-w-go,
   .login-badges span) — a white face with a 2px edge is button grammar */
.tc-plan, .tc-practice {
  display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--gray);
  background: var(--line); border-radius: 999px; padding: 6px 11px 5px;
}
.tc-practice { margin-bottom: 14px; }
.tc-q { font-size: 21px; font-weight: 700; color: var(--ink); line-height: 1.65; margin: 0 0 18px; padding: 2px 2px 0; }
/* The warm-up: the first screen of the first lesson anyone plays. It is the
   check's card with the heading the check does not need — nothing has been
   taught yet, so the screen has to say why it is asking. The sum itself is set
   big and centred, because it is the whole screen and it is meant to look
   easy. */
.tc-warm-lead { text-align: center; margin-bottom: 18px; animation: fadeUp .35s ease backwards; }
.tc-warm-lead .tc-kicker { margin-bottom: 6px; }
.tc-warm-h { font-size: 23px; font-weight: 700; color: var(--ink); margin: 0; line-height: 1.3; text-wrap: balance; }
.tc-q-warm { font-size: 34px; font-weight: 800; text-align: center; letter-spacing: 1px; margin: 0 0 22px; }
.tc-choices { display: flex; flex-direction: column; gap: 10px; }

/* ---- the check's option card: the session's, verbatim ---- */
.screen-teach .slot { position: relative; min-height: 62px; display: flex; }
.screen-teach .slot > .base {
  display: block; position: absolute; inset: 0;
  border-radius: var(--card-radius); background: var(--hair); z-index: 0;
}
.screen-teach .choice {
  position: relative; z-index: 1; flex: 1; overflow: hidden;
  border: 2px solid var(--hair); border-bottom-width: 4px;
  border-radius: var(--card-radius); box-shadow: none;
}
/* once answered, the card moves on GSAP's transform — the entry fade and the
   CSS shake would fight it, so they are off from that render on */
.tc-choices.answered .choice, .screen-teach .choice.wrong { animation: none; }
.screen-teach .choice:active { transform: none; box-shadow: none; }
.screen-teach .choice .ch-letter { border-color: var(--hair); background: transparent; }
.screen-teach .choice.correct { background: var(--grn-face); border-color: var(--grn-edge); color: var(--grn-ink); box-shadow: none; }
.screen-teach .choice.correct .ch-letter { border-color: var(--grn-edge); color: var(--grn-ink); }
.screen-teach .choice.wrong { background: var(--red-face); border-color: var(--red-edge); color: var(--red-ink); box-shadow: none; }
.screen-teach .choice.wrong .ch-letter { border-color: var(--red-edge); color: var(--red-ink); }

.tc-why {
  margin-top: 14px; padding: 10px 12px; border-radius: 12px;
  font-size: 15px; font-weight: 700; line-height: 1.65;
  animation: fadeUp .3s ease backwards;
}
.tc-why.good { background: var(--green-bg); color: var(--green-dk); }
.tc-why.bad  { background: var(--red-bg);   color: var(--red-dk2); }
/* the coach speaks from the gutter, outside the card: a study move, not a
   fifth thing to memorise */
.tc-coach {
  display: flex; align-items: flex-start; gap: 8px; margin: 14px 4px 0;
  font-size: 13.5px; font-weight: 700; color: var(--gray); line-height: 1.6;
}
.tc-coach svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--gold-dk); margin-top: 2px; }
.win-coach { justify-content: center; text-align: center; text-wrap: balance; margin: 4px auto 18px; max-width: 320px; }
.bk-coach { margin: 0 2px 14px; }

/* the chunk's rules inside the «كيف أحلّها؟» sheet */
.tc-mini { padding: 10px 0; }
.tc-mini + .tc-mini { border-top: 1px solid #F3F3F3; }
.tc-mini b { display: block; font-size: 15.5px; color: var(--ink); margin-bottom: 8px; }
.tc-mini .tc-formula { font-size: 15.5px; padding: 8px 12px; margin-bottom: 8px; }
.tc-mini .tc-eg { font-size: 14px; }
/* the sheet's second action is a button, not an underline — .btn-ghost is the
   pair the fail screen and both mock screens already stack over a primary */
.ms-link { color: var(--blue-dk); }

/* the guidebook sheet: the .ms-bulb disc, with the white knocked-out icon
   every other disc in this app carries */
.bk-bulb img { width: 22px; height: 22px; filter: brightness(0) invert(1); }
.bk-body .li-step { animation: none; }
.bk-row.done .li-num { background: var(--green); box-shadow: 0 2px 0 var(--green-dk); }
.bk-row.miss .li-num { background: var(--orange); box-shadow: 0 2px 0 #E07D00; }
.bk-sep { font-size: 13px; font-weight: 800; color: var(--gray); margin: 8px 4px 10px; }
.bk-les {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  margin: 18px 4px 10px; font-size: 13.5px; font-weight: 800; letter-spacing: .3px; line-height: 1.4;
  color: var(--li-c, var(--green));
}
.bk-les:first-child { margin-top: 0; }
.bk-les-c { font-size: 12.5px; font-weight: 700; color: var(--gray); white-space: nowrap; }
/* a book taller than its sheet comes in pages (bookPages): the sheet takes its full height, the
   pages sit side by side and snap as they are swiped, dots and arrows under them; nothing scrolls up and down */
/* above the tab bar, so «رجوع» at its foot is never under it */
.method-veil.book-veil { z-index: 340; }
.book-sheet.bk-paged { display: flex; flex-direction: column; height: 90vh; height: 90dvh; max-height: none; overflow: hidden; }
.book-sheet.bk-paged > :not(.bk-body) { flex: none; }
.bk-paged .bk-body { flex: 1; min-height: 0; margin-bottom: 10px; }
.bk-body.bk-track {
  display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.bk-body.bk-track::-webkit-scrollbar { display: none; }
.bk-page { flex: 0 0 100%; height: 100%; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; box-sizing: border-box; }
.bk-page > .bk-les:first-child { margin-top: 0; }
.bk-page > :last-child { margin-bottom: 0; }
/* paged, the sheet's head is a little tighter so each page holds more */
.bk-paged .ms-grip { margin: 2px auto 8px; }
.bk-paged .ms-sub { margin: 4px 2px 8px; }
.bk-paged .bk-coach { margin-bottom: 8px; }
.bk-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 0 12px; }
.bk-pager[hidden] { display: none; }
.bk-dots { display: flex; align-items: center; gap: 4px; }
.bk-dot { width: 22px; height: 22px; padding: 0; border: 0; background: none; display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bk-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: width .2s, background .2s; }
.bk-dot.on::before { width: 20px; border-radius: 4px; background: var(--li-c, var(--green)); }
.bk-count {
  min-width: 96px; height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--hair);
  font: inherit; font-size: 14px; font-weight: 800; color: var(--ink); display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
}
.bk-ix-ic { width: 14px; height: 11px; flex: none; color: var(--li-c, var(--green));
  background: linear-gradient(currentColor 0 0) 0 0 / 100% 2.4px no-repeat, linear-gradient(currentColor 0 0) 0 50% / 100% 2.4px no-repeat, linear-gradient(currentColor 0 0) 0 100% / 100% 2.4px no-repeat; }
/* the unit book's contents: one row per lesson, a tap goes to its page */
.bk-ix {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; margin: 0 0 8px; padding: 10px 14px;
  border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; background: var(--snow); font: inherit; text-align: start;
  font-size: 14.5px; font-weight: 800; line-height: 1.4; color: var(--li-c, var(--green)); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.bk-ix:active { border-bottom-width: 2px; transform: translateY(2px); }
.bk-arrow {
  width: 40px; height: 40px; flex: none; border-radius: 12px; border: 2px solid var(--line); border-bottom-width: 4px;
  background: var(--snow); display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.bk-arrow::before { content: ""; width: 9px; height: 9px; border: solid var(--li-c, var(--green)); border-width: 3px 3px 0 0; border-radius: 1px; }
/* right to left: back points right, on to the next page points left */
.bk-prev::before { transform: translateX(-2px) rotate(45deg); }
.bk-next::before { transform: translateX(2px) rotate(-135deg); }
.bk-arrow:active:not(:disabled) { border-bottom-width: 2px; transform: translateY(2px); }
.bk-arrow:disabled { opacity: .35; cursor: default; }

:root[data-motion="reduced"] .screen-teach .choice,
:root[data-motion="reduced"] .teach-card,
:root[data-motion="reduced"] .tc-why,
:root[data-motion="reduced"] .bk-bulb { animation: none; }
:root[data-motion="reduced"] .teach-bar > i { transition: none; }

/* stars under a cleared node, drawn as stars — as dots they read as a coin's
   change, and they sat on the title */
.node-stars { display: flex; gap: 3px; margin-top: 12px; }
.node-stars .ns { width: 15px; height: 15px; display: block; color: var(--line); overflow: visible; }
.node-stars .ns path { fill: currentColor; }
.node-stars .ns.on { color: var(--gold); filter: drop-shadow(0 1.5px 0 var(--gold-dk)); }
.node-stars .ns:nth-child(2) { transform: translateY(-2px); }
.node-stars + .node-label { margin-top: 8px; }

/* ---------- Screens ---------- */
.screen { flex: 1; display: flex; flex-direction: column; padding-bottom: calc(var(--nav-h) + 16px); animation: fadeIn .25s ease; }
.screen-full { padding-bottom: 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform:none;} }

/* ============================================================
   Section header — Figma: 398x79, face #CE82FF r13 on
   #A568CC lip (4px), title 21px white, kicker 16px #EDD1FF
   uppercase, vertical divider + the unit's count on the far side
   (the live site's banner, asked back on 2026-10-23); the whole
   banner opens the unit's rules
   ============================================================ */
.unit-banner { /* a button shrinks to its text: every unit's banner spans the path */
  width: calc(100% - 32px); margin: 14px 16px 8px; padding: 12px 18px;
  border-radius: 13px; color: #fff; position: relative;
  display: flex; align-items: center; gap: 14px;
  min-height: 75px; border: 0; font-family: var(--font); text-align: start; cursor: pointer;
}
.unit-banner:active { transform: translateY(4px); box-shadow: none; }
.unit-banner .u-txt { flex: 1; display: block; }
.unit-banner .u-kicker { display: block; }
.unit-banner .u-kicker {
  font-size: 16px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .3px; opacity: .95;
}
.unit-banner h2 { font-size: 21px; font-weight: 700; line-height: 1.15; }
.unit-banner .u-side {
  display: flex; align-items: center; gap: 14px; align-self: stretch;
}
.unit-banner .u-divider { width: 2px; align-self: stretch; margin: -2px 0; }
.unit-banner .u-prog {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  line-height: 1.1; min-width: 46px;
}
.unit-banner .u-prog b { font-size: 17px; font-weight: 800; }
.unit-banner .u-prog span { font-size: 11px; font-weight: 700; opacity: .85; }
.u-purple { background: var(--purple); box-shadow: 0 4px 0 var(--purple-dk); }
.u-purple .u-kicker { color: var(--purple-tint); }
.u-purple .u-divider { background: var(--purple-dk); }
.u-green  { background: var(--green);  box-shadow: 0 4px 0 var(--green-dk); }
.u-green .u-kicker { color: #C8F0A8; }
.u-green .u-divider { background: var(--green-dk); }
.u-blue   { background: var(--blue);   box-shadow: 0 4px 0 var(--blue-dk); }
.u-blue .u-kicker { color: var(--blue-light); }
.u-blue .u-divider { background: var(--blue-dk); }
.u-gold { background: var(--gold); box-shadow: 0 4px 0 var(--gold-dk); }
.u-gold .u-kicker { color: #FFF1C1; }
.u-gold .u-divider { background: var(--gold-dk); }

/* ============================================================
   Level path — Figma "Level": 71x58 ellipse face on same-size
   ellipse lip offset 7px down; inner top shine; icon centered.
   Current level: 89x84 progress ring (6px #E5E5E5 + colored arc)
   + floating white "START" tooltip (r11, 2px #E5E5E5, 17px/900)
   ============================================================ */
.path { display: flex; flex-direction: column; align-items: center; padding: 38px 0 6px; position: relative; }
.path-row { position: relative; height: 160px; width: 100%; display: flex; justify-content: center; }
/* room under the last node so its start bubble can always scroll it up into view */
.path-tail { height: 200px; }
.node-col { position: relative; display: inline-flex; flex-direction: column; align-items: center; }
/* the level buttons are a fifth bigger (the user, 2026-10-26: «make level
   buttons bigger»): the whole node — hexagon, lip, sign, ring, ghost, the
   lesson-done coin and its diamonds — is scaled as one, so every measured beat
   keeps its proportions; its title is scaled back and stays the size it was.
   A scale, not zoom: under a zoomed parent Chrome runs no animation on the GPU,
   so the ring's breath and the star flip took two thirds of a slow phone's main
   thread on an idle path. The box stays its unscaled size, so its offset on the
   path (--x) and its title's distances are carried through --nz by hand */
.node-col { --nz: 1.2; scale: var(--nz); transform-origin: 50% 0; right: calc(var(--x, 0) * var(--nz) * 1px);
  align-self: flex-start; height: calc(100% / var(--nz)); }   /* as tall on screen as its row, as the zoomed one was (scrollIntoView centres on it) */
.node-col .node-label { scale: calc(1 / var(--nz)); transform-origin: 50% 0; }

/* the node is a hexagon (NODE_SHAPE in app.js): face, its lip 7px under it and
   a smaller hexagon of shine, painted from the same --node-* colours the coin
   used. The press is the coin's: the button drops 7px and its lip goes under it */
.node {
  position: relative;
  width: 71px; height: 58px; margin-top: 10px;
  border: 0; padding: 0; background: none;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.node > * { position: relative; }
.node > .node-sh { position: absolute; inset: 0; width: 71px; height: 58px; overflow: visible; pointer-events: none; }
.nd-face { fill: var(--node-c, var(--purple)); }
.nd-lip { fill: var(--node-s, var(--purple-dk)); transform: translateY(7px); }
.nd-hi { fill: var(--node-h, transparent); }
.node:active:not(:disabled), .node.down { transform: translateY(7px); }
.node:active:not(:disabled) .nd-lip, .node.down .nd-lip { transform: none; }
.node-done   { --node-c: var(--gold); --node-s: var(--gold-dk); --node-h: var(--gold-shine); }
/* each lesson's own sign (lessonIcon): white on an open node, the star-done
   brown on a finished one, so it reads against the gold */
.node-ic { width: 38px; height: 38px; color: var(--snow); overflow: visible; }
.node-ic .s { fill: none; stroke: currentColor; stroke-width: 4.2; stroke-linecap: round; stroke-linejoin: round; }
.node-ic .f { fill: currentColor; }
.node-ic .j { stroke: currentColor; stroke-width: 3; stroke-linejoin: round; }
.node-done .node-ic { color: var(--gold-star); width: 31px; height: 31px; }
/* the finished node (NODE_GOLD): its bands of light over the gold face */
.nd-gold .nd-hi { fill: var(--gold-band); }
.nd-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.node-locked { --node-c: var(--line); --node-s: var(--gray-shadow); --node-h: transparent; cursor: default; }
/* a locked lesson's sign in Duolingo's Hare grey, not white (LevelOval.Locked:
   face Swan, icon Hare; the user, 2026-10-27: «make the icons darker in locked
   levels exactly like Duolingo») */
.node-locked .node-ic { color: var(--gray-icon); }
/* the sign's shadow during the star flip (nodeFlip): its own shape in the
   lip's colour, laid where the sign rests, under it */
.node > .node-ic-sh { position: absolute; left: 50%; top: 50%; margin: -19px 0 0 -19px; opacity: 0; pointer-events: none; }
/* Lesson title under each node. Readability over compactness: no opacity
   fade (it muddied the text), a wider box so Arabic titles break at a word
   instead of mid-phrase, and state carried by colour rather than by dimming. */
.node-label {
  font-size: 13px; font-weight: 800; color: var(--ink);
  max-width: 124px; text-align: center; line-height: 1.4;
  /* 15px clears the node's 7px lip with room to breathe (was 10px, which
     left a 3px gap and read as touching the circle). */
  margin-top: 15px; letter-spacing: .1px;
  text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; pointer-events: none; user-select: none;
  /* the connector dots were being drawn straight through the wrapped second
     line of the first lesson's title — the first thing a new player looks at */
  position: relative; z-index: 2;
}
.node-label.nl-done   { color: var(--gold-dk); }
.node-label.nl-locked { color: var(--gray); font-weight: 700; }
/* The lesson you are on gets the most weight on the page. It also carries the
   86px progress ring, which hangs ~10px below the node's lip and was cutting
   into the label, so its title needs to start lower than the others — 29px
   clears the ring at its widest breath. */
.node-col.bob .node-label { font-size: 14px; color: var(--ink); margin-top: 29px; }
/* beside the node, not under it: on its left or its right by where it stands on
   the path (lbl-l / lbl-r, set in renderPath), level with the face and aligned
   to the node's side, a little further out round the current node's ring */
.node-col[class*="lbl-"] .node-label {
  position: absolute; top: 39px; translate: 0 -50%;
  width: max-content; max-width: 128px; margin: 0;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px #fff;
}
.node-col.lbl-l .node-label { right: calc(100% + 14px / var(--nz)); text-align: right; transform-origin: 100% 50%; }
.node-col.lbl-r .node-label { left: calc(100% + 14px / var(--nz)); text-align: left; transform-origin: 0 50%; }
.node-col.bob.lbl-l .node-label { right: calc(100% + 26px / var(--nz)); margin: 0; }
.node-col.bob.lbl-r .node-label { left: calc(100% + 26px / var(--nz)); margin: 0; }
/* never past the screen's edge (the user, 2026-10-26, on a long title cut off on
   a narrow phone): the title is as wide as the room between the node and a
   12px margin — half the screen, plus how far the node leans away (--ax, ×1.2
   for the zoom), less the node's half and the gap — and takes a third line (more, a size down, on a 320px phone)
   rather than run off */
.node-col[class*="lbl-"] .node-label { max-width: min(128px, calc(50vw + var(--ax, 0) * 1.2px - 70px)); -webkit-line-clamp: 5; }
@media (max-width: 350px) { .node-col[class*="lbl-"] .node-label { font-size: 12.5px; } }
.node-col.bob[class*="lbl-"] .node-label { max-width: min(128px, calc(50vw + var(--ax, 0) * 1.2px - 82px)); }
.node-col[class*="lbl-"] .node-stars + .node-label { margin-top: 0; }
.node-ring { /* progress ring around current level; node face+lip spans y 10-75, ring height 84 → top 0 centers it */
  position: absolute; top: 0; left: 50%; margin-left: -44.5px;
  width: 89px; height: 84px; pointer-events: none;
}

/* ============================================================
   Bottom nav — Figma "Bottom Nav": white, 1px #E5E5E5 top line,
   icon-only 40x40 r8 buttons; active: #DDF4FF + 2px #63C9F9
   ============================================================ */
.bottomnav {
  position: fixed; bottom: 0; right: 50%; transform: translateX(50%);
  width: 100%; max-width: 430px; height: var(--nav-h);
  background: var(--snow); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; align-items: center; z-index: 336;
  padding-bottom: env(safe-area-inset-bottom);
}
.navbtn {
  width: 40px; height: 40px; border-radius: 8px;
  border: 2px solid transparent; background: none;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.navbtn.active { background: var(--blue-light); border-color: var(--blue-border); }

/* ============================================================
   Lesson / exam session
   ============================================================ */
.screen-session > .session-top { flex-shrink: 0; }   /* room given to the step at its foot never squeezes the top bar (QA, 2026-11-08: it rose 14px) */
.session-top {
  display: flex; align-items: center; gap: 11px;
  height: 58px; padding: 0 14px; margin-top: 6px;
}
.x-btn {
  border: 0; background: none; padding: 4px; display: flex;
  min-width: 44px; min-height: 44px; align-items: center; justify-content: center;
}
/* Progress bar — Figma: track #E5E5E5 r64 h16, fill #FFC800 with
   #FBE56D shine line (5px, r6, inset 8px) */
.progress { flex: 1; height: 16px; background: var(--line); border-radius: 64px; overflow: hidden; }
.progress > i {
  display: block; height: 100%; background: var(--bar-fill, var(--gold)); border-radius: 64px;
  transition: width .4s cubic-bezier(.3,1.4,.5,1); position: relative;
  min-width: 12px;   /* an empty track told question one it had made no progress */
}
/* the Figma shine line. Its tint rides the tier with the fill, so the bar
   still reads as one object once the streak turns it orange or blue. */
.progress > i::after { content:''; position:absolute; top:4px; right:8px; left:8px; height:5px; border-radius:6px; background:var(--bar-shine, var(--gold-soft)); }
.sess-hearts { display:flex; align-items:center; gap:6px; font-weight: 700; color: var(--red); font-size: 16px; white-space: nowrap; }
.sess-hearts.hurt { animation: shake .4s ease; }
.sess-hearts.dead { filter: grayscale(1); opacity: .6; }
.sess-timer { font-weight: 700; color: var(--blue); font-size: 18px; min-width: 64px; text-align: center; }
.sess-timer.low { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ============================================================
   Question timer — Duolingo's timed-challenge pill: a tinted
   capsule, the Figma clock with its hand spinning, and m:ss.
   Green at rest, yellow at ≤15s, red at ≤5s. (.qt-svg / .qt-hand
   below also style TIMER_SVG on the sheets and result cards.)
   ============================================================ */
.qt-svg .qt-face { fill: var(--blue-light); transition: fill .3s; }
/* the same ticking clock as the result card, on the exam countdown */
/* and on the timed-out sheet, in red */
.fb-clock { color: var(--red); }
.fb-clock .qt-svg { width: 22px; height: 22px; }
.fb-clock .qt-face { fill: var(--red-bg); }
.qt-hand {
  transform-box: fill-box; transform-origin: 4% 96%;
  animation: spinSlow 5s linear infinite;
}
.qtimer {
  position: relative; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 10px 0 7px; border-radius: 999px;
  /* clock on the left, digits on the right, as on Duolingo's own RTL screen */
  direction: ltr;
  background: var(--green-bg); color: var(--green-dk);
  animation: fadeUp .4s ease backwards;
  transition: background .3s ease, color .3s ease;
}
.qtimer .qt-svg { width: 22px; height: 22px; }
/* the dial takes the pill's tint, so only the ring, the pin and the hand show */
.qtimer .qt-svg .qt-face { fill: none; }
.qt-num {
  font-weight: 800; font-size: 17px; line-height: 1; color: currentColor;
  font-variant-numeric: tabular-nums;
  /* the widest reading sets the width, so the pill never breathes with the digits */
  min-width: 34px; text-align: center; padding-top: 2px;
}
.qtimer.low  { background: var(--gold-bg); color: var(--gold-dk); }
.qtimer.crit { background: var(--red-bg); color: var(--red); }
.qtimer.crit .qt-num { animation: numPop 1s ease infinite; }
.qtimer.paused { opacity: .5; }
.qtimer.paused .qt-hand { animation-play-state: paused; }
@keyframes numPop { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.28); } }

/* lightweight toast for hint feedback */
.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom));
  z-index: 60; display: flex; align-items: center; gap: 8px; max-width: 80vw;
  background: #4B4B4B; color: #fff; font-weight: 800; font-size: 14px;
  padding: 12px 20px 14px; border-radius: 16px;
  box-shadow: 0 4px 0 rgba(0,0,0,.18), 0 8px 18px rgba(0,0,0,.16);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity .22s, transform .22s;
}
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* solid Duolingo pills with a colored bottom lip — no gradient */
.toast.ice { background: var(--blue); box-shadow: 0 4px 0 var(--blue-dk), 0 8px 18px rgba(28,150,220,.28); }
.toast.snip { background: #FF9600; box-shadow: 0 4px 0 #E07D00, 0 8px 18px rgba(224,125,0,.28); }

.q-area { flex: 1; padding: 4px 16px calc(144px + env(safe-area-inset-bottom)); overflow-y: auto; }
/* Header — Figma "Translate this sentence": 26px/700 #4B4B4B */
.q-kicker { color: var(--ink); font-weight: 700; font-size: 26px; line-height: 1.25; margin: 10px 0 16px; }
.q-count { color: var(--gray-icon); font-weight: 700; font-size: 14px; text-transform: uppercase; margin: 8px 0 0; }
.q-stem {
  font-size: 21px; font-weight: 700; line-height: 1.65;
  margin-bottom: 18px; padding: 2px 2px 0;
  color: var(--ink); text-wrap: pretty;
}
.q-figure { display: flex; justify-content: center; margin: 10px 0 14px; }
.q-figure svg { max-width: 100%; height: auto; }

table.q-table { border-collapse: collapse; margin: 4px auto 8px; font-size: 16px; }
table.q-table th { background: var(--blue-light); color: var(--blue-dk); }
table.q-table th, table.q-table td { border: 2px solid var(--line); padding: 6px 14px; text-align: center; font-weight: 600; }

/* comparison layout */
.cmp-wrap { display: flex; gap: 10px; margin: 8px 0 14px; }
.cmp-box {
  flex: 1; background: #fff; border: 2px solid var(--line); border-radius: 13px;
  box-shadow: 0 2px 0 var(--line);
  padding: 12px 10px; text-align: center;
}
.cmp-box .cmp-t { font-size: 13px; font-weight: 700; color: var(--gray); margin-bottom: 6px; }
.cmp-box .cmp-v { font-size: 20px; font-weight: 700; }

/* ============================================================
   Choices — Figma "Word" chip: white face, 2px #E5E5E5 border,
   r13, 2px lip; text 20px/400 #4B4B4B. Selected: blue.
   ============================================================ */
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 12px; text-align: right;
  background: #fff; border: 2px solid var(--line); border-radius: 13px;
  box-shadow: 0 2px 0 var(--line);
  padding: 12px 14px; font-size: 19px; font-weight: 500; color: var(--ink);
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.choice .ch-letter {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px;
  border: 2px solid var(--line); color: var(--gray-icon);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
}
.choice:active { transform: translateY(2px); box-shadow: 0 0 0 var(--line); }
.choice.sel { border-color: var(--blue-border); background: var(--blue-light); color: var(--blue-dk); box-shadow: 0 2px 0 var(--blue-border); }
.choice.sel .ch-letter { border-color: var(--blue-border); color: var(--blue-dk); background:#fff; }
.choice.correct { border-color: var(--green); background: var(--green-bg); color: var(--green-dk); box-shadow: 0 2px 0 var(--green); }
.choice.correct .ch-letter { border-color: var(--green); color: var(--green-dk); background:#fff; }
.choice.wrong { border-color: var(--red); background: var(--red-bg); color: var(--red-dk2); box-shadow: 0 2px 0 var(--red); }
.choice.wrong .ch-letter { border-color: var(--red); color: var(--red-dk2); background:#fff; }
.choice:disabled { opacity: 1; }
.choice.dim { opacity: .4; }   /* reference value — measured, not taste */

/* ============================================================
   Bottom action area + feedback sheet
   ============================================================ */
.action-bar {
  position: fixed; bottom: 0; right: 50%; transform: translateX(50%);
  width: 100%; max-width: 430px; z-index: 45;
  background: var(--snow);
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}
/* The sheet centres with margins, NOT with translateX. The reference slides
   its banner with GSAP on a measured curve, and GSAP owns the whole transform
   matrix — a translateX(50%) baked into the CSS would be wiped the moment the
   timeline touches y. left:0 + right:0 + margin-inline:auto centres the same. */
.feedback {
  position: fixed; bottom: 0; left: 0; right: 0; margin-inline: auto;
  transform: translateY(100%);
  width: 100%; max-width: 430px; z-index: 50;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  transition: transform .3s cubic-bezier(.3,1.2,.4,1);
  /* same object as the method sheet: it slides from the same edge seconds later */
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
}
.feedback.show { transform: translateY(0); }
.feedback.good { background: var(--green-bg); }
.feedback.bad  { background: var(--red-bg); }
.fb-head { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 700; }
.feedback.good .fb-head { color: var(--green-dk); }
.feedback.bad  .fb-head { color: var(--red-dk2); }
.fb-x {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: #fff; color: var(--red);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800;
}
.fb-hearts {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 8px 0 2px; padding: 4px 10px 3px; border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  font-size: 13.5px; font-weight: 800; color: var(--red-dk2);
}
.fb-hearts.warn, .fb-hearts.out { background: var(--red); color: #fff; }
.fb-hearts.warn .ic, .fb-hearts.out .ic { filter: brightness(0) invert(1); }   /* a red heart on the red pill read as a stray dot (QA, 2026-11-08) */
.fb-correct { font-weight: 600; margin: 6px 0 2px; font-size: 16px; }
.feedback.bad .fb-correct { color: var(--red-dk2); }
.fb-solution-toggle { background:none; border:0; font-weight:700; font-size:15px; padding:6px 0; text-decoration: underline; }
.feedback.good .fb-solution-toggle { color:var(--green-dk); } .feedback.bad .fb-solution-toggle { color:var(--red-dk2); }
/* The correct sheet is two rows — verdict + "show the solution" on one line,
   the button under it — so it fits the space the action bar already reserves
   and nothing has to scroll out from under it while the card is jumping. */
.fb-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.fb-row .fb-head { flex: 1; min-width: 0; }
.fb-row .fb-solution-toggle { white-space: nowrap; padding: 6px 0; }
.fb-gain { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font-size: 15px; font-weight: 800; color: var(--green-dk); background: rgba(255,255,255,.75); border-radius: 999px; padding: 3px 9px; }
.fb-gain svg { display: block; }
.feedback.good { padding-top: 14px; }
.fb-solution {
  background: rgba(255,255,255,.75); border-radius: 12px; padding: 10px 12px;
  max-height: 34vh; overflow-y: auto; margin-bottom: 8px;
}
.fb-solution { scrollbar-width: none; }
.fb-solution::-webkit-scrollbar { display: none; }
.fb-solution .ex-step { font-size: 15px; }
.fb-solution .ex-tip { margin-top: 8px; }

/* formatted explanation steps (method sheet only) */
.ex-step {
  position: relative; padding: 7px 14px 7px 4px; margin: 2px 0;
  font-size: 15px; line-height: 1.7; font-weight: 600; color: var(--ink);
  border-right: 3px solid var(--line);
}
.ex-step + .ex-step { border-top: 1px solid #F3F3F3; }
.ex-tip {
  display: flex; gap: 9px; align-items: flex-start;
  background: #FFF8DC; border: 1.5px solid var(--gold); border-radius: 12px;
  padding: 10px 12px; margin-top: 10px;
  font-size: 14.5px; line-height: 1.65; font-weight: 700; color: #8A6D00;
}
.ex-tip svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--gold-dk); margin-top: 1px; }
.feedback .btn { margin-top: 10px; }

/* ============================================================
   Lesson complete — Figma: title 31px #FFC800 (ls +1.2);
   stat cards 102x86: colored shell r17, 13px/900 uppercase white
   label on top band, white face r13 (2px colored border) below
   ============================================================ */
.complete { flex:1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 16px; text-align: center; position:relative; overflow:hidden; }
.complete .owl { font-size: 84px; line-height: 1.1; animation: owlPop .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes owlPop { from { transform: scale(.2) rotate(-20deg); opacity:0;} to { transform: none; opacity:1;} }
.complete h1 { color: var(--gold); font-size: 31px; letter-spacing: 1.2px; margin: 14px 0 22px; }
.complete h1.win-title { margin: 10px 0 4px; }
.result-cards { display: flex; gap: 20px; justify-content: center; width: 100%; margin-bottom: 26px; }
.rcard { width: 102px; border-radius: 17px; padding: 0 0 2px; font-weight: 700; }   /* a rim under the white face as thick as the sides, not cut by the corners (QA, 2026-11-08) */
.rcard .rc-t { font-size: 13px; font-weight: 800; text-transform: uppercase; color: #fff; padding: 3px 0 2px; }
.rcard .rc-v {
  background: #fff; border-radius: 13px; height: 66px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  border: 2px solid transparent; font-size: 19px;
}
.rc-gold  { background: var(--gold); }  .rc-gold .rc-v  { border-color: var(--gold);  color: var(--gold); }
.rc-blue  { background: var(--blue); }  .rc-blue .rc-v  { border-color: var(--blue);  color: var(--blue); }
.rc-green { background: var(--green); } .rc-green .rc-v { border-color: var(--green); color: var(--green); }

/* ============================================================
   Losing screen — Duolingo "out of hearts", clean & juicy:
   heart drops in → cracks with shard burst + screen shake →
   halves sway forever, ripples + sparks loop, cards pop in
   with shine sweeps, CTA heartbeats. Timeline ≈ 0 → 2.6s.
   ============================================================ */
.fail-scene { animation: failShake .5s 1.1s ease both; padding-bottom: 12vh; }
@keyframes failShake {
  0%, 100% { transform: translateX(0); }
  15%, 55% { transform: translateX(-9px); }
  35%, 75% { transform: translateX(9px); }
}

/* breaking-heart hero */
.fail-hero {
  position: relative; width: 158px; height: 150px; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  margin: 6px 0 2px;
}
/* shards bursting out when the heart cracks */
.bh-shard {
  position: absolute; top: 50%; left: 50%; margin: -5px;
  width: 10px; height: 10px; border-radius: 3px;
  opacity: 0; pointer-events: none;
  animation: shardFly .9s 1.15s cubic-bezier(.15,.65,.35,1) forwards;
}
@keyframes shardFly {
  0%   { opacity: 0; transform: rotate(var(--ang)) translateY(-14px) scale(1); }
  12%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--ang)) translateY(calc(var(--dist) * -1)) scale(.35) rotate(160deg); }
}
.bh-svg {
  width: 80%; height: 80%; overflow: visible; position: relative;
  filter: drop-shadow(0 7px 0 rgba(234,43,43,.22));
  animation:
    heartLand .65s .15s cubic-bezier(.3,1.5,.5,1) backwards,
    heartSway 3s 2.2s ease-in-out infinite;
}
@keyframes heartLand { /* drop in with squash & stretch */
  0%   { transform: translateY(-90px) scale(.55); opacity: 0; }
  55%  { transform: translateY(4px) scale(1.12, .82); opacity: 1; }
  75%  { transform: translateY(-3px) scale(.94, 1.07); }
  100% { transform: none; opacity: 1; }
}
@keyframes heartSway {
  0%, 100% { transform: translateY(0) rotate(-2.5deg); }
  50%      { transform: translateY(-7px) rotate(2.5deg); }
}
.bh-half { transform-box: fill-box; }
.bh-l { transform-origin: 70% 95%; animation: bhSplitL .8s 1.15s cubic-bezier(.35,1.4,.5,1) forwards; }
.bh-r { transform-origin: 30% 95%; animation: bhSplitR .8s 1.15s cubic-bezier(.35,1.4,.5,1) forwards; }
@keyframes bhSplitL {
  0%  { transform: none; }
  18% { transform: translate(.6px, 0); }
  100%{ transform: translate(-2.8px, 1.1px) rotate(-13deg); }
}
@keyframes bhSplitR {
  0%  { transform: none; }
  18% { transform: translate(-.6px, 0); }
  100%{ transform: translate(2.8px, 1.3px) rotate(13deg); }
}
.bh-crack { opacity: 0; animation: crackFlash .55s 1.05s ease both; }
@keyframes crackFlash { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }

.complete h1.fail-title {
  color: var(--red); font-size: 31px; letter-spacing: 1.2px;
  margin: 12px 0 6px; z-index: 2;
  animation:
    titleIn .55s 1.55s cubic-bezier(.3,1.5,.5,1) backwards,
    titleThrob 2.4s 2.4s ease-in-out infinite;
}
@keyframes titleThrob {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
.fail-sub {
  color: var(--gray); font-weight: 600; line-height: 1.8;
  margin: 0 0 20px; z-index: 2;
  animation: fadeUp .45s 1.8s ease backwards;
}
.fail-cards { z-index: 2; }
.complete .fail-cards .rcard {
  position: relative; overflow: hidden;
  animation:
    springIn .5s cubic-bezier(.3,1.6,.5,1) backwards,
    cardFloat 3.4s ease-in-out 2 forwards;
}
.complete .fail-cards .rcard:nth-child(1) { animation-delay: 2s, 2.8s; }
.complete .fail-cards .rcard:nth-child(2) { animation-delay: 2.15s, 3.4s; }
@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
/* glossy shine sweeping across the cards, Duolingo-gold-chest style */
.complete .fail-cards .rcard::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%);
  transform: translateX(-130%);
  animation: sweep 3.6s 3.1s ease-in-out 1;
}
/* green avg-time card (Duolingo "BLAZING" timer card, green edition) */
.fail-time .qt-svg { width: 22px; height: 22px; }
.fail-time .qt-svg .qt-face { fill: var(--green-bg); }
.fail-time .rc-v { font-variant-numeric: tabular-nums; }
.fail-actions { width: 100%; max-width: 320px; display: grid; gap: 12px; z-index: 2; }
.fail-actions .btn {
  position: relative; overflow: hidden;
  animation:
    fadeUp .45s 2.35s cubic-bezier(.3,1.4,.5,1) backwards,
    btnHeartbeat 2s 3.3s ease-in-out infinite;
}
.fail-actions .btn:not(.btn-ghost)::after { /* CTA shine sweep */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%);
  transform: translateX(-130%);
  animation: sweep 3s 3.8s ease-in-out infinite;
}
.fail-actions .btn-ghost { animation: fadeUp .45s 2.5s cubic-bezier(.3,1.4,.5,1) backwards; }
@keyframes btnHeartbeat {
  0%, 40%, 100% { transform: scale(1); }
  12% { transform: scale(1.05); }
  24% { transform: scale(1.015); }
}

/* ============================================================
   Lesson-start popup — Figma "Start Tooltip" (Select Lesson):
   #CE82FF r16 sheet, 21px white title, 18px/400 sub,
   white button (lip #DBC3EB) with uppercase colored label
   ============================================================ */
.lesson-pop-veil { position: fixed; inset: 0; z-index: 90; }
.lesson-pop {
  /* A popup, not a banner. It is absolutely positioned inside a viewport-sized
     veil, so left/right + auto margins centre it on the CONTENT column:
     with left = 2*--col-off and right = 0, the centre lands at
     50vw + --col-off, which is exactly where the path column is.
     Auto margins rather than translateX(-50%) so the lpIn animation
     (which animates transform) cannot clobber the centring. */
  position: absolute;
  left: calc(2 * var(--col-off)); right: 0;
  margin-inline: auto;
  width: calc(100% - 32px); max-width: 430px;
  background: var(--pop-c, var(--purple)); border-radius: 16px;
  padding: 16px; z-index: 91;
}
.lesson-pop::before { /* arrow toward the level node */
  content: ''; position: absolute; top: -9px; right: var(--arrow-x, 50%);
  width: 21px; height: 21px; background: inherit;
  transform: translateX(50%) rotate(45deg); border-radius: 5px;
}
.lesson-pop h3 { color: #fff; font-size: 21px; font-weight: 700; margin: 2px 2px 0; text-wrap: balance; }
.lesson-pop .btn { margin-bottom: 0; }
/* Double-XP — one pill that states the offer and its price on its own
   face, so the popup needs no explanatory line under it. */
.lp-boost {
  display: flex; align-items: center; gap: 10px;
  width: 100%; margin: 13px 0 11px;
  background: rgba(255, 255, 255, .16);
  border: 2px solid rgba(255, 255, 255, .45);
  border-radius: 13px; padding: 8px 11px 6px;
  color: #fff; font-family: var(--font); font-size: 14.5px; font-weight: 800;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background .15s, border-color .15s, color .15s, transform .08s;
}
.lpb-ico { display: flex; width: 22px; height: 22px; flex-shrink: 0; }
.lpb-ico img { width: 100%; height: 100%; filter: brightness(0) invert(1); }
.lpb-label { flex: 1; text-align: right; }
.lpb-cost {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  background: rgba(255, 255, 255, .22); border-radius: 999px;
  padding: 3px 9px 2px; font-size: 12.5px; font-weight: 800;
}
.lpb-cost .ic { vertical-align: middle; }
.lp-boost:active { transform: translateY(2px); }
.lp-boost.cant { opacity: .5; }
/* activated — the pill flips to solid white in the unit's own colour */
.lp-boost.on {
  background: #fff; border-color: #fff; color: var(--pop-c, var(--purple));
  animation: boostPop .3s ease;
}
.lp-boost.on .lpb-ico img { filter: none; }
.lp-boost.on .lpb-cost { background: rgba(0, 0, 0, .07); }
@keyframes boostPop { 0% { transform: scale(1); } 45% { transform: scale(1.14); } 100% { transform: scale(1); } }

/* ============================================================
   Generic pages (exam home, stats, settings) — Figma profile
   cards: white, 2px #E5E5E5 border, r16
   ============================================================ */
.page { padding: 16px; }
.page h1 { font-size: 26px; margin-bottom: 4px; }
.page .sub { color: var(--gray); font-weight: 500; margin-bottom: 18px; text-wrap: balance; }
.card {
  background: #fff; border: 2px solid var(--line); border-radius: 16px;
  padding: 16px; margin-bottom: 14px;
}
.card h3 { font-size: 18px; margin-bottom: 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.row .r-label { font-weight: 600; }
.row .r-sub { font-size: 13px; color: var(--gray); font-weight: 500; }

/* stat tiles (profile "Overview" grid) */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.tile {
  border: 2px solid var(--line); border-radius: 16px; background: #fff;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
}
.tile .t-v { font-size: 17px; font-weight: 700; line-height: 1.2; }
.tile .t-l { font-size: 13px; color: var(--gray-icon); font-weight: 600; }

/* exam answer grid */
.exam-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 12px 0; }
.eg-cell { border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 0; font-weight: 700; text-align:center; font-size: 15px; color: var(--gray); }
.eg-cell.ans { background: var(--blue-light); border-color: var(--blue-border); color: var(--blue-dk); }
.eg-cell.cur { border-color: var(--blue); }
.eg-cell.right { background: var(--green-bg); border-color: var(--green); color: var(--green-dk); }
.eg-cell.wrong2 { background: var(--red-bg); border-color: var(--red); color: var(--red-dk2); }

.report-bar { display:flex; align-items:center; gap:10px; margin: 8px 0; font-weight: 600; font-size: 15px; }
.report-bar .rb-track { flex:1; height: 16px; border-radius: 64px; background: var(--line); overflow:hidden; }
.report-bar .rb-fill { display:block; height:100%; border-radius:64px; }

.review-item { border: 2px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.review-item .ri-q { font-weight: 600; margin-bottom: 8px; }
.ri-row { font-size: 15px; font-weight: 600; margin: 3px 0; }
.ri-wrong { color: var(--red-dk2); } .ri-right { color: var(--green-dk); }
.ri-sol { background: #F7F7F7; border-radius: 10px; padding: 8px 12px; font-size: 14px; line-height: 1.8; margin-top: 8px; white-space: pre-line; }

/* ---------- مراجعة الأخطاء (mistakes review) ---------- */
.review-item { animation-delay: var(--d, 0s); }
.ri-tag { font-size: 12.5px; font-weight: 700; margin-bottom: 6px; letter-spacing: .2px; }
.rv-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.rv-top h1 { margin: 0; }
.rv-back { width: 38px; height: 38px; flex-shrink: 0; border: 0; background: none; font-size: 26px; font-weight: 800; color: var(--gray); line-height: 1; cursor: pointer; }
.rv-back:active { transform: scale(.9); }
.rv-practice { margin: 14px 0 18px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.rv-list { margin-top: 4px; }
.rv-empty { text-align: center; padding: 18px 8px 8px; }
.rv-checkhero { position: relative; width: 120px; height: 120px; margin: 8px auto 4px; display: flex; align-items: center; justify-content: center; }
.rv-checkhero .rvc-glow { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(88,204,2,.22), transparent 68%); }
.rv-checkhero .rvc-disc { position: relative; width: 84px; height: 84px; border-radius: 50%; background: var(--green); box-shadow: 0 6px 0 var(--green-dk); display: flex; align-items: center; justify-content: center; color: #fff; animation: rvcPop .45s ease backwards; }
.rv-checkhero .rvc-disc svg { width: 44px; height: 44px; }
@keyframes rvcPop { 0% { transform: scale(0); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
.rv-empty h2 { margin: 18px 0 6px; }
.rv-empty p { color: var(--gray); font-weight: 600; line-height: 1.7; margin: 0 0 22px; }
.rv-empty .btn { max-width: 280px; margin: 0 auto; }

/* entry card on the stats screen */
.mistakes-card { display: flex; align-items: center; gap: 13px; width: 100%; text-align: right; cursor: pointer; border: 2px solid var(--line); }
.mistakes-card:active { transform: translateY(2px); }
.mistakes-card .mc-ico { width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--red-bg); color: var(--red-dk2); font-size: 22px; font-weight: 800; }
.mistakes-card .mc-ico svg { width: 22px; height: 22px; }
.mistakes-card.clean .mc-ico { background: var(--green-bg); color: var(--green-dk); }
.mistakes-card .mc-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.mistakes-card .mc-txt b { font-size: 16px; }
.mistakes-card .mc-txt span { font-size: 13.5px; color: var(--gray); font-weight: 600; }
.mistakes-card .mc-go { font-size: 14px; font-weight: 800; color: var(--red-dk2); white-space: nowrap; }
.mistakes-card.clean .mc-go { color: var(--green-dk); }
/* permanent-rank summary card on the Stats screen */
.rank-card { display: flex; align-items: center; gap: 13px; width: 100%; text-align: right; cursor: pointer; border: 2px solid var(--line); margin-bottom: 14px; }
.rank-card:active { transform: translateY(2px); }
.rank-card .rank-card-badge { flex-shrink: 0; display: inline-flex; }
.rank-card .rank-card-badge .rank-badge { height: 48px; width: auto; display: block; }
.rank-card .rank-card-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rank-card .rank-card-info b { font-size: 16px; }
.rank-card .rank-card-info span { font-size: 13.5px; color: var(--gray); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.rank-card .mc-go { font-size: 14px; font-weight: 800; color: var(--gray); white-space: nowrap; }

.sess-review { color: var(--green-dk) !important; }

/* segmented track switch */
.seg { display: flex; background: #fff; border: 2px solid var(--line); border-radius: 13px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 8px 4px 6px; font-weight: 700; font-size: 15px; color: var(--gray); }
.seg button.on { background: var(--blue-light); color: var(--blue-dk); border: 2px solid var(--blue-border); padding: 6px 2px 4px; }

/* toggle */
.toggle { width: 54px; height: 30px; border-radius: 16px; border: 0; background: var(--line); position: relative; transition: background .2s; flex-shrink: 0; }
.toggle::after { content: ''; position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 3px rgba(0,0,0,.2); transition: transform .2s; }
.toggle.on { background: var(--green); }
.toggle.on::after { transform: translateX(-24px); }

/* stats screen bars */
.dom-stat {
  display: block; width: 100%; text-align: right;
  border: 0; background: none; padding: 6px 0; margin-bottom: 8px;
  font-family: var(--font); color: var(--ink);
  border-radius: 10px; transition: background .12s;
}
button.dom-stat { cursor: pointer; }
button.dom-stat:active { transform: scale(.99); }
@media (hover: hover) and (pointer: fine) { button.dom-stat:hover { background: #F7F7F7; } }
.dom-stat .duo-bar > i { min-width: 0; }
.dom-stat .ds-head { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; margin-bottom: 5px; }

/* ---------- Modal (disclaimer / about) ---------- */
.modal-veil {
  position: fixed; inset: 0; background: var(--scrim); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn .2s;
}
.ask-veil {
  position: fixed; inset: 0; z-index: 340;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, 0); transition: background .24s ease;
}
.ask-veil.show { background: var(--scrim); }
.ask-sheet {
  width: 100%; max-width: 430px; background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .3s cubic-bezier(.25, 1.1, .4, 1);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .18); text-align: center;
}
.ask-veil.show .ask-sheet { transform: translateY(0); }
.ask-sheet h2 { font-size: 21px; margin-bottom: 6px; }
.ask-sheet p { font-size: 15px; line-height: 1.75; color: var(--gray); font-weight: 600; margin-bottom: 16px; }
.ask-go {
  width: 100%; margin-top: 10px; padding: 12px; border: 0; background: none;
  font-family: var(--font); font-size: 15px; font-weight: 800; color: var(--red);
  cursor: pointer; border-radius: 13px;
}
.ask-go:active { background: var(--red-bg); }

.modal {
  background: #fff; border-radius: 16px; max-width: 398px; width: 100%;
  padding: 24px 22px; max-height: 84vh; overflow-y: auto; text-align: center;
  animation: owlPop .4s cubic-bezier(.3,1.4,.5,1);
}
.modal .m-owl { font-size: 58px; }
.modal h2 { font-size: 21px; margin: 6px 0 10px; }
.modal p { font-size: 15px; line-height: 1.9; color: var(--gray); font-weight: 500; text-align: right; }
.modal .btn { margin-top: 12px; }
.linkout { display:block; text-align:center; font-weight:700; color: var(--blue); text-decoration: none; padding: 10px; }

/* ============================================================
   Login — simple onboarding: logo hero, one name field
   (gray fill, 2px border, r13 like the design-system inputs),
   green CTA on its lip, guest link in link-blue caps
   ============================================================ */
.login-screen {
  align-items: center; justify-content: center; text-align: center;
  padding: 36px 24px calc(36px + env(safe-area-inset-bottom));
}

/* ============================================================
   The pre-rendered page in index.html — what crawlers and
   no-JavaScript readers get. Its first screen is a splash cut
   from the start screen's own pieces (.login-title / .login-sub /
   .login-badges), so the second before the app boots reads as
   loading; «عن قدراتي» follows under the fold. The app replaces
   all of it on boot and never shows any of it.
   ============================================================ */
.landing { display: flex; flex-direction: column; align-items: center; }
.landing-hero {
  min-height: 100dvh; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 36px 24px calc(36px + env(safe-area-inset-bottom));
}
.landing-icon { width: 96px; height: 96px; border-radius: 22px; margin-bottom: 14px; animation: fadeUp .4s ease backwards; }
.landing-hero .login-badges { margin-bottom: 0; }
/* three dots breathing in turn: the only sign the app is still on its way */
.landing-loading { display: flex; gap: 7px; margin: 30px 0 0; }
.landing-loading i { width: 9px; height: 9px; border-radius: 50%; background: var(--green); opacity: .3; animation: landDot 1.1s ease-in-out infinite; }
.landing-loading i:nth-child(2) { animation-delay: .18s; }
.landing-loading i:nth-child(3) { animation-delay: .36s; }
@keyframes landDot { 50% { opacity: 1; transform: translateY(-4px); } }
.landing-noscript { color: var(--red); font-weight: 700; margin: 12px 0 0; }
.about {
  width: 100%; max-width: 430px; margin: 0 auto;
  padding: 8px 24px calc(36px + env(safe-area-inset-bottom));
  text-align: start; color: var(--ink);
}
.landing .about { border-top: 2px solid var(--line); padding-top: 18px; }
.about h2 { font-size: 19px; color: var(--ink); margin: 26px 0 8px; }
.about p, .about li { font-size: 15px; font-weight: 500; line-height: 1.9; color: var(--ink); margin: 0; }
.about-list { padding-inline-start: 22px; margin: 0; }
.about-list li { margin-bottom: 4px; }
.about-list li::marker { color: var(--green); }
.faq details { border-top: 2px solid var(--line); padding: 10px 0; }
.faq details:last-child { border-bottom: 2px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; font-weight: 700; font-size: 15.5px; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
/* the chevron: a bordered corner, turned down when closed and up when open */
.faq summary::after {
  content: ''; width: 9px; height: 9px; flex-shrink: 0; margin-bottom: 4px;
  border-right: 2.5px solid var(--gray-icon); border-bottom: 2.5px solid var(--gray-icon);
  transform: rotate(45deg); transition: transform .2s ease, margin .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-bottom: -4px; }
.faq details p { padding-top: 6px; }
.about-links { margin-top: 18px; font-weight: 700; }
.about-links a { color: var(--blue); text-decoration: none; }
.about-en { margin-top: 14px; font-size: 13px; font-weight: 500; }

/* ---------- the guide page (qudrat-kami.html): one article column ---------- */
.guide-body { background: var(--snow); }
.guide { max-width: 640px; margin: 0 auto; padding: 22px 22px calc(40px + env(safe-area-inset-bottom)); color: var(--ink); }
.guide-crumb { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 26px; }
.guide-crumb a { display: inline-flex; align-items: center; gap: 6px; color: var(--green-dk); text-decoration: none; }
.guide-crumb img { border-radius: 6px; }
.guide h1 { font-size: 28px; line-height: 1.5; color: var(--ink); text-wrap: balance; }
.guide .guide-lead { font-size: 17px; font-weight: 600; line-height: 1.9; margin: 12px 0 0; }
.guide h2 { font-size: 21px; margin: 34px 0 10px; }
.guide p, .guide li { font-size: 16px; font-weight: 500; line-height: 1.95; margin: 0; }
.guide p + p { margin-top: 10px; }
.guide a { color: var(--blue); }
.guide-list { margin: 0; padding-inline-start: 24px; }
.guide-list li { margin-bottom: 6px; }
.guide-list li::marker { color: var(--green); font-weight: 800; }
.guide-table-wrap { overflow-x: auto; margin: 4px 0 12px; }
.guide-table { width: 100%; border-collapse: collapse; font-size: 16px; font-weight: 600; text-align: center; }
.guide-table th, .guide-table td { border: 2px solid var(--line); padding: 10px 12px; }
.guide-table th { background: var(--green-bg); color: var(--green-dk); font-weight: 800; }
.guide-table td:first-child { text-align: start; font-weight: 700; }
.guide .faq summary { font-size: 16px; }
.guide-cta {
  margin-top: 36px; padding: 24px 22px 22px; text-align: center;
  background: var(--green-bg); border-radius: 18px;
}
.guide-cta img { border-radius: 16px; }
.guide-cta h2 { margin: 10px 0 6px; color: var(--green-dk); }
.guide-cta p { margin-bottom: 18px; }
.guide-btn { display: block; max-width: 300px; margin: 0 auto; line-height: 43px; text-decoration: none; color: #fff; }
.guide .guide-note { margin-top: 26px; font-size: 13.5px; color: var(--ink); }
/* the methods page: a table of contents, then one card per lesson */
.methods-toc ul { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.methods-toc a { display: inline-block; background: var(--green-bg); color: var(--green-dk); font-weight: 800; text-decoration: none; border-radius: 999px; padding: 6px 14px 4px; font-size: 14.5px; }
.methods-toc span { font-size: 13px; color: var(--ink); font-weight: 600; }
.methods-unit h2 { margin-top: 40px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.method { margin-top: 22px; }
.method h3 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 0 0 8px; }
.method-ico { font-size: 22px; line-height: 1; }
.guide .method-tip { margin-top: 8px; padding: 10px 14px; background: var(--blue-light); border-radius: 12px; font-size: 15px; }

/* --- XP-coins hero (UI-kit frame): coins rain in, gold one slams
   down, then everything floats, the bolt zaps, sparks twinkle --- */
.coins-hero { position: relative; width: 296px; height: 188px; margin: 0 auto 10px; }
.co-glow {
  position: absolute; inset: -8% 4%;
  background: radial-gradient(circle, rgba(255,200,0,.35) 0%, rgba(255,200,0,0) 65%);
  border-radius: 50%;
  animation: glowPulse 2.6s 1.2s ease-in-out infinite;
}
.coins-hero .coin { position: absolute; overflow: visible; }
.coin-blue {
  width: 118px; left: 6px; top: 40px;
  animation:
    coinDrop .6s .4s cubic-bezier(.3,1.5,.5,1) backwards,
    coinBob 3.4s 1.7s ease-in-out infinite;
}
.coin-green {
  width: 118px; right: 6px; top: 40px;
  animation:
    coinDrop .6s .55s cubic-bezier(.3,1.5,.5,1) backwards,
    coinBob 3.4s 2.1s ease-in-out infinite reverse;
}
.coin-gold {
  width: 162px; left: 50%; margin-left: -81px; top: 8px; z-index: 2;
  filter: drop-shadow(0 10px 14px rgba(230,160,0,.35));
  animation:
    heartLand .7s .1s cubic-bezier(.3,1.5,.5,1) backwards,
    coinHero 3s 1.5s ease-in-out infinite;
}
@keyframes coinDrop {
  0%  { opacity: 0; transform: translateY(-70px) scale(.4) rotate(-14deg); }
  60% { opacity: 1; transform: translateY(6px) scale(1.06, .9); }
  100%{ opacity: 1; transform: none; }
}
@keyframes coinBob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-9px) rotate(3deg); }
}
@keyframes coinHero { /* the gold coin proudly bounces */
  0%, 100% { transform: translateY(0) scale(1); }
  40%      { transform: translateY(-7px) scale(1.04); }
  55%      { transform: translateY(-4px) scale(.99, 1.03); }
  70%      { transform: translateY(0) scale(1.02, .98); }
}
.co-bolt {
  transform-box: fill-box; transform-origin: center;
  animation: boltZap 2.7s 1.9s ease-in-out infinite;
}
@keyframes boltZap {
  0%, 30%, 100% { transform: rotate(0) scale(1); }
  6%  { transform: rotate(-12deg) scale(1.18); }
  14% { transform: rotate(8deg) scale(1.05); }
  22% { transform: rotate(-3deg) scale(1.1); }
}
.co-spark {
  transform-box: fill-box; transform-origin: center;
  animation: sparkTwinkle 2.2s 1.4s ease-in-out infinite;
}
@keyframes sparkTwinkle {
  0%, 100% { opacity: .9; transform: scale(1) rotate(45deg); }
  50%      { opacity: .25; transform: scale(.5) rotate(90deg); }
}
.co-diamond {
  position: absolute; border-radius: 28%;
  animation:
    springIn .5s 1s cubic-bezier(.3,1.8,.5,1) backwards,
    diamondFloat 3.2s 1.6s ease-in-out infinite;
}
.co-diamond.cd2 { animation-delay: 1.15s, 2.2s; }
.co-diamond.cd3 { animation-delay: 1.3s, 1.9s; }
.co-diamond.cd4 { animation-delay: 1.45s, 2.6s; }
@keyframes diamondFloat {
  0%, 100% { transform: translateY(0) rotate(45deg); opacity: .95; }
  50%      { transform: translateY(-12px) rotate(65deg); opacity: .55; }
}
/* --- welcome badge-trio hero (WelcomeSVG): drops in, then floats gently --- */
.welcome-hero {
  width: 248px; max-width: 70vw; margin: 0 auto 18px;
  will-change: transform;
  animation:
    welcomeIn .7s .1s cubic-bezier(.3,1.5,.5,1) backwards,
    welcomeFloat 4.2s 1.2s ease-in-out infinite;
}
.welcome-svg { display: block; width: 100%; height: auto; overflow: visible; }
@keyframes welcomeIn {
  0%   { opacity: 0; transform: translateY(-26px) scale(.55); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
@keyframes welcomeFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

.login-title {
  font-size: 34px; color: var(--green); letter-spacing: .5px;
  animation: titleIn .5s .25s cubic-bezier(.3,1.5,.5,1) backwards;
}
.login-sub {
  color: var(--gray); font-weight: 600; line-height: 1.8;
  margin: 6px 0 14px; max-width: 320px; text-wrap: balance;
  animation: fadeUp .4s .45s ease backwards;
}
.login-badges {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 7px;
  margin-bottom: 24px; animation: fadeUp .4s .55s ease backwards;
}
.login-badges span {
  background: var(--green-bg); color: var(--green-dk);
  border-radius: 999px; padding: 5px 12px 3px;
  font-size: 12.5px; font-weight: 800; white-space: nowrap;
}
.login-form { width: 100%; max-width: 340px; }
.login-input {
  display: block; width: 100%;
  font-family: var(--font); font-size: 17px; font-weight: 600; color: var(--ink);
  background: #F7F7F7; border: 2px solid var(--line); border-radius: 13px;
  padding: 13px 16px 11px; margin-bottom: 14px; outline: none;
  transition: border-color .15s, background .15s;
  animation: fadeUp .4s .6s ease backwards;
}
.login-input::placeholder { color: var(--gray-icon); font-weight: 600; }
.login-input:focus { border-color: var(--blue-border); background: #fff; }
.login-input:focus-visible { outline: none; }   /* its own border is the focus ring; the global ring made two */
.login-input.err { border-color: var(--red); background: var(--red-bg); animation: shake .4s ease; }
.login-form .btn { animation: fadeUp .4s .7s ease backwards; }
.login-skip {
  background: none; border: 0; width: 100%;
  color: var(--blue); font-size: 15px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; padding: 14px 0 4px;
  animation: fadeUp .4s .8s ease backwards;
}
.login-skip:active { opacity: .6; }

/* profile avatar (settings) */
.avatar {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: var(--green); box-shadow: 0 3px 0 var(--green-dk);
  color: #fff; font-size: 20px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  padding-top: 2px;
}

/* intro hero */
.hero { text-align:center; padding: 36px 24px 10px; }
.hero .owl { font-size: 92px; display:block; animation: heroBob 2.4s ease-in-out infinite; }
@keyframes heroBob { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-7px);} }
.hero h1 { font-size: 30px; color: var(--green); }
.hero p { color: var(--gray); font-weight: 600; }
.empty-note { text-align:center; color:var(--gray); font-weight:600; padding: 40px 30px; line-height:2; }

/* ============================================================
   ANIMATIONS — Duolingo-style juice on everything
   ============================================================ */

/* --- core keyframes --- */
/* an entrance that runs before an endless loop on the same element animates the separate scale /
   translate properties, never transform: while a finished entrance on transform stays in the list,
   Chrome will not run the loop on the GPU, and the top bar's flame alone took two thirds of a slow
   phone's main thread on an idle path (2484ms in 4s at 4x; 257ms this way). Same motion */
@keyframes springInS {
  0%   { scale: 0; opacity: 0; }
  60%  { scale: 1.15; opacity: 1; }
  80%  { scale: .94; }
  100% { scale: 1; opacity: 1; }
}
@keyframes springIn {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  80%  { transform: scale(.94); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes bannerIn {
  from { opacity: 0; transform: translateY(-14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes nodeBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
@keyframes shake {
  10%, 50%, 90% { transform: translateX(-7px); }
  30%, 70%      { transform: translateX(7px); }
}
@keyframes selPop {
  0% { transform: scale(.95); } 55% { transform: scale(1.045); } 100% { transform: scale(1); }
}
@keyframes flameDance {
  0%, 100% { transform: rotate(-4deg) scale(1); }
  30%      { transform: rotate(4deg) scale(1.08); }
  60%      { transform: rotate(-2deg) scale(1.02); }
}
@keyframes heartBeat {
  0%, 40%, 100% { transform: scale(1); }
  10% { transform: scale(1.22); }
  25% { transform: scale(1.06); }
}
@keyframes gemSpin {
  0%, 75%, 100% { transform: rotateY(0); filter: brightness(1); }
  85% { transform: rotateY(180deg); filter: brightness(1.35); }
}
@keyframes sweep {
  0%   { transform: translateX(-130%); }
  55%, 100% { transform: translateX(130%); }
}
/* the band is a box 2.2 times the node's width moved by transform, not a background moved by
   background-position: that one repaints every finished node on the main thread on every frame,
   and kept a slow phone's idle path busy 1.5s in every 4 (0.1s this way). The same sweep: from
   background-position -150% to 150% is the band's own 9/11 either side */
@keyframes coinShine {
  0%, 60%  { transform: translateX(81.8182%); }
  90%, 100%{ transform: translateX(-81.8182%); }
}
/* Duolingo's ring breathing (idle loop multi lesson): out to 1.02 of its own
   size and in to .86 x .82 every two seconds, slow to leave each end, fading
   as it pulls in — sizes measured against its coin and carried onto ours */
@keyframes ringIdle {
  0%, 100% { transform: scale(1.131, 1.121); animation-timing-function: cubic-bezier(.8, 0, .85, 1); }
  50%      { transform: scale(.972, .944); animation-timing-function: cubic-bezier(.15, 0, .2, 1); }
}
@keyframes ringDimTrack {        /* Duolingo's ring loop: .89 → .70 at its smallest → 1 at 1450ms → .89, linear */
  0%, 100% { opacity: .89; }
  50%      { opacity: .7; }
  72.5%    { opacity: 1; }
}
@keyframes ringDimArc {
  0%, 100% { opacity: .86; }
  50%      { opacity: .6; }
  72.5%    { opacity: 1; }
}
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes glowPulse {
  0%, 100% { transform: scale(1); opacity: .55; }
  50%      { transform: scale(1.18); opacity: .9; }
}
@keyframes twinkle {
  0%, 100% { transform: scale(.4) rotate(0deg); opacity: 0; }
  50%      { transform: scale(1.15) rotate(40deg); opacity: 1; }
}
@keyframes starRise {
  0%   { transform: scale(0) rotate(-40deg); opacity: 0; }
  60%  { transform: scale(1.25) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes titleIn {
  0%   { transform: scale(.4); opacity: 0; }
  55%  { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes growBar { from { width: 0; } }

/* --- screens --- */
.screen { animation: fadeUp .32s cubic-bezier(.25,1.1,.4,1) both; }

/* --- top stat bar --- */
.stat img { animation: springIn .45s cubic-bezier(.3,1.6,.5,1) backwards; }
.stat-xp img { animation: springInS .45s .08s cubic-bezier(.3,1.6,.5,1) backwards, gemSpin 4.5s 1.5s ease-in-out infinite; }
.stat-streak img { animation: springInS .45s cubic-bezier(.3,1.6,.5,1) backwards, flameDance 2.4s 1s ease-in-out infinite; transform-origin: 50% 85%; }
.stat-hearts img { animation: springInS .45s .16s cubic-bezier(.3,1.6,.5,1) backwards, heartBeat 1.8s 1.2s ease-in-out infinite; }

/* --- unit banners + path --- */
.unit-banner { animation: bannerIn .45s cubic-bezier(.3,1.4,.5,1) backwards; }
.node { animation: springIn .5s cubic-bezier(.3,1.6,.5,1) backwards; animation-delay: var(--d, 0s); }
.path-row .bob { animation: nodeBob 1.8s .8s ease-in-out infinite; }
.node-ring { animation: ringIdle 2s infinite; }
.node-ring .ring-seg { stroke-width: 7; stroke-linecap: round; }
.node-ring .ring-track { stroke: var(--line); animation: ringDimTrack 2s linear infinite; }
.node-ring .ring-arc { animation: ringDimArc 2s linear infinite; }
.node > .nd-shine { display: none; }
.node-done > .nd-shine { /* gold shine sweep, inside the hexagon (the button's last child, over its sign) */
  display: block; position: absolute; inset: 0; pointer-events: none; overflow: hidden;   /* clip-path hides the band but would still let the page scroll to it */
  clip-path: path("M35.5 0 L27.75 0 Q17.75 0 12.53 8.53 L5.22 20.47 Q0 29 5.22 37.53 L12.53 49.47 Q17.75 58 27.75 58 L43.25 58 Q53.25 58 58.47 49.47 L65.78 37.53 Q71 29 65.78 20.47 L58.47 8.53 Q53.25 0 43.25 0 Z");
}
.node-done > .nd-shine::after {
  content: ''; position: absolute; top: 0; left: 0; width: 220%; height: 100%;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.55) 50%, transparent 68%);
  animation: coinShine 3.2s ease-in-out infinite;
}
.node:not(:disabled):hover { filter: brightness(1.05); }
/* Duolingo's press: the face drops the whole lip in one frame while held
   (the settle on release and the ring's select are pathPay's neighbours in app.js) */
/* «a lesson done»: the shadow the coin jumps off (its own lower ellipse, in
   Duolingo's grey) and its three diamonds — both slid in under the coin */
.node-ghost {
  position: absolute; left: 50%; width: 71px; height: 58px; margin-left: -35.5px;
  clip-path: path("M35.5 0 L27.75 0 Q17.75 0 12.53 8.53 L5.22 20.47 Q0 29 5.22 37.53 L12.53 49.47 Q17.75 58 27.75 58 L43.25 58 Q53.25 58 58.47 49.47 L65.78 37.53 Q71 29 65.78 20.47 L58.47 8.53 Q53.25 0 43.25 0 Z"); background: var(--node-ghost); pointer-events: none;
}
.node-dia { position: absolute; top: 0; left: 50%; pointer-events: none; transform: scale(0); }
.node-dia svg { display: block; width: 100%; height: 100%; }

/* --- bottom nav --- */
.navbtn img { transition: transform .12s; height: 28px; width: auto; }
.navbtn:active img { transform: scale(.8); }
.navbtn.active img { animation: springIn .4s cubic-bezier(.3,1.8,.5,1); }

/* --- session / questions --- */
.q-kicker { animation: fadeUp .35s .05s ease backwards; }
.q-stem, .q-figure, .cmp-wrap { animation: fadeUp .4s .12s ease backwards; }
.choice { animation: fadeUp .38s ease backwards; animation-delay: var(--d, 0s); }
.choice.sel { animation: selPop .25s cubic-bezier(.34, 1.56, .64, 1); }
/* .choice.correct's bounce is now the ported GSAP jump — see answerFx() */
.choice.wrong { animation: shake .45s ease; }
.x-btn { transition: transform .15s; }
.x-btn:active { transform: rotate(90deg) scale(.85); }
.progress > i { overflow: hidden; }
.progress > i::before { /* moving shine sweep on the fill */
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  animation: sweep 2.2s ease-in-out infinite;
}
.sess-hearts img { animation: heartBeat 1.8s ease-in-out infinite; }

/* --- buttons --- */
.btn:not(:disabled):hover { filter: brightness(1.05); }
.action-bar .btn { animation: fadeUp .35s .15s ease backwards; }
.feedback .btn { animation: fadeUp .3s .15s ease backwards; }

/* --- feedback sheet --- */
.feedback.show .fb-head img,
.feedback.show .fb-x { animation: springIn .5s .08s cubic-bezier(.3,1.8,.5,1) backwards; }
.feedback.show .fb-head { animation: fadeUp .3s ease backwards; }

/* --- win / complete screen --- */
.win-hero {
  position: relative; width: var(--wh, 150px); height: var(--wh, 150px);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}

/* === lesson-complete scene: the streak flame slams in clean on white,
   then keeps burning — no particles, no rays, just motion === */
/* the flame lands clean now — no screen shake (removed for a smoother feel) */
.flame-hero { display: flex; align-items: center; justify-content: center; }

/* --- the fire itself (exact streak-flame paths from the design icons) --- */
/* wrapper does the cinematic moves (land, then a periodic happy hop) */
.fh-wrap {
  width: 66%; height: 84%; position: relative; z-index: 2;
  transform-origin: 50% 96%;
  will-change: transform; backface-visibility: hidden;
  animation:
    heartLand .65s .15s cubic-bezier(.3,1.5,.5,1) backwards,
    flameHop 3.4s 1.6s ease-in-out infinite;
}
@keyframes flameHop { /* Duolingo-style squash → jump → land bounce */
  0%, 52%, 100% { transform: translateY(0) scale(1); }
  57%  { transform: translateY(3px) scale(1.12, .82); }
  66%  { transform: translateY(-16px) scale(.92, 1.14); }
  74%  { transform: translateY(2px) scale(1.1, .86); }
  82%  { transform: translateY(-4px) scale(.97, 1.05); }
  90%  { transform: translateY(0) scale(1.02, .98); }
}
/* the flame itself flickers continuously on top of the wrapper's moves */
.fh-flame {
  width: 100%; height: 100%; overflow: visible;
  filter: drop-shadow(0 6px 0 rgba(230,120,0,.30));
  transform-origin: 50% 92%;
  will-change: transform; backface-visibility: hidden;
  animation: flameFlick 1.1s .9s ease-in-out infinite;
}
@keyframes flameFlick { /* breathes, leans & licks like real fire */
  0%, 100% { transform: scale(1, 1) rotate(-2deg) skewX(0); }
  20%      { transform: scale(.98, 1.06) rotate(1.4deg) skewX(2deg); }
  40%      { transform: scale(1.03, .96) rotate(-1.2deg) skewX(-1.5deg); }
  60%      { transform: scale(.985, 1.07) rotate(2.2deg) skewX(1deg); }
  80%      { transform: scale(1.015, .98) rotate(-1.6deg) skewX(-2deg); }
}
.fh-inner { /* the yellow inner flame dances on its own beat */
  transform-box: fill-box; transform-origin: 50% 82%;
  will-change: transform;
  animation: innerFlick .85s 1s ease-in-out infinite;
}
@keyframes innerFlick {
  0%, 100% { transform: scale(1); }
  25%      { transform: scale(1.16, .88) rotate(2.5deg); }
  55%      { transform: scale(.9, 1.14) rotate(-2.5deg); }
  80%      { transform: scale(1.08, .94) rotate(1deg); }
}
/* fire sparkles around the flame (no background circle, just stars) */
/* small flame tongues leaping up around the base of the fire */
.fh-lick {
  position: absolute; bottom: 12%; width: 26%; height: 32%;
  opacity: 0; pointer-events: none; z-index: 1;
  transform-origin: 50% 100%;
  animation: lickRise 1.6s ease-out infinite;
}
.fh-lick.fl1 { right: 12%; animation-delay: 1.2s; }
.fh-lick.fl2 { right: 58%; animation-delay: 1.7s; animation-duration: 1.4s; width: 20%; }
.fh-lick.fl3 { right: 30%; animation-delay: 2.1s; animation-duration: 1.8s; width: 17%; }
.fh-lick.fl4 { right: 66%; animation-delay: 2.5s; width: 14%; }
@keyframes lickRise {
  0%   { opacity: 0; transform: translateY(8px) scale(.3) rotate(-6deg); }
  25%  { opacity: .95; }
  60%  { opacity: .55; transform: translateY(calc(var(--wh, 150px) * -.34)) scale(.75) rotate(5deg); }
  100% { opacity: 0; transform: translateY(calc(var(--wh, 150px) * -.55)) scale(.25) rotate(-8deg); }
}
/* embers floating up off the flame, forever */
.fh-ember {
  position: absolute; bottom: 20%; border-radius: 50%;
  opacity: 0; pointer-events: none; z-index: 3;
  animation: emberRise 2s ease-out infinite;
}
@keyframes emberRise {
  0%   { opacity: 0; transform: translate(0, 0) scale(1); }
  12%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0px), calc(var(--wh, 150px) * -.9)) scale(.15); }
}
/* sub-line under the win title */
.win-sub {
  color: var(--gray); font-weight: 600; font-size: 13px; line-height: 1.5;
  margin: 0 0 10px; z-index: 2;
  animation: fadeUp .45s .85s ease backwards;
}
/* gems-earned chip on the win screen */
.win-gems {
  display: inline-flex; align-items: center; gap: 6px; z-index: 2;
  margin: 0 0 14px; padding: 6px 14px; border-radius: 999px;
  background: var(--gold-bg, #FFF4CC); color: #8A6000;   /* was --gold-dk, 2.03:1 */
  font-weight: 800; font-size: 15px;
  animation: fadeUp .45s .7s ease backwards;
}
.win-gems .ic { vertical-align: middle; }
.fail-wallet {
  font-size: 13px; font-weight: 700; color: var(--gray);
  margin: -4px 0 10px; text-align: center; line-height: 1.5;
}
/* gold "revive" button on the fail screen */
.btn-revive { background: var(--gold); box-shadow: 0 5px 0 var(--gold-dk); color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-revive:active { box-shadow: 0 0 0 var(--gold-dk); }
.btn-revive .ic { vertical-align: middle; }
/* blue total-time card on the win screen */
.rc-time .qt-svg { width: 22px; height: 22px; }
.rc-time .rc-v { font-variant-numeric: tabular-nums; }

.win-title {
  background: linear-gradient(100deg, var(--gold-dk) 42%, #FFD84D 50%, var(--gold-dk) 58%);
  background-size: 220% 100%; background-position: 150% 0;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  /* the gradient fill cannot carry contrast on its own — an outline does */
  paint-order: stroke fill;
  filter: drop-shadow(0 1px 0 rgba(170, 112, 0, .55));
  animation:
    titleIn .55s .85s cubic-bezier(.3,1.5,.5,1) backwards,
    titleThrob 2.4s 2s ease-in-out infinite,
    titleShine 2.8s 1.6s linear infinite;
}
@keyframes titleShine { to { background-position: -70% 0; } }
.result-cards .rcard {
  position: relative; overflow: hidden;
  animation:
    springIn .5s cubic-bezier(.3,1.6,.5,1) backwards,
    cardFloat 3.4s ease-in-out 2 forwards;
}
.result-cards .rcard:nth-child(1) { animation-delay: .7s, 2.4s; }
.result-cards .rcard:nth-child(2) { animation-delay: .82s, 2.9s; }
.result-cards .rcard:nth-child(3) { animation-delay: .94s, 3.4s; }
.result-cards .rcard::after { /* glossy sweep */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%);
  transform: translateX(-130%);
  animation: sweep 3.6s 3.2s ease-in-out 1;
}
.win-action .btn {
  position: relative; overflow: hidden;
  animation:
    fadeUp .4s 2.2s ease backwards,
    btnHeartbeat 2s 3.2s ease-in-out infinite;
}
.win-action .btn::after { /* CTA shine sweep */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%);
  transform: translateX(-130%);
  animation: sweep 3s 3.9s ease-in-out infinite;
}

/* --- report / stats bars + tiles --- */
.rb-fill { animation: growBar .9s .2s cubic-bezier(.2,.8,.2,1) backwards; }
.tiles .tile { animation: fadeUp .4s cubic-bezier(.3,1.3,.5,1) backwards; }
.tiles .tile:nth-child(1) { animation-delay: .05s; }
.tiles .tile:nth-child(2) { animation-delay: .12s; }
.tiles .tile:nth-child(3) { animation-delay: .19s; }
.tiles .tile:nth-child(4) { animation-delay: .26s; }
.card { animation: fadeUp .4s .1s ease backwards; }
.review-item { animation: fadeUp .4s ease backwards; }

/* --- popup + modal --- */
/* The node's card grows out of its own arrow, as Duolingo's does: from the arrow's tip, a quick swell
   just past its size and back (300ms), its lines following it in 40ms apart; it leaves the same way,
   shrinking back into the arrow and fading (160ms). Transform and opacity only, so it runs on the GPU. */
.lesson-pop { transform-origin: calc(100% - var(--arrow-x, 50%)) -10px; animation: lpIn .3s cubic-bezier(.22,1.28,.42,1) backwards; }
.lesson-pop > * { animation: lpKid .24s ease-out backwards; }
.lesson-pop > :nth-child(1) { animation-delay: .05s; }
.lesson-pop > :nth-child(2) { animation-delay: .09s; }
.lesson-pop > :nth-child(3) { animation-delay: .13s; }
.lesson-pop > :nth-child(4) { animation-delay: .17s; }
.lesson-pop > :nth-child(5) { animation-delay: .21s; }
.lesson-pop-veil.out { pointer-events: none; }
.lesson-pop-veil.out .lesson-pop { animation: lpOut .16s cubic-bezier(.5,0,.9,.6) forwards; }
@keyframes lpIn { 0% { opacity: 0; transform: scale(.5); } 35% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes lpKid { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes lpOut { to { opacity: 0; transform: scale(.6); } }
:root[data-motion="reduced"] .lesson-pop, :root[data-motion="reduced"] .lesson-pop > * { animation: none; }
.modal { animation: springIn .4s cubic-bezier(.3,1.4,.5,1); }
.modal .m-owl { display: inline-block; animation: starRise .6s .15s cubic-bezier(.3,1.6,.5,1) backwards; }

/* --- boot hero --- */
.hero .win-hero { margin: 0 auto 10px; }
.hero h1 { animation: titleIn .5s .3s cubic-bezier(.3,1.5,.5,1) backwards; }
.hero p { animation: fadeUp .4s .55s ease backwards; }

/* ============================================================
   Exam countdown — setup screen + path-top card
   ============================================================ */
.exam-setup {
  align-items: center; justify-content: center; text-align: center;
  padding: 36px 24px calc(36px + env(safe-area-inset-bottom));
}
.exam-setup .es-hero { animation: titleIn .5s .1s cubic-bezier(.3,1.5,.5,1) backwards; margin-bottom: 6px; }
.es-cal { width: 136px; height: 136px; animation: calBob 3.2s ease-in-out 1s infinite; }
.es-spark { transform-box: fill-box; transform-origin: center; animation: twinkle 2.4s ease-in-out infinite; }
@keyframes calBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.es-halo { animation: haloPulse 1.8s ease-in-out infinite; }
@keyframes haloPulse { 0%, 100% { opacity: 0; } 50% { opacity: .9; } }

.dt-month { flex: 1.5; }

/* --- shared Duolingo bar: 16px r64 track, solid fill, 5px r6 inset
   shine stripe (exact anatomy from the Figma Progress Bar set),
   fill grows 0 → value on appear --- */
@keyframes barGrow { from { width: 0; } }
.duo-bar { height: 16px; border-radius: 64px; background: var(--line); overflow: hidden; }
.duo-bar > i {
  display: block; height: 100%; border-radius: 64px; position: relative;
  background: var(--bar-c, var(--green)); min-width: 9px;
  animation: barGrow .9s cubic-bezier(.25, 1, .4, 1) backwards;
}
.duo-bar > i::after {
  content: ''; position: absolute; top: 4px; right: 8px; left: 8px;
  height: 5px; border-radius: 6px; background: var(--bar-shine, rgba(255,255,255,.45));
}

/* ============================================================
   Daily quest card + chest-opening ceremony
   ============================================================ */
.quest-card {
  background: #fff; border: 2px solid var(--line); border-radius: 16px;
  padding: 14px 16px; margin: 0 16px 18px; position: relative;
  animation: fadeUp .4s .08s cubic-bezier(.3,1.3,.5,1) backwards;
}
.qc-head { display: flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 700; }
.qc-task { font-size: 14px; color: var(--gray); font-weight: 600; margin: 2px 0 10px; }
.qc-barrow { display: flex; align-items: center; gap: 10px; }
.qc-bar { flex: 1; position: relative; height: 18px; }
.qc-count {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; color: var(--gray); letter-spacing: 1px; line-height: 1;
}
.qc-chest { width: 46px; height: 42px; flex-shrink: 0; overflow: visible; }
.qc-chest .ch-glow { opacity: 0; }
.qc-chest .ch-lid, .qc-chest .ch-base { transform-box: fill-box; }

/* nearly done → chest gets excited */
.qc-excited { animation: chestWiggle 1.7s ease-in-out infinite; }
@keyframes chestWiggle {
  0%, 62%, 100% { transform: rotate(0); }
  68% { transform: rotate(-7deg) scale(1.06); }
  76% { transform: rotate(6deg) scale(1.06); }
  84% { transform: rotate(-4deg) scale(1.03); }
  92% { transform: rotate(0) scale(1); }
}

/* quest complete, chest unclaimed → golden glowing card, bouncing chest */
.quest-ready { border-color: var(--gold); cursor: pointer; animation: fadeUp .4s .08s cubic-bezier(.3,1.3,.5,1) backwards, questGlow 1.6s ease-in-out .5s infinite; }
@keyframes questGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,200,0,0); }
  50% { box-shadow: 0 0 0 6px rgba(255,200,0,.22); }
}
.qc-row { display: flex; align-items: center; gap: 12px; }
.qc-txt { flex: 1; }
.qc-txt b { display: block; font-size: 16px; }
.qc-txt span { font-size: 13px; color: var(--gray); font-weight: 600; }
.qc-mini { width: 44px; height: 40px; }
.qc-bounce { animation: chestBounce .9s cubic-bezier(.3,1.6,.4,1) infinite; }
@keyframes chestBounce {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  30% { transform: translateY(-7px) scale(.96, 1.06) rotate(-3deg); }
  55% { transform: translateY(0) scale(1.06, .92); }
  70% { transform: translateY(-2px) scale(1, 1.02); }
}
.qc-tap {
  background: var(--gold); color: #fff; font-weight: 800; font-size: 14px;
  padding: 8px 16px 6px; border-radius: 12px; box-shadow: 0 4px 0 var(--gold-dk);
  animation: tapPulse 1.6s ease-in-out infinite;
}
@keyframes tapPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.quest-claimed { opacity: .92; }
.quest-claimed .qc-chest { filter: saturate(.55) opacity(.8); }
.qc-done-badge {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--green); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 var(--green-lip);
}

/* --- «مراجعة اليوم»: the one card that says the schedule has something ripe --- */
.due-card {
  /* the countdown card's box (.ec2): inset by the same 16px gutters */
  display: flex; align-items: center; gap: 11px; width: calc(100% - 32px); text-align: start;
  background: var(--snow); border: 2px solid var(--line); border-radius: 16px;
  box-shadow: 0 4px 0 var(--line); padding: 11px 14px; margin: 0 16px 14px;
  cursor: pointer; animation: fadeUp .38s .06s cubic-bezier(.25,1.1,.4,1) backwards;
}
.due-card:active { transform: translateY(4px); box-shadow: 0 0 0 var(--line); }
.due-ico { display: flex; width: 38px; height: 38px; border-radius: 50%; background: var(--blue-light); align-items: center; justify-content: center; flex-shrink: 0; }
.due-tx { flex: 1; display: block; }
.due-tx b { display: block; font-size: 15.5px; font-weight: 800; color: var(--ink); }
.due-tx span { display: block; font-size: 13px; font-weight: 700; color: var(--gray); margin-top: 1px; }
.due-go { font-size: 14px; font-weight: 800; color: var(--blue); flex-shrink: 0; }

/* --- stats before the first answer --- */
.stats-empty { text-align: center; }
.stats-empty .se-ico {
  display: inline-flex; width: 64px; height: 64px; border-radius: 50%;
  background: var(--blue-light); align-items: center; justify-content: center; margin-bottom: 10px;
}
.stats-empty b { display: block; font-size: 17.5px; font-weight: 800; color: var(--ink); }
.stats-empty p { font-size: 13.5px; font-weight: 600; color: var(--gray); line-height: 1.7; margin: 6px 0 15px; }
.stats-empty .btn { max-width: 268px; margin-inline: auto; }

/* --- what a press feels like on the controls that had nothing ---
   Every button in this app sinks into its own lip when pressed. These three
   were tapped as often as any of them and answered with nothing at all: the
   mock's question chips, the "show me the solution" link, and the settings
   rows. */
.qn-chip { transition: background .15s, border-color .15s, color .15s, transform .06s; }
.qn-chip:active { transform: translateY(2px) scale(.94); }
/* Two separate actions that read as one sentence: the toggles carry no
   horizontal padding, so on the review card «أظهر الإجابة» and «اعرض الحل»
   ran together under one unbroken underline. They get a row of their own, a
   gap, a hairline between them, and the colour the rest of the app gives a
   link — and both panels now open under the pair instead of between them. */
.ri-acts { display: flex; align-items: center; gap: 19px; margin-top: 2px; }
.ri-acts .fb-solution-toggle { color: var(--blue-dk); font-size: 14.5px; }
.ri-acts .fb-solution-toggle + .fb-solution-toggle { position: relative; }
.ri-acts .fb-solution-toggle + .fb-solution-toggle::before {
  content: ""; position: absolute; inset-inline-start: -10px; top: 50%;
  width: 2px; height: 13px; margin-top: -7px; border-radius: 2px; background: var(--line);
}
.fb-solution-toggle { transition: opacity .12s; }
.fb-solution-toggle:active { opacity: .55; }
.set-item.set-link:active { background: var(--surface-hover); }

/* A mouse is not a finger: it hovers, and until now nothing moved under it.
   Only where there is a real pointer — a touch screen reports hover as sticky
   and would leave a button lit after the tap. A node is still hovered while
   the mouse presses it, so its lift stands aside for the press. */
@media (hover: hover) and (pointer: fine) {
  .btn:not(:disabled):hover { filter: brightness(1.04); }
  .node:not(:disabled):not(:active):not(.down):hover { transform: translateY(-2px); box-shadow: 0 9px 0 var(--node-s, var(--purple-dk)); }
  .qn-chip:hover:not(.cur) { border-color: var(--blue-border); }
  .set-item.set-link:hover, .due-card:hover, .ec2:hover, .dom-stat:hover,
  .rank-card:hover, .mistakes-card:hover, .rp-opt:hover { background: var(--surface-hover); }
  .fb-solution-toggle:hover { opacity: .8; }
}

/* --- the path arrives as you reach it ---
   Twenty-six nodes used to be simply there, the whole column painted before the
   student had scrolled to any of it. A node below the fold now rises as it
   comes into view, once, and never the one that is bobbing — that node owns its
   own animation and two on one element cancel each other. */
.node-col.veil { opacity: 0; }
.node-col.rise { animation: nodeRise .5s cubic-bezier(.25, 1.1, .4, 1) both; }
@keyframes nodeRise {
  from { opacity: 0; transform: translateY(20px) scale(.94); }
  to   { opacity: 1; transform: none; }
}
:root[data-motion="reduced"] .node-col.veil { opacity: 1; }
:root[data-motion="reduced"] .node-col.rise { animation: none; }

/* --- the one place the OS preference is allowed to speak --- */
.set-hint {
  margin: 6px 14px 0; font-size: 12.5px; font-weight: 600; color: var(--gray); line-height: 1.6;
}

/* --- losing the network: a note, not an alarm --- */
.net-bar {
  position: fixed; right: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 10px);
  width: calc(100% - 28px); max-width: 402px; z-index: 337;
  display: flex; flex-direction: column; gap: 2px; text-align: center;
  padding: 11px 16px 10px; border-radius: 16px;
  background: #FFF1DB; border: 2px solid #FFD08A; color: #8A5300;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .1);
  transform: translate(50%, 160%); transition: transform .32s cubic-bezier(.25, 1.1, .4, 1);
}
.net-bar.show { transform: translate(50%, 0); }
.net-bar b { font-size: 14.5px; font-weight: 800; }
.net-bar span { font-size: 12.5px; font-weight: 600; line-height: 1.5; }
:root[data-motion="reduced"] .net-bar { transition: none; }
/* the note sits over the tab bar's gap: on a screen without the tab bar (a lesson, a win) it would cover the action, so it waits (QA, 2026-11-08) */
body:not(:has(.bottomnav)) .net-bar { display: none; }

/* --- a streak about to break, and the three-way goal segment --- */
.due-card.due-risk { border-color: var(--orange); box-shadow: 0 4px 0 #E07D00; }
.due-card.due-risk .due-ico { background: #FFF1DB; }
.due-card.due-risk .due-go { color: #E07D00; }

/* --- what the exam date asks of them, inside the countdown card --- */
.ec2-plan { font-size: 12px; font-weight: 700; color: var(--gray); line-height: 1.5; }
.ec2-urgent .ec2-plan, .ec2-today .ec2-plan { color: var(--tone-ink); opacity: .85; }

/* --- the week they actually had, from S.days --- */
.week-card h3 { margin-bottom: 14px; }
.wk-bars { display: flex; align-items: flex-end; gap: 8px; height: 76px; }
.wk-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; }
.wk-track { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--line); border-radius: 7px; overflow: hidden; }
.wk-track > i {
  display: block; width: 100%; min-height: 3px; border-radius: 7px; background: var(--blue);
  animation: wkGrow .55s var(--d) cubic-bezier(.25,1.1,.4,1) backwards;
}
@keyframes wkGrow { from { height: 0 !important; } }
.wk-col:last-child .wk-track > i { background: var(--blue-dk); }
.wk-day { font-size: 12px; font-weight: 800; color: var(--gray-icon); }
.wk-day.on { color: var(--blue-dk); }
.wk-line { margin: 13px 0 0; font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.6; }
:root[data-motion="reduced"] .wk-track > i { animation: none; }

/* --- reporting a question ---
   The sheet behind this link is pink, not red: white text on it is a ghost. It
   takes the same ink as the sheet's other secondary action. */
.fb-report {
  display: block; width: 100%; margin: 0 0 8px; padding: 7px 0;
  background: none; border: 0; font-family: inherit; font-size: 13.5px; font-weight: 700;
  color: var(--red-dk2); opacity: .78; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.fb-report:active { opacity: .5; }
.rp-clear {
  width: 100%; margin-top: 2px; padding: 8px 0; background: none; border: 0;
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--gray);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.rp-clear:active { color: var(--red-dk2); }
.bk-sheet .bk-code.bk-ar { font: 700 13px/1.9 var(--font); word-break: normal; text-align: start; }
.rp-list { display: flex; flex-direction: column; gap: 9px; margin: 4px 0 14px; }
.rp-opt {
  text-align: start; padding: 12px 14px; font-family: inherit; font-size: 14.5px; font-weight: 700;
  color: var(--ink); background: var(--snow); border: 2px solid var(--line);
  border-bottom-width: 3px; border-radius: 14px; cursor: pointer;
  transition: background-color .14s, border-color .14s, transform .06s;
}
.rp-opt:active { transform: translateY(2px); border-bottom-width: 2px; }
.rp-opt.on { border-color: var(--blue-border); background: var(--blue-light); color: var(--blue-dk); }
.rp-note { font-size: 12.5px; font-weight: 600; color: var(--gray); line-height: 1.7; margin: 0 0 14px; }

/* --- the two first-run choices: the track, and whether to test out --- */
.tp-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 20px calc(28px + env(safe-area-inset-bottom)); }
.po-badge {
  display: flex; width: 108px; height: 108px; border-radius: 50%; margin-bottom: 14px;
  background: var(--blue-light); align-items: center; justify-content: center;
}
.po-badge.pop { animation: mascotPop .42s cubic-bezier(.3,1.6,.5,1) backwards; }
@media (max-height: 700px) { .po-badge { width: 84px; height: 84px; margin-bottom: 10px; } }

/* --- the placement result: one row per unit, with what it scored --- */
.place-list { width: 100%; max-width: 340px; margin: 6px auto 2px; }
.place-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px; margin-bottom: 8px;
  background: var(--snow); border: 2px solid var(--line); border-radius: 14px;
  animation: fadeUp .36s var(--d, .1s) cubic-bezier(.25,1.1,.4,1) backwards;
}
.place-row.ok { border-color: var(--green); background: var(--green-bg); }
.place-row .pl-ic { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; color: var(--green-lip); font-weight: 800; flex-shrink: 0; }
.place-row .pl-ic svg { width: 16px; height: 16px; }
.place-row .pl-tx { flex: 1; font-size: 14.5px; font-weight: 700; color: var(--ink); text-align: start; }
.place-row .pl-sc { font-size: 14px; font-weight: 800; color: var(--gray); }
.place-row.ok .pl-sc { color: var(--green-lip); }

/* --- a lesson last practised a fortnight ago: its stars dim and it asks for a pass --- */
.node-col.stale .node-stars { opacity: .4; }
.node-col.stale .node-refresh {
  position: absolute; top: -2px; inset-inline-start: -2px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--blue); color: #fff; border: 2px solid var(--snow);
  display: flex; align-items: center; justify-content: center; z-index: 4;
  animation: springIn .4s cubic-bezier(.3,1.5,.5,1) backwards;
}
.node-col.stale .node-refresh svg { width: 12px; height: 12px; display: block; }

/* --- the win screen's three stars: they land one after another, and the earned ones
   carry the gold lip the path's node uses --- */
.win-stars { display: flex; justify-content: center; gap: 10px; margin: 2px 0 6px; }
.wstar { display: block; width: 44px; height: 44px; transform: scale(0); animation: wstarPop .46s cubic-bezier(.3,1.6,.45,1) var(--d) forwards; }
.wstar svg { display: block; width: 100%; height: 100%; }
.wstar svg path { fill: var(--line); stroke: var(--line); }
.wstar.on svg path { fill: var(--gold); stroke: var(--gold); }
.wstar.on { filter: drop-shadow(0 3px 0 var(--gold-dk)); }
@keyframes wstarPop {
  0%   { transform: scale(0) rotate(-38deg); }
  62%  { transform: scale(1.22) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}
.win-again { margin-top: 10px; }
:root[data-motion="reduced"] .wstar { animation: none; transform: scale(1); }

/* --- the question counter, above the question --- */
.screen-session .q-count { margin: 2px 0 -2px; font-size: 13.5px; font-weight: 700; color: var(--gray-icon); text-transform: none; }

/* --- the progress-backup sheet: the standard bottom sheet with a code field --- */
.bk-sheet .bk-code {
  width: 100%; box-sizing: border-box; margin: 4px 0 10px;
  font: 600 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink); background: #F7F7F7;
  border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px;
  resize: none; word-break: break-all; -webkit-user-select: all; user-select: all;
}
.bk-sheet .bk-code:focus { outline: none; border-color: var(--blue-border); background: var(--snow); }
.bk-sheet .bk-sum { font-size: 13px; font-weight: 700; color: var(--gray); margin: 0 0 12px; }
.bk-sheet .bk-msg { font-size: 13.5px; font-weight: 700; min-height: 18px; margin: 0 0 10px; }
.bk-sheet .bk-msg.bad { color: var(--red); }
.bk-sheet .bk-msg.ok { color: var(--green-lip); }
.bk-sheet .btn.bk-done { background: var(--green); box-shadow: 0 5px 0 var(--green-lip); }

/* --- the held mock exam, offered back on the mock home --- */
.mock-resume {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: start;
  background: var(--blue-light); border: 2px solid var(--blue-border); border-radius: 16px;
  box-shadow: 0 4px 0 var(--blue-border); padding: 13px 15px; margin: 0 0 14px;
  cursor: pointer; animation: springIn .42s cubic-bezier(.3,1.5,.5,1);
}
.mock-resume:active { transform: translateY(4px); box-shadow: 0 0 0 var(--blue-border); }
.mock-resume .mr-tx { flex: 1; display: block; }
.mock-resume b { display: block; font-size: 15.5px; font-weight: 800; color: var(--blue-dk); }
.mock-resume .mr-tx span { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.mock-resume .mr-go { color: var(--blue-dk); flex-shrink: 0; }
.mock-resume .mr-go svg { width: 20px; height: 20px; display: block; }

/* --- the ceremony overlay: a 480×1044 stage scaled to the viewport, so the
   measured hop, comet and open land the same on every phone --- */
.chest-veil {
  position: fixed; inset: 0; z-index: 350; background: var(--snow);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
  animation: veilIn .35s ease;
}
.chest-veil.out { animation: veilOut .35s ease forwards; }
@keyframes veilIn { from { opacity: 0; } }
@keyframes veilOut { to { opacity: 0; } }
.cv-stage { position: relative; width: 480px; height: 1044px; flex-shrink: 0; overflow: hidden; transform-origin: 50% 50%; color: var(--ink); }
.cv-scr { position: absolute; inset: 0; background: var(--snow); visibility: hidden; }
.cv-scr.on { visibility: visible; }
.cv-chest { cursor: pointer; }
.cv-ttl {
  position: absolute; top: 222px; left: 0; right: 0; margin: 0; text-align: center;
  font-size: 26px; font-weight: 800; color: var(--chest); line-height: 1.2; transition: opacity .22s ease;
}
.cv-ttl.hide { opacity: 0; }

/* the chest lives in a 260×290 box; its plate's bottom is the floor */
.cv-wrap { position: absolute; left: 110px; top: 285px; width: 260px; height: 290px; z-index: 2; }
.cv-body { position: absolute; inset: 0; transform-origin: 50% 98%; will-change: transform; }
.cv-plate { position: absolute; left: 15px; top: 235px; width: 232px; height: 46px; border-radius: 14px; background: var(--line); }
.cv-box { position: absolute; inset: 0; will-change: transform; }
.cv-box svg { position: absolute; left: 0; top: 0; width: 260px; height: 290px; overflow: visible; }
.cv-box svg.open { display: none; }
.opened .cv-box svg.closed { display: none; }
.opened .cv-box svg.open { display: block; }

/* light pouring out of the open chest: a soft pool at the mouth + a cone */
.cv-glow {
  position: absolute; left: 130px; top: 150px; width: 320px; height: 240px; transform: translate(-50%,-50%);
  background: radial-gradient(closest-side, rgba(255,255,255,.95), rgba(255,255,255,.55) 42%, rgba(255,255,255,0) 100%);
  opacity: 0; pointer-events: none; z-index: 3;
}
.cv-cone {
  position: absolute; left: 130px; bottom: 130px; width: 380px; height: 560px; transform: translateX(-50%);
  clip-path: polygon(32% 100%, 68% 100%, 100% 0, 0 0);
  background: linear-gradient(to top, rgba(255,240,190,.5), rgba(255,240,190,.22) 40%, rgba(255,240,190,0) 100%);
  opacity: 0; pointer-events: none; z-index: 1;
}
.opened .cv-glow { animation: cvGlowIn .25s ease-out forwards; }
.opened .cv-cone { animation: cvConeIn .3s ease-out forwards, cvConePulse 1.1s ease-in-out .3s infinite; }
@keyframes cvGlowIn { to { opacity: 1; } }
@keyframes cvConeIn { to { opacity: 1; } }
@keyframes cvConePulse { 0%, 100% { opacity: 1; } 50% { opacity: .78; } }

/* idle sparkles ringing the chest */
.cv-sparks { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.cv-sp { position: absolute; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); opacity: 0; animation: cvTwinkle var(--d) ease-in-out var(--o) infinite; }
.cv-sp svg { display: block; width: 100%; height: 100%; }
@keyframes cvTwinkle {
  0%, 100% { opacity: 0; transform: scale(.25) rotate(-12deg) translateY(4px); }
  45%      { opacity: 1; transform: scale(1) rotate(8deg) translateY(-2px); }
  70%      { opacity: .9; transform: scale(.92) rotate(14deg) translateY(-6px); }
}

/* burst stars and rising motes at the pop */
.cv-fx { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.cv-burst { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; animation: cvBurst .46s cubic-bezier(.2,.8,.3,1) var(--o) both; }
.cv-burst svg { display: block; width: 100%; height: 100%; }
@keyframes cvBurst {
  0%   { opacity: 0; transform: translate(0,0) scale(0) rotate(0); }
  35%  { opacity: 1; transform: translate(calc(var(--dx) * .7), calc(var(--dy) * .7)) scale(1.25) rotate(20deg); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.4) rotate(45deg); }
}
.cv-mote { position: absolute; width: 10px; height: 26px; margin: -13px 0 0 -5px; animation: cvMote var(--d) cubic-bezier(.15,.7,.3,1) both; }
.cv-mote svg { display: block; width: 100%; height: 100%; }
@keyframes cvMote {
  0%   { opacity: 0; transform: translateY(0) scale(.5); }
  12%  { opacity: 1; transform: translateY(calc(var(--dy) * .12)) scale(1); }
  75%  { opacity: .9; }
  100% { opacity: 0; transform: translateY(var(--dy)) scale(.55); }
}

/* the comet arc that orbits the chest on every tap */
.cv-arc { position: absolute; left: 0; top: 0; width: 480px; height: 1044px; pointer-events: none; z-index: 5; }

/* three chances: pale discs with an arrow; the live one is dark and hovers over its shadow */
.cv-dots { position: absolute; top: 676px; left: 0; right: 0; height: 70px; display: flex; justify-content: center; gap: 38px; transition: opacity .28s ease; }
.cv-dots.hide { opacity: 0; }
.cv-dot { position: relative; width: 44px; height: 44px; }
.cv-dot i {
  position: absolute; inset: 0; border-radius: 50%; background: var(--chest-dot);
  display: flex; align-items: center; justify-content: center; transition: background .12s ease;
}
.cv-dot i svg { width: 22px; height: 22px; }
.cv-dot i svg path { stroke: #fff; }
.cv-dot .sh { position: absolute; left: 9px; right: 9px; bottom: -14px; height: 8px; border-radius: 50%; background: var(--line); opacity: 0; transition: opacity .15s; }
.cv-dot.active i { background: var(--chest); animation: cvDotBob 1.1s ease-in-out infinite; }
.cv-dot.active .sh { opacity: 1; animation: cvDotShade 1.1s ease-in-out infinite; }
.cv-dot.active.pop i { animation: cvDotPop .18s cubic-bezier(.3,1.6,.5,1), cvDotBob 1.1s ease-in-out .18s infinite; }
.cv-dot.used i svg { display: none; }
@keyframes cvDotBob   { 0%, 100% { transform: translateY(-8px); } 50% { transform: translateY(-11px); } }
@keyframes cvDotShade { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.85); opacity: .8; } }
@keyframes cvDotPop   { 0% { transform: translateY(-8px) scale(.7); } 100% { transform: translateY(-8px) scale(1); } }

.cv-cap { position: absolute; top: 782px; left: 0; right: 0; height: 40px; text-align: center; font-size: 20px; font-weight: 700; color: var(--ink); }
.cv-cap span { position: absolute; left: 0; right: 0; top: 0; transition: opacity .16s ease; }
.cv-cap span.hide { opacity: 0; }

/* the white wash that sweeps down over the open chest */
.cv-wash {
  position: absolute; left: 0; right: 0; top: 0; height: 1044px; pointer-events: none; z-index: 8;
  background: linear-gradient(to bottom, #fff 0%, #fff 62%, rgba(255,255,255,0) 100%);
  transform: translateY(-110%);
}
.cv-wash.go { transition: transform .45s linear; transform: translateY(0); }

/* the reward: the pile of gems, the counter ticking up, the title and the button */
.cv-counter { position: absolute; top: 82px; left: 22px; display: flex; align-items: center; gap: 6px; direction: rtl; font-size: 16px; font-weight: 800; color: var(--blue); }
.cv-counter svg { width: 20px; height: 22px; }
.cv-counter.bump { animation: cvBump .22s cubic-bezier(.3,1.5,.5,1); }
@keyframes cvBump { 50% { transform: scale(1.18); } }
.cv-rtitle { position: absolute; top: 286px; left: 0; right: 0; margin: 0; text-align: center; font-size: 26px; font-weight: 800; color: var(--blue); opacity: 0; transition: opacity .28s ease; }
.cv-reward.told .cv-rtitle { opacity: 1; }
.cv-pile { position: absolute; left: 240px; top: 640px; width: 0; height: 0; --gs: 56px; }
.cv-pshadow { position: absolute; left: -190px; top: 18px; width: 380px; height: 30px; border-radius: 50%; background: var(--line); transform: scale(0); transition: transform .3s cubic-bezier(.3,1.4,.5,1); }
.cv-reward.piled .cv-pshadow { transform: scale(1); }
.cv-gem { position: absolute; width: var(--gs); height: var(--gs); margin: calc(var(--gs) / -2) 0 0 calc(var(--gs) / -2); transform: scale(0) rotate(var(--r)); }
.cv-gem svg { display: block; width: 100%; height: 100%; }
.cv-gem.pop { animation: cvGemPop .3s cubic-bezier(.3,1.5,.5,1) var(--o) forwards; }
.cv-gem.jig { animation: cvGemJig .32s cubic-bezier(.3,1.3,.5,1) var(--o) both; }
@keyframes cvGemPop { 0% { transform: scale(0) rotate(var(--r)); } 100% { transform: scale(1) rotate(var(--r)); } }
@keyframes cvGemJig { 0% { transform: scale(1) translateY(0) rotate(var(--r)); } 40% { transform: scale(1.1) translateY(-14px) rotate(var(--r)); } 100% { transform: scale(1) translateY(0) rotate(var(--r)); } }
.cv-foot { position: absolute; left: 20px; right: 20px; bottom: 84px; opacity: 0; transition: opacity .3s ease; }
.cv-reward.told .cv-foot { opacity: 1; }
.cv-reward:not(.told) .cv-foot { pointer-events: none; }
.cv-btn { height: 56px; border-radius: 16px; font-size: 17px; text-transform: none; letter-spacing: 0; background: var(--blue); box-shadow: 0 4px 0 var(--blue-dk); }
.cv-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--blue-dk); }

/* reduced motion: the pile is simply there */
:root[data-motion="reduced"] .chest-veil,
:root[data-motion="reduced"] .chest-veil * { animation: none !important; transition: none !important; }
:root[data-motion="reduced"] .cv-gem { transform: scale(1) rotate(var(--r)); }
:root[data-motion="reduced"] .cv-pshadow { transform: scale(1); }

/* --- daily chest lives in the statbar (Duolingo toolbar style) --- */
.stat-chest {
  position: relative; background: none; border: 0; padding: 0 6px;
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.stat-chest .sc-chest { width: 40px; height: 37px; overflow: visible; }
.stat-chest .ch-glow { opacity: 0; }
.sc-pill {
  margin-top: -7px; z-index: 1;
  font-size: 10.5px; font-weight: 800; line-height: 1;
  padding: 3px 8px 2px; border-radius: 64px;
  background: #fff; border: 1.5px solid var(--line); color: var(--gray);
  letter-spacing: .5px;
}
.sc-open { background: var(--gold); border-color: var(--gold-dk); color: #fff; animation: tapPulse 1.5s ease-in-out infinite; }
.sc-done { background: var(--green); border-color: var(--green-lip); display: flex; align-items: center; padding: 2.5px 7px; }
.stat-chest.claimed .sc-chest { filter: saturate(.5) opacity(.75); }
.stat-chest.ready { animation: questGlowSoft 1.6s ease-in-out infinite; border-radius: 14px; }
@keyframes questGlowSoft {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255,200,0,0)); }
  50% { filter: drop-shadow(0 0 8px rgba(255,200,0,.75)); }
}
.stat-chest:active .sc-chest { transform: scale(.92); }

/* --- floating daily chest (bottom corner of the path, rides the scroll) --- */
/* Duolingo's «back to my lesson» card (pathFabCheck): white on its grey rim and
   lip, the blue arrow; it appears at once and shrinks away in 200ms */
.path-fab {
  position: fixed; bottom: calc(var(--nav-h) + 16px); right: max(16px, calc(50% - 215px + 16px)); z-index: 41;
  display: grid; place-items: center; width: 52px; height: 52px; padding: 0; box-sizing: border-box;
  background: var(--snow); border: 2px solid var(--line); border-radius: 14px; box-shadow: 0 4px 0 var(--line);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transform: scale(0); pointer-events: none; transition: transform .2s ease;
}
.path-fab.on { transform: none; pointer-events: auto; transition: none; }
.path-fab:active { transform: translateY(4px); box-shadow: 0 0 0 var(--line); }
.path-fab svg { width: 20px; height: 24px; fill: none; stroke: var(--blue); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.path-fab.down svg { transform: rotate(180deg); }
:root[data-motion="reduced"] .path-fab { transition: none; }
.chest-float {
  position: fixed; bottom: calc(var(--nav-h) + 12px); left: 14px; z-index: 40;
  background: none; border: 0; padding: 4px;
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  animation: fadeUp .45s .25s cubic-bezier(.3,1.3,.5,1) backwards;
}
.chest-float .cf-chest {
  width: 66px; height: 62px; overflow: visible;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,.13));
}
.chest-float .ch-glow { opacity: 0; }
.chest-float:active .cf-chest { transform: scale(.92); }
.chest-float.ready { animation: fadeUp .45s .25s cubic-bezier(.3,1.3,.5,1) backwards; }
/* the ready chest knocks (floatingQuest): one 2.6s cycle — crouch, jump, the lid
   pops a crack with the light inside, two gems hop out and fall back, a squash
   on the landing that the badge and the button beat on */
.cf-box { position: relative; display: block; }
.chest-float.ready .cf-chest { width: 72px; height: 68px; transform-origin: 50% 100%; animation: cfHop 2.6s cubic-bezier(.45,0,.55,1) infinite; }
.cf-hop .ch-lid { transform-box: view-box; transform-origin: 130px 225px; animation: cfLid 2.6s ease-in-out infinite; }
.cf-light { fill: #FFF3B0; opacity: 0; animation: cfShine 2.6s ease-in-out infinite; }
@keyframes cfHop {
  0%, 62%, 100% { transform: translateY(0) scale(1, 1); }
  8%  { transform: translateY(0) scale(1.1, .86); }
  15% { transform: translateY(-14px) scale(.93, 1.09); }
  24% { transform: translateY(-20px) scale(1, 1); }
  33% { transform: translateY(-14px) scale(1, 1); }
  40% { transform: translateY(0) scale(1.12, .86); }
  47% { transform: translateY(-3px) scale(.97, 1.04); }
  54% { transform: translateY(0) scale(1.02, .98); }
}
@keyframes cfLid {
  0%, 12%, 40%, 100% { transform: none; }
  20%, 30% { transform: translateY(-58px) rotate(-4deg); }
}
@keyframes cfShine { 0%, 13%, 39%, 100% { opacity: 0; } 19%, 31% { opacity: 1; } }
.cf-gem { position: absolute; left: 50%; top: 34%; width: 16px; height: 21px; margin-left: -8px; opacity: 0; z-index: 2; pointer-events: none; }
.cf-gem svg { display: block; width: 100%; height: 100%; }
.cf-g1 { animation: cfGem1 2.6s ease-in-out infinite; }
.cf-g2 { animation: cfGem2 2.6s ease-in-out infinite; }
@keyframes cfGem1 {
  0%, 17% { opacity: 0; transform: translate(0, -4px) rotate(0) scale(.5); }
  20% { opacity: 1; }
  27% { transform: translate(-17px, -40px) rotate(-25deg) scale(1); opacity: 1; }
  37% { transform: translate(-6px, -6px) rotate(-40deg) scale(.8); opacity: 1; }
  40%, 100% { transform: translate(0, 8px) rotate(-40deg) scale(.5); opacity: 0; }
}
@keyframes cfGem2 {
  0%, 18% { opacity: 0; transform: translate(0, -4px) rotate(0) scale(.5); }
  21% { opacity: 1; }
  28% { transform: translate(15px, -34px) rotate(22deg) scale(.9); opacity: 1; }
  37% { transform: translate(5px, -6px) rotate(36deg) scale(.75); opacity: 1; }
  40%, 100% { transform: translate(0, 8px) rotate(36deg) scale(.5); opacity: 0; }
}
.cf-badge {
  position: absolute; top: 2px; right: -4px; z-index: 3; min-width: 24px; height: 24px; padding: 2px 6px 0; box-sizing: border-box;
  border-radius: 12px; background: var(--red); border: 2px solid var(--snow); color: var(--snow);
  font-size: 14px; font-weight: 800; line-height: 18px; text-align: center;
  animation: cfBeat 2.6s ease-out infinite;
}
.cf-open {
  position: relative; margin-top: 6px; padding: 5px 14px 3px; border-radius: 12px;
  background: var(--gold); box-shadow: 0 4px 0 var(--gold-dk); color: var(--snow);
  font-size: 17px; font-weight: 800; line-height: 1.2; white-space: nowrap; text-shadow: 0 1px 0 rgba(170, 87, 42, .35);
  animation: cfBeat 2.6s ease-out infinite;
}
@keyframes cfBeat { 0%, 40%, 62%, 100% { transform: scale(1); } 46% { transform: scale(1.16); } 54% { transform: scale(.96); } }
.chest-float.ready:active .cf-open { transform: translateY(4px); box-shadow: none; animation: none; }
:root[data-motion="reduced"] .chest-float.ready .cf-chest, :root[data-motion="reduced"] .cf-hop .ch-lid, :root[data-motion="reduced"] .cf-light,
:root[data-motion="reduced"] .cf-gem, :root[data-motion="reduced"] .cf-badge, :root[data-motion="reduced"] .cf-open { animation: none; }
.chest-float.claimed .cf-chest { filter: saturate(.5) opacity(.78) drop-shadow(0 4px 0 rgba(0,0,0,.08)); }
.sc-done svg { width: 12px; height: 12px; color: #fff; display: block; }
/* the chest's speech bubble: the path's node tip, white with the grey line and a tail, sitting over the chest */
.chest-tip {
  position: absolute; left: -8px; bottom: calc(100% - 3px); z-index: 6;
  background: #fff; color: var(--ink); border: 2px solid var(--line); border-radius: 18px;
  padding: 11px 18px 10px; font-size: 15px; font-weight: 700; line-height: 1.3; white-space: nowrap; text-align: right;
  transform-origin: 14% 100%; pointer-events: none;
  animation: chestTipInS .32s cubic-bezier(.3,1.6,.5,1), chestTipFloat 1.6s ease-in-out .32s infinite;
}
.chest-tip b { color: var(--chest); font-weight: 800; }
/* the tail: a drawn curve hung from the padding box — its white covers the bubble's line, its own outline
   flares out of that line and rounds to a soft tip over the chest */
.chest-tip .ct-tail { position: absolute; top: 100%; left: 29px; width: 32px; height: 19px; display: block; stroke: var(--line); }
.chest-tip.out { animation: chestTipOut .22s ease forwards; }
@keyframes chestTipIn { from { opacity: 0; transform: scale(.6); } }
@keyframes chestTipInS { from { opacity: 0; scale: .6; } }   /* beside chestTipFloat: see springInS */
@keyframes chestTipOut { to { opacity: 0; transform: translateY(6px) scale(.9); } }
@keyframes chestTipFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
:root[data-motion="reduced"] .chest-tip { animation: none; }

/* the quest card: white with the grey line and a lip, dropping in from the top of the lesson when the
   tenth answer completes the day; the chest bounces once the bar has filled */
.quest-banner {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 12px; right: 12px; z-index: 70;
  display: flex; justify-content: center; pointer-events: none;
  animation: qbIn .55s cubic-bezier(.3,1.4,.5,1);
}
.quest-banner.out { animation: qbOut .38s ease-in forwards; }
@keyframes qbIn { from { transform: translateY(-150%); } }
@keyframes qbOut { to { transform: translateY(-150%); opacity: 0; } }
.qb-card {
  width: 100%; max-width: 406px; background: #fff; border: 2px solid var(--line); border-radius: 16px;
  box-shadow: 0 4px 0 var(--line); padding: 12px 14px; display: flex; align-items: center; gap: 12px; direction: rtl;
}
.qb-chest { width: 54px; height: 50px; flex-shrink: 0; overflow: visible; }
.qb-chest .ch-glow { opacity: 0; }
.quest-banner.full .qb-chest { animation: chestBounce .9s cubic-bezier(.3,1.6,.4,1) 2; }
.qb-txt { flex: 1; min-width: 0; text-align: right; }
.qb-txt b { display: block; font-size: 16px; font-weight: 800; color: var(--ink); line-height: 1.25; }
.qb-txt span { display: block; font-size: 13px; font-weight: 700; color: var(--gray); margin-top: 2px; }
.qb-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.qb-bar .duo-bar { flex: 1; height: 14px; }
.qb-bar .duo-bar > i { animation: none; transition: width .55s cubic-bezier(.3,1,.4,1); }
.qb-bar em { font-style: normal; font-size: 13px; font-weight: 800; color: var(--gold-dk); min-width: 36px; text-align: left; }
:root[data-motion="reduced"] .quest-banner, :root[data-motion="reduced"] .qb-chest { animation: none; }
:root[data-motion="reduced"] .qb-bar .duo-bar > i { transition: none; }

/* ============================================================
   Mock exam (محاكاة الاختبار)
   ============================================================ */
.mock-hero-card {
  background: #fff; border: 2px solid var(--line); border-radius: 16px;
  padding: 18px 16px 16px; margin-bottom: 14px; text-align: center;
  animation: fadeUp .4s cubic-bezier(.3,1.3,.5,1) backwards;
}
.mh-rules { text-align: right; margin: 10px 2px 16px; }
.mh-rule {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px; color: var(--ink);
  padding: 7px 2px;
}
.mh-rule + .mh-rule { border-top: 1.5px solid #F1F1F1; }
.mh-x { color: var(--red); font-weight: 800; width: 20px; text-align: center; }
.mock-first-note { font-size: 14.5px; font-weight: 600; color: var(--gray); line-height: 1.9; }
/* 25 minutes does not need a second-by-second bar - the number is the
   information. A pill also survives the compact per-question ring above. */
.mock-timer {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--blue-light); color: var(--blue-dk);
  border-radius: 999px; padding: 7px 14px 5px;
  font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums;
  transition: background .3s, color .3s;
}
.frac { unicode-bidi: isolate; }
/* a fraction as the exam prints it: the top number over a bar over the bottom one (fracs() in app.js) */
.fr { display: inline-flex; flex-direction: column; align-items: stretch; vertical-align: middle; position: relative;
  font-size: .82em; line-height: 1.08; text-align: center; margin: 0 .12em; unicode-bidi: isolate; white-space: nowrap; }
.fr-n { padding: 0 .22em .08em; border-bottom: .11em solid currentColor; }
.fr-d { padding: .1em .22em 0; }
.pw { font-size: .6em; line-height: 0; vertical-align: .62em; margin-inline-start: .04em; }
sub.pw { vertical-align: -.3em; }
.fr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mock-timer .mk-clock { display: flex; width: 19px; height: 19px; }
.mock-timer .mk-clock svg { width: 100%; height: 100%; }
.mock-timer.low  { background: var(--orange-bg); color: var(--orange); }
.mock-timer.crit { background: var(--red-bg); color: var(--red-dk2); animation: numPop 1s ease infinite; }
.mock-count { font-weight: 800; font-size: 15px; color: var(--gray); white-space: nowrap; }
.mock-result .result-cards { width: 100%; }
.mock-result .rcard .rc-t { font-size: 12px; }
.mock-result h3 { margin-bottom: 10px; }

/* --- mock exam: question navigator + action bar + result band --- */
.qnav {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px;
  justify-items: center; flex-shrink: 0; padding: 8px 12px 6px;
}
/* a short phone: the 24 numbers took 150px as a grid and left the question
   one or two choices (320×568, the audit, 2026-10-28); one row that scrolls
   sideways takes 46 */
@media (max-height: 740px) and (max-width: 767px) {
  .qnav { display: flex; gap: 6px; overflow-x: auto; justify-items: initial; scrollbar-width: none; overscroll-behavior-x: contain; }
  .qnav::-webkit-scrollbar { display: none; }
}
.qn-chip {
  min-width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  border: 2px solid var(--line); background: #fff; position: relative;
  font-family: var(--font); font-weight: 700; font-size: 13px; color: var(--gray);
  padding: 3px 0 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background .15s, border-color .15s, color .15s;
}
/* answered — filled but deliberately neutral: a mock gives no per-question
   feedback, so a colour that reads as "correct" would be a lie */
.qn-chip.done { background: var(--blue); border-color: var(--blue-dk); color: #fff; }
/* flagged for review — the colour IS the flag, so no glyph is needed */
.qn-chip.flagged { background: var(--gold); border-color: var(--gold-dk); color: #7A5A00; }
/* where you are: an outline, so it never overwrites the state colour */
.qn-chip.cur { outline: 2.5px solid var(--blue-dk); outline-offset: 2px; }
.mock-bar { display: flex; gap: 9px; align-items: stretch; }
.mock-bar .btn { flex: 1; }
.mk-flag {
  min-width: 58px; flex-shrink: 0; border-radius: 13px; padding: 4px 10px 3px;
  border: 2px solid var(--gold); background: #fff;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-family: var(--font); font-size: 16px; line-height: 1;
  color: var(--gold-dk); cursor: pointer;
  margin-bottom: 5px; box-shadow: 0 4px 0 var(--gold-soft);
  transition: transform .08s, box-shadow .08s, background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.mk-flag span { font-size: 11.5px; font-weight: 800; }
.mk-flag-ic { width: 18px; height: 18px; flex: none; }
.mk-flag:active { transform: translateY(4px); box-shadow: none; }
.mk-flag.on { background: var(--gold); border-color: var(--gold-dk); color: #fff; box-shadow: 0 4px 0 var(--gold-dk); }
.mk-side { flex: 0 0 auto !important; width: auto; }
.mock-band {
  font-size: 17px; font-weight: 800; color: var(--gold-dk);
  margin: 4px 0 2px; animation: fadeUp .5s .8s ease backwards;
}
.mock-note { font-size: 12.5px; font-weight: 600; color: var(--gray-icon); margin-bottom: 14px; }

/* --- result answer grid: numbered, green/red, springy stagger --- */
.mock-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  margin: 4px 0 6px;
}
@keyframes cellPop {
  0% { transform: scale(0) rotate(-8deg); opacity: 0; }
  70% { transform: scale(1.12) rotate(2deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.mg-cell {
  height: 40px; border-radius: 11px; border: 0; cursor: pointer;
  font-family: var(--font); font-weight: 800; font-size: 15px; color: #fff;
  padding-top: 3px; -webkit-tap-highlight-color: transparent;
  animation: cellPop .45s cubic-bezier(.3,1.6,.5,1) var(--d, 0s) backwards;
  transition: transform .12s ease, box-shadow .12s ease;
}
.mg-cell.ok  { background: var(--green); box-shadow: 0 3px 0 var(--green-lip); }
.mg-cell.bad { background: var(--red); box-shadow: 0 3px 0 #C73535; }
.mg-cell.skip { background: var(--gray-icon); box-shadow: 0 3px 0 #9A9A9A; }   /* left unanswered: not the same as answered wrong (QA, 2026-11-08) */
.mg-cell:active { transform: translateY(2px); box-shadow: none; }
.mg-cell.sel { outline: 3px solid var(--blue); outline-offset: 2px; }
.mock-detail { animation: fadeUp .35s cubic-bezier(.3,1.3,.5,1); margin-top: 8px; }

/* ============================================================
   "كيف أحلّها؟" method button + bottom sheet
   ============================================================ */
.q-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 10px 0 16px; }
.q-top .q-kicker { margin: 0; flex: 1; }

.method-veil {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(0,0,0,0); display: flex; align-items: flex-end; justify-content: center;
  transition: background .28s ease;
}
.method-veil.show { background: var(--scrim); }
.method-sheet {
  width: 100%; max-width: 430px; background: #fff;
  border-radius: 22px 22px 0 0; padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .32s cubic-bezier(.25,1.1,.4,1);
  max-height: 82vh; overflow-y: auto; box-shadow: 0 -8px 30px rgba(0,0,0,.18);
}
.method-veil.show .method-sheet { transform: translateY(0); }
.ms-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 14px; }
.ms-head { display: flex; align-items: center; gap: 10px; }
.ms-head h3 { font-size: 22px; color: var(--green-dk); margin: 0; }
.ms-bulb {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--gold); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 var(--gold-dk); animation: bulbPop .5s cubic-bezier(.3,1.8,.5,1);
}
.ms-bulb svg { width: 22px; height: 22px; color: #fff; }
@keyframes bulbPop { 0% { transform: scale(0) rotate(-20deg); } 100% { transform: scale(1) rotate(0); } }
.ms-sub { color: var(--gray); font-weight: 600; font-size: 14px; margin: 8px 2px 14px; }
.ms-body { margin-bottom: 18px; }
.ms-body .ex-step {
  animation: fadeUp .35s ease backwards;
}
.ms-body .ex-step:nth-child(1) { animation-delay: .05s; }
.ms-body .ex-step:nth-child(2) { animation-delay: .11s; }
.ms-body .ex-step:nth-child(3) { animation-delay: .17s; }
.ms-body .ex-step:nth-child(4) { animation-delay: .23s; }
.ms-body .ex-step:nth-child(5) { animation-delay: .29s; }
.ms-close { background: var(--green); box-shadow: 0 4px 0 var(--green-lip); }

/* lesson-node math emoji (replaces the old language-app icons) */
.node-emoji { font-size: 30px; line-height: 1; display: inline-block; filter: drop-shadow(0 1px 0 rgba(0,0,0,.12)); }
.node-emoji.locked { filter: grayscale(1); opacity: .5; }
/* green "أحسنت" check in lesson feedback */
.fb-ok { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.fb-ok svg { width: 18px; height: 18px; color: #fff; }

/* ============================================================
   الدوري الأسبوعي (weekly league) — Duolingo-style leaderboard
   ============================================================ */
.lb-page { padding-top: 8px; }
.lb-hero { text-align: center; padding: 8px 0 6px; }
.lb-badge { position: relative; display: inline-block; animation: lbBadgeIn .55s cubic-bezier(.3,1.6,.5,1) backwards; }
.lb-badge .rank-badge { display: block; filter: drop-shadow(0 5px 7px rgba(75,75,75,.22)); animation: lbBadgeBob 3.2s ease-in-out infinite; }
@keyframes lbBadgeIn { 0% { transform: scale(0) rotate(-12deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes lbBadgeBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.lb-badge-glow {
  position: absolute; top: 50%; left: 50%; width: 150px; height: 150px; margin: -75px 0 0 -75px;
  border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(closest-side, rgba(255,200,0,.4), transparent 70%);
  animation: lbGlow 3.2s ease-in-out infinite;
}
@keyframes lbGlow { 0%,100% { opacity: .5; transform: scale(.9); } 50% { opacity: .9; transform: scale(1.05); } }
/* per-tier glow tint behind the hero badge */
.lb-badge-bronze   .lb-badge-glow { background: radial-gradient(closest-side, rgba(196,127,65,.42), transparent 70%); }
.lb-badge-silver   .lb-badge-glow { background: radial-gradient(closest-side, rgba(159,176,192,.45), transparent 70%); }
.lb-badge-gold     .lb-badge-glow { background: radial-gradient(closest-side, rgba(255,200,0,.42), transparent 70%); }
.lb-badge-diamond  .lb-badge-glow { background: radial-gradient(closest-side, rgba(120,200,245,.48), transparent 70%); }
.lb-badge-champion .lb-badge-glow { background: radial-gradient(closest-side, rgba(168,120,232,.46), transparent 70%); }
.lb-title { font-size: 26px; color: var(--gold-dk); margin: 6px 0 2px; }

/* tier progression ladder (doubles as the screen header) */
.lb-ladder { display: flex; justify-content: space-between; align-items: flex-end; gap: 4px; margin: 6px 2px 14px; overflow-x: clip; overflow-clip-margin: 16px; }   /* the edge tier's glow never widens the page (QA, 2026-11-08: champions scrolled sideways) */
.lb-tier { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; transition: transform .2s; }
.lb-tier-badge { position: relative; display: inline-flex; }
.lb-tier-badge .rank-badge { height: 58px; width: auto; display: block; }
.lb-tier span { font-size: 12px; font-weight: 700; color: var(--gray); }
/* locked tiers: keep the real colours, just dim slightly + soft scrim + padlock */
.lb-tier.locked .rank-badge { opacity: .9; }
.lb-tier.locked .lb-tier-badge::after { content: ''; position: absolute; inset: -2px; border-radius: 30% 30% 42% 42%/30% 30% 55% 55%; background: rgba(60,55,75,.34); }
.lb-lock { position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; transform: translate(-50%,-48%); z-index: 2; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.45)); }
.lb-lock svg { width: 100%; height: 100%; display: block; }
.lb-tier.done .rank-badge { filter: drop-shadow(0 2px 3px rgba(75,75,75,.18)); }
/* current tier: enlarged, lifted, glowing */
/* was transform: scale(1.32), which magnified the 12px label to 15.8px, put
   its baseline 3.6px below the other four, and overlapped the neighbouring
   tier by 7px. Grow the badge, not the box. */
.lb-tier.cur { transform: translateY(-3px); }
.lb-tier.cur .lb-tier-badge .rank-badge { height: 76px; filter: drop-shadow(0 4px 6px rgba(75,75,75,.3)); }
.lb-tier.cur span { font-size: 13px; }
.lb-tier.cur span { color: var(--ink); font-weight: 800; }
.lb-tier-glow { position: absolute; inset: -40% ; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, rgba(255,200,0,.55), transparent 72%); animation: lbGlow 2.6s ease-in-out infinite; }
.lb-tier-silver  .lb-tier-glow { background: radial-gradient(closest-side, rgba(159,176,192,.6), transparent 72%); }
.lb-tier-diamond .lb-tier-glow { background: radial-gradient(closest-side, rgba(120,200,245,.6), transparent 72%); }
.lb-tier-champion .lb-tier-glow { background: radial-gradient(closest-side, rgba(168,120,232,.6), transparent 72%); }
.lb-tier-bronze  .lb-tier-glow { background: radial-gradient(closest-side, rgba(196,127,65,.55), transparent 72%); }
/* your tier's shine (lbShine): the light band is masked by the badge's own PNG */
.lb-shine { position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat;
  background: linear-gradient(115deg, transparent 34%, rgba(255,255,255,.55) 42%, #fff 47%, #fff 53%, rgba(255,255,255,.55) 58%, transparent 66%) 160% 0 / 300% 100% no-repeat;
  animation: lbShine 3.4s cubic-bezier(.45, 0, .25, 1) .6s infinite; }
@keyframes lbShine { 0% { background-position: 160% 0; } 38%, 100% { background-position: -60% 0; } }
.lb-glint { position: absolute; width: 24px; height: 24px; left: 2%; top: 0; pointer-events: none; z-index: 2;
  transform: scale(0); animation: lbGlint 3.4s ease-out .6s infinite; filter: drop-shadow(0 0 1.5px rgba(60,80,110,.45)) drop-shadow(0 0 5px rgba(255,255,255,.95)); }
.lb-glint svg { width: 100%; height: 100%; display: block; fill: #fff; }
.lb-glint2 { width: 15px; height: 15px; left: auto; top: auto; right: 4%; bottom: 22%; animation-delay: .78s; }
@keyframes lbGlint { 0%, 30% { transform: scale(0) rotate(0); } 38% { transform: scale(1.15) rotate(45deg); } 46% { transform: scale(.9) rotate(70deg); } 56%, 100% { transform: scale(0) rotate(90deg); } }
:root[data-motion="reduced"] .lb-shine, :root[data-motion="reduced"] .lb-glint { animation: none; }

/* progress to next tier */
.lb-title-silver { color: #8597A8; } .lb-title-diamond { color: #3FA7E0; } .lb-title-champion { color: #9069CD; } .lb-title-bronze { color: #B5793F; }
.lb-prog { margin: 4px 2px 16px; }
.lb-prog-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 800; color: var(--gray); margin-bottom: 6px; }
.lb-prog-next { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); }
.lb-prog-next .rank-badge { height: 20px; width: auto; }
.lb-prog-sub { text-align: center; font-size: 13px; font-weight: 700; color: var(--gray); margin-top: 8px; }
.lb-prog-sub b { color: var(--gold-dk); }
.lb-prog-max { text-align: center; font-size: 15px; font-weight: 800; color: var(--gold-dk); background: var(--gold-light, #FFF8DC); border-radius: 14px; padding: 14px; }
.lb-listhead { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 15px; color: var(--ink); margin: 4px 2px 8px; }
.lb-listhead .ic { width: 18px; height: 18px; }
.lb-sub { color: var(--gray); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
/* the league's name on a ribbon in its own colour (2026-10-26): the band
   unrolls from its middle with a little overshoot, the tails slide out from
   behind it and fold back, the name springs up onto it and a band of light
   crosses it; after that the tails stir in a slow breeze and the light comes
   back every few seconds */
.lbb-bronze   { --bm: #C46A2F; --bd: #9C5022; --bl: #DD8A52; --bf: #6E3714; }
.lbb-silver   { --bm: #8A9DB5; --bd: #6B7F99; --bl: #A9B9CC; --bf: #4E5F77; }
.lbb-gold     { --bm: #F0A800; --bd: #C98A00; --bl: #FFC845; --bf: #946500; }
.lbb-diamond  { --bm: #1CB0F6; --bd: #1482BF; --bl: #5CC8F8; --bf: #0C5E8C; }
.lbb-champion { --bm: #8E4CF0; --bd: #6A2FC8; --bl: #A46CF5; --bf: #4C1E96; }
.lb-banner { position: relative; display: inline-flex; margin: 14px 0 26px; padding: 0; font-size: inherit; isolation: isolate; }
.lbb-band {
  position: relative; z-index: 2; display: flex; align-items: center; height: 48px; padding: 0 30px; overflow: hidden;
  background: var(--bm); border-radius: 8px; box-shadow: inset 0 4px 0 var(--bl), inset 0 -4px 0 var(--bd);
  animation: lbbBand .6s cubic-bezier(.22, .9, .3, 1) backwards;
}
.lbb-tx {
  color: var(--snow); font-size: 24px; font-weight: 800; line-height: 1; white-space: nowrap; text-shadow: 0 2px 0 var(--bd);
  animation: lbbTx .5s .32s cubic-bezier(.3, 1.5, .5, 1) backwards;
}
.lbb-sh {
  position: absolute; inset: 0; pointer-events: none; transform: translateX(-130%);
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .5) 50%, transparent 65%);
  animation: lbbSh 5s .8s cubic-bezier(.4, 0, .2, 1) infinite;
}
.lbb-tail { position: absolute; z-index: 1; top: 13px; width: 54px; height: 43px; background: var(--bd); }
.lbb-tail.l { left: -36px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 17px 50%); transform-origin: 100% 40%; animation: lbbTailLS .5s .2s cubic-bezier(.22, .9, .3, 1.25) backwards, lbbFlapL 3.6s 1s ease-in-out infinite; }
.lbb-tail.r { right: -36px; clip-path: polygon(0 0, 100% 0, calc(100% - 17px) 50%, 100% 100%, 0 100%); transform-origin: 0 40%; animation: lbbTailRS .5s .2s cubic-bezier(.22, .9, .3, 1.25) backwards, lbbFlapR 3.6s 1s ease-in-out infinite; }
.lbb-fold { position: absolute; z-index: 1; top: 48px; width: 18px; height: 8px; background: var(--bf); animation: lbbFold .3s .38s ease-out backwards; }
.lbb-fold.l { left: 0; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.lbb-fold.r { right: 0; clip-path: polygon(0 0, 100% 0, 0 100%); }
@keyframes lbbBand {
  0% { transform: scale(0, .5); }
  55% { transform: scale(1.07, 1.06); }
  78% { transform: scale(.98, .99); }
  100% { transform: none; }
}
@keyframes lbbTx { from { opacity: 0; transform: translateY(16px) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes lbbSh { 0% { transform: translateX(130%); } 22%, 100% { transform: translateX(-130%); } }
@keyframes lbbTailL { from { opacity: 0; transform: translateX(34px) scaleX(.2); } to { opacity: 1; transform: none; } }
@keyframes lbbTailR { from { opacity: 0; transform: translateX(-34px) scaleX(.2); } to { opacity: 1; transform: none; } }
@keyframes lbbTailLS { from { opacity: 0; translate: 34px 0; scale: .2 1; } to { opacity: 1; translate: none; scale: none; } }   /* see springInS */
@keyframes lbbTailRS { from { opacity: 0; translate: -34px 0; scale: .2 1; } to { opacity: 1; translate: none; scale: none; } }
@keyframes lbbFlapL { 0%, 100% { transform: none; } 50% { transform: rotate(-3deg) translateY(1px); } }
@keyframes lbbFlapR { 0%, 100% { transform: none; } 50% { transform: rotate(3deg) translateY(1px); } }
@keyframes lbbFold { from { opacity: 0; } to { opacity: 1; } }
:root[data-motion="reduced"] .lbb-band, :root[data-motion="reduced"] .lbb-tx, :root[data-motion="reduced"] .lbb-sh,
:root[data-motion="reduced"] .lbb-tail, :root[data-motion="reduced"] .lbb-fold { animation: none; }
.lb-timer {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blue-light); color: var(--blue-dk); border: 1.5px solid var(--blue-border);
  font-weight: 800; font-size: 13px; padding: 6px 14px 5px; border-radius: 64px;
}
.lb-timer .ic { width: 18px; height: 18px; }
.lb-promo-note { text-align: center; font-size: 12.5px; font-weight: 700; color: var(--green-dk); margin: 14px 0 8px; }
.lb-list { display: flex; flex-direction: column; }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 14px;
  animation: fadeUp .35s cubic-bezier(.3,1.2,.5,1) backwards;
}
.lb-list .lb-row:nth-child(1) { animation-delay: .03s; } .lb-list .lb-row:nth-child(2) { animation-delay: .06s; }
.lb-list .lb-row:nth-child(3) { animation-delay: .09s; } .lb-list .lb-row:nth-child(4) { animation-delay: .12s; }
.lb-list .lb-row:nth-child(5) { animation-delay: .15s; } .lb-list .lb-row:nth-child(6) { animation-delay: .18s; }
.lb-row.me { background: #FFF8DC; box-shadow: inset 0 0 0 2px var(--gold); }
.lb-row.promo-edge { border-bottom: 2px dashed var(--green); border-radius: 14px 14px 0 0; padding-bottom: 13px; margin-bottom: 2px; }
.lb-rank { width: 30px; text-align: center; font-weight: 800; font-size: 16px; color: var(--gray); flex-shrink: 0; }
.lb-medal {
  width: 30px; height: 34px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.lb-medal svg { width: 30px; height: auto; display: block; }
.lb-medal text { font-family: var(--font); font-weight: 800; }
.lb-av {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 18px;
}
.lb-name { flex: 1; font-weight: 700; font-size: 16px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name b { color: var(--gold-dk); font-size: 13px; }
.lb-xp { font-weight: 800; font-size: 15px; color: var(--gray); white-space: nowrap; }
.lb-xp i { font-style: normal; font-size: 12px; color: var(--gray-icon); }
/* the score (the user, 2026-10-26: «XP rather than خبرة», then «make it
   just word XP»): the number in ink and the word «XP» after it, plain */
.lb-row .lb-xp { display: inline-flex; align-items: baseline; gap: 4px; direction: rtl; }
.lb-row .lb-xp b { font-size: 16px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.lb-row .lb-xp i { font-style: normal; font-size: 13px; font-weight: 800; letter-spacing: .4px; color: var(--gray); direction: ltr; }
.lb-row.me .lb-xp b, .lb-row.me .lb-xp i { color: var(--brown); }

/* The board redraws on a slow beat while it is open. Replaying the entrance
   stagger on every beat would read as the page re-mounting — louder than the
   staleness it was meant to cure — so once the list has landed, only the row
   that actually moved is allowed to animate. */
.lb-list.settled .lb-row { animation: none; }
.lb-list.settled .lb-row.gained { animation: lbBump .55s cubic-bezier(.3,1.2,.5,1); }
@keyframes lbBump { from { background: var(--green-bg); } to { background: transparent; } }

.lb-gain {
  flex: none; font-weight: 800; font-size: 12.5px; color: var(--green-dk);
  background: var(--green-bg); border-radius: 64px; padding: 2px 8px 1px;
  font-variant-numeric: tabular-nums;
  animation: lbGain 2.6s ease-out forwards;
}
@keyframes lbGain {
  0%   { opacity: 0; transform: translateY(7px); }
  14%  { opacity: 1; transform: translateY(0); }
  72%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-7px); }
}

/* A live marker with no caption. The word was doing the job the dot already
   does, and a board that says out loud that it is live invites the question of
   whether it is. */
.lb-live { margin-inline-start: auto; display: inline-flex; align-items: center; }
.lb-live i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  animation: lbLive 2.6s ease-in-out infinite;
}
@keyframes lbLive {
  0%, 100% { box-shadow: 0 0 0 0 rgba(88, 204, 2, .45); }
  70%      { box-shadow: 0 0 0 6px rgba(88, 204, 2, 0); }
}

:root[data-motion="reduced"] .lb-live i,
:root[data-motion="reduced"] .lb-gain,
:root[data-motion="reduced"] .lb-list .lb-row { animation: none; }
:root[data-motion="reduced"] .lb-gain { opacity: 1; }

/* ============================================================
   RANK-UP CELEBRATION
   ------------------------------------------------------------
   The animation itself is a canvas simulation — see showRankUp in app.js.
   What is left here is only what CSS is actually good at: the field the
   scene sits on, the layout that reserves the shield's box, and the type.

   .ru-stage is an EMPTY box. It exists so the DOM decides where the shield
   goes at every viewport size, and the canvas reads that rect back. Layout
   stays in one place instead of being duplicated as canvas arithmetic.

   .told is added by the scene when the shield actually lands, so the copy
   is released by the impact rather than by a timer hoping to agree with it.
   ============================================================ */
.rankup-veil {
  position: fixed; inset: 0; z-index: 400; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 24px calc(22px + env(safe-area-inset-bottom, 0px));
  background: var(--scrim);                /* the app's one dim, same as every other overlay */
  opacity: 0; transition: opacity .26s ease;
}
.rankup-veil.show { opacity: 1; }
.rankup-veil.out  { opacity: 0; }

/* One neutral overlay for every tier. The tinted fields read as brown and
   orange behind the warmer badges; the shield itself is the only thing that
   should be carrying colour here.

   Translucent, not a wall: the screen you just earned this on stays visible
   underneath, blurred and pushed back so it reads as context rather than as
   competition. The gradient is still darkest at the edges and lightest at the
   centre, which is what keeps the white type legible over whatever happens to
   be behind it - the app's own surfaces are near-white, so the floor here
   cannot go much below .55 without the title losing its contrast. */
.rankup-veil {
  /* --scrim + blur(4px) is exactly what .chest-veil uses, and the token is
     commented "one dim for every overlay" — this screen was the only one that
     had gone and invented its own. Same dim, same blur: the app stays clearly
     readable underneath, just pushed out of focus. */
  background: var(--scrim);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}
/* the league row from league-animation.zip: its own bright stage, edge to edge */
.rankup-veil.ru-league { padding: 0; background: #fffffc; -webkit-backdrop-filter: none; backdrop-filter: none; }
.rankup-veil.ru-league::after { content: none; }
.ru-frame { display: block; width: 100%; height: 100%; border: 0; background: #fffffc; }
/* Only claim transparency where the blur is really available. Without it the
   app behind stays sharp and fights the celebration, so those browsers keep
   the solid field they had. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .rankup-veil {
    background: radial-gradient(circle at 50% 37%, #2B303B 0%, #191D25 42%, #0C0F14 100%);
  }
}

/* A soft pool under the copy, nothing like the old vignette. At .55 dim over
   the app's near-white surfaces the backdrop lands around mid-grey, which is
   thin ground for white type — this puts the contrast back exactly where the
   words are and leaves the rest of the screen alone. */
.rankup-veil::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(115% 62% at 50% 88%,
    rgba(8,10,15,.62) 0%, rgba(8,10,15,.34) 45%, rgba(8,10,15,0) 78%);
}
/* width/height are NOT redundant with inset:0 — a canvas is a replaced
   element, so absolute positioning leaves it at its intrinsic 300x150 and
   the offsets are simply over-constrained. */
.ru-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }

.ru-main { flex: 1; width: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; position: relative; z-index: 3; }
.ru-foot { width: 100%; max-width: 400px; flex-shrink: 0; opacity: 0;
  position: relative; z-index: 3; }

/* reserves the shield's box; the canvas draws into this rect */
.ru-stage { width: 240px; height: 240px; margin-bottom: 30px; flex-shrink: 0; }

.ru-kicker, .ru-title, .ru-sub { opacity: 0; }
/* No letter-spacing and no uppercase: Arabic is cursive, so tracking pulls
   joined letters apart and uppercase does nothing. */
.ru-kicker { font-weight: 800; font-size: 15px; color: rgba(255,255,255,.8); }

.ru-title {
  color: #fff; font-size: 40px; font-weight: 800; line-height: 1.25;
  margin: 8px 0 10px;
  /* Stacked halos, not one: the tight pair carries the letter edges and the
     wide one lifts the whole word off the blurred app behind it. White on a
     .55 scrim over near-white is about 3.6:1, which large bold type clears —
     the glow is what keeps it clearing over the light patches too. */
  text-shadow: 0 4px 0 rgba(0,0,0,.34),
               0 0 10px rgba(0,0,0,.85), 0 0 34px rgba(0,0,0,.7);
}
.ru-sub {
  color: #fff; font-weight: 600; font-size: 15.5px;
  line-height: 1.65; max-width: 300px; text-align: center;
  text-shadow: 0 0 9px rgba(0,0,0,.9), 0 0 24px rgba(0,0,0,.65);
}
.ru-kicker {
  color: rgba(255,255,255,.95);
  text-shadow: 0 0 9px rgba(0,0,0,.9), 0 0 22px rgba(0,0,0,.6);
}

/* a sheen crossing the CTA, so the button reads as lit rather than flat */
.ru-foot .btn { position: relative; overflow: hidden; }
.ru-foot .btn::after {
  content: ""; position: absolute; top: -60%; bottom: -60%; width: 34%; left: -45%;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.42), rgba(255,255,255,0));
  transform: skewX(-22deg); pointer-events: none;
}
.rankup-veil.told .ru-foot .btn::after { animation: ruSheen 2.6s 1.15s ease-in-out infinite; }
@keyframes ruSheen {
  0%   { left: -45%; opacity: 0; }
  8%   { opacity: 1; }
  26%  { left: 118%; opacity: 0; }
  100% { left: 118%; opacity: 0; }
}
.rankup-veil.told .ru-kicker { animation: ruRise .5s cubic-bezier(.2,.8,.3,1) .04s forwards; }
.rankup-veil.told .ru-title  { animation: ruSlam .55s cubic-bezier(.2,1.6,.4,1) .12s forwards; }
.rankup-veil.told .ru-sub    { animation: ruRise .5s cubic-bezier(.2,.8,.3,1) .26s forwards; }
.rankup-veil.told .ru-foot   { animation: ruRise .5s cubic-bezier(.2,.8,.3,1) .38s forwards; }
@keyframes ruRise { 0% { opacity: 0; transform: translateY(18px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes ruSlam { 0% { opacity: 0; transform: scale(.5); } 60% { opacity: 1; } 100% { opacity: 1; transform: scale(1); } }

/* short viewports: keep the shield and the CTA on the same screen */
@media (max-height: 740px) {
  .ru-stage { width: 180px; height: 180px; margin-bottom: 20px; }
  .ru-title { font-size: 33px; }
}

/* Driven by the saved setting on <html>, not by the raw OS query - see
   motionApply() in app.js. Windows reports "reduce" far more often than
   anyone intends, and it used to silently gut the celebration on desktop. */
:root[data-motion="reduced"] .rankup-veil,
:root[data-motion="reduced"] .rankup-veil * {
  /* the scene skips the simulation and composes the rest pose in one frame;
     the copy just needs to be there rather than sliding in */
  animation-duration: .01ms !important; animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}

/* ===== Fire-streak celebration (Duolingo Rive flame + odometer + Lottie checks) ===== */
.streak-veil { position: fixed; inset: 0; z-index: 120; background: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .3s ease; }
.streak-veil.show { opacity: 1; }
.streak-veil.out { opacity: 0; }
.streak-scene { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 360px; padding: 0 24px; }
.sk-flame { width: 310px; height: 310px; }
.sk-flame canvas { width: 100%; height: 100%; display: block; }
/* The streak count: a window one number tall, with the old number above the new
   one inside it. .go slides the pair up by exactly one row, so the number the
   student had rolls off the top as the number they now have arrives, and it
   settles with the app's own overshoot instead of stopping dead. */
.sk-num { position: relative; width: 168px; height: 132px; margin-top: -16px; overflow: hidden; }
.skn-roll {
  position: absolute; top: 0; inset-inline: 0; display: flex; flex-direction: column;
  transition: transform .78s cubic-bezier(.22,.92,.26,1.06);
}
.skn-roll > b {
  flex: none; height: 132px; display: flex; align-items: center; justify-content: center;
  font-size: 96px; font-weight: 800; line-height: 1; color: #FF9600;
}
.skn-roll.go { transform: translateY(-132px); }
.skn-roll.still { transition: none; }
.sk-sub { color: #ff9600; font-weight: 800; font-size: 23px; margin-top: -4px; letter-spacing: .2px; opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s cubic-bezier(.2,.7,.3,1); }
.sk-sub.show { opacity: 1; transform: none; }
.sk-cal { margin-top: 20px; width: 100%; opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s cubic-bezier(.2,.7,.3,1); }
.sk-cal.show { opacity: 1; transform: none; }
.sk-days { display: flex; justify-content: space-between; direction: rtl; }
.sk-days .day { display: flex; flex-direction: column; align-items: center; gap: 9px; width: 40px; }
.sk-days .lbl { color: #ff9600; font-weight: 800; font-size: 15px; }
.sk-days .dot { width: 32px; height: 32px; border-radius: 50%; background: #E5E5E5; position: relative; }
/* a checked day keeps its grey dot underneath: the check's orange dot pops from a
   point to 39px, so the grey is what shows until the pop — a dot, not an empty slot */
/* 46×60 puts the Lottie's orange dot (68 of its 97 units) at 32px: the same circle as
   the grey days, not a bigger one sitting on top of them. The dot is drawn at 53% of the
   composition's width and 72% of its height, and the translate parks that point on the
   grey dot's centre, so the orange grows out of the grey rather than under it. */
.sk-days .check { position: absolute; left: 50%; top: 50%; width: 46px; height: 60px; transform: translate(-53%,-72%); pointer-events: none; }
.sk-days .check svg { width: 100% !important; height: 100% !important; }
/* today's coin (skCoinFlip): the canvas is five times the dot, centred on it,
   so the coin lands exactly on the dot after its toss; hidden until thrown */
.sk-days .sk-coin { position: absolute; left: 50%; top: 50%; width: 168px; height: 168px; transform: translate(-50%, -50%); pointer-events: none; visibility: hidden; z-index: 2; }
.sk-days .dot.coin .sk-coin { visibility: visible; }
.sk-days .dot.coin .check { display: none; }
.sk-foot { margin-top: 36px; width: 100%; opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s cubic-bezier(.2,.7,.3,1); }
.sk-foot.show { opacity: 1; transform: none; }
.sk-foot:not(.show) { pointer-events: none; }
/* a short phone keeps the whole streak scene, «متابعة» included, on the screen (QA, 2026-11-08: the button sat under 568) */
@media (max-height: 760px) { .sk-flame { width: 250px; height: 250px; } .sk-foot { margin-top: 24px; } }
@media (max-height: 640px) { .sk-flame { width: 190px; height: 190px; } .sk-num { height: 112px; margin-top: -10px; } .sk-cal { margin-top: 12px; } .sk-foot { margin-top: 16px; } .sk-next { margin-bottom: 10px; font-size: 14px; } }
.sk-next { color: var(--gray); font-size: 15px; font-weight: 700; line-height: 1.5; text-align: center; margin-bottom: 16px; }
.sk-btn { width: 100%; }

/* ============================================================
   CORRECT-ANSWER MOTION — the jump, and the two strikes.
   Ported from NewAnswerAnimation.txt; the timeline lives in
   answerFx() in app.js. The card must have transform-origin at
   its own base or the hop reads as a slide.
   ============================================================ */
.choice { transform-origin: 50% 100%; will-change: transform; overflow: hidden; position: relative; }
.choice .ch-txt { position: relative; z-index: 2; }
.choice .ch-letter, .choice .ch-key { position: relative; z-index: 2; }

.ch-shine {
  position: absolute; top: -25%; bottom: -25%; width: 23%; left: 0; z-index: 1; opacity: 0;
  pointer-events: none; transform: skewX(-25deg);
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.55) 22%,
    rgba(255,255,255,.92) 50%, rgba(255,255,255,.55) 78%, rgba(255,255,255,0));
}
.ch-spk {
  position: absolute; width: 11px; height: 11px; opacity: 0; z-index: 3;
  pointer-events: none; transform: scale(0);
  /* a rasterised star, not a clip-path mask: three masked layers per jump
     was three too many for a weak GPU */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolygon fill='%23fff' points='50,0 61,39 100,50 61,61 50,100 39,61 0,50 39,39'/%3E%3C/svg%3E") center/contain no-repeat;
}
.ch-spk.k1 { top: 8px; left: 11px; }
.ch-spk.k2 { top: 10px; right: 13px; }
.ch-spk.k3 { bottom: 11px; right: 62px; }

/* the liquid crest on the lip of the correct-answer sheet — the sheet's own
   top edge becomes the wave, so the rounded corners come off while it is up */
.feedback.has-crest { border-radius: 0; overflow: visible; }
.fb-crest {
  position: absolute; left: 0; right: 0; top: -88px;
  width: 100%; height: 90px; display: block; pointer-events: none;
}
.fb-crest-fill { fill: var(--green-bg); }
.fb-crest-line { stroke: #8ee000; }

/* The storm is scoped to the CONTENT COLUMN, not the viewport.
   The bolt SVG is viewBox="0 0 884 1920" with preserveAspectRatio="slice", so
   it scales to COVER whatever box it lives in. Pinned to a 1440px window that
   is a 2.17x scale — one bolt turns into a giant ribbon across the page and
   the confetti scatters to the far edges of the screen, hundreds of px from
   the question. The reference scopes all of it inside its 400px .phone; this
   is the same box, using the column geometry the action bar and sheet use. */
.storm {
  position: fixed; top: 0; bottom: 0;
  left: calc(50% + var(--col-off)); transform: translateX(-50%);
  width: 100%; max-width: var(--col-max);
  overflow: hidden; pointer-events: none; z-index: 70;
}
/* one canvas holds the bolts, the sparks and the confetti — see fxCanvas() */
.storm canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* streak tag, under the progress bar */
/* The bar and its streak tag share a parent, so the tag centres on the BAR.
   It used to live in its own full-width wrapper outside .session-top, which
   centred it on the page — and the bar is not in the middle of that row, the
   ✕ button on one side and the timer + hearts on the other push it across.
   .prog-wrap takes the flex slot the bar used to hold; the bar fills it, and
   the tag hangs off the bottom edge, out of flow so nothing reflows. */
.prog-wrap { position: relative; flex: 1; min-width: 0; }
.fx-tag {
  position: absolute; top: calc(100% + 3px); left: 0; right: 0; text-align: center;
  font-size: 12.5px; font-weight: 700; opacity: 0; pointer-events: none;
}
/* the resting state. GSAP pops it on the strike, but the tag has to stay up
   by itself across the next question - the run is still alive. */
.fx-tag.on { opacity: 1; }

/* The bar's second layer: a strike cross-fades the track over to the next
   tier. It is a full copy of the fill — shine line and all — so the turnover
   is one bar changing colour, not a flat block sliding over a detailed one.
   Once the cross-fade lands, fxPaintBar() commits the tier to the warm layer
   and parks this one again. */
.progress { position: relative; }
.progress > .prog-cool {
  position: absolute; inset-block: 0; inset-inline-start: 0;
  opacity: 0; background: var(--cool-fill, var(--gold)); pointer-events: none;
}
.progress > .prog-cool::after { background: var(--cool-shine, var(--gold-soft)); }

/* --- the sheet, while the timeline owns it -------------------------------
   The reference slides its banner inside the same timeline as the jump, so
   the crest, the confetti and the slide all read off one clock. Here that
   means the CSS transition and the content's own entrance animations have to
   stand down for the duration — two clocks on one element is exactly the
   drift the brief warns about. Everything below is scoped to .fx-anim, so the
   CSS slide stays as the fallback for reduced motion and for a missing GSAP.
   .up is brief trap 1: the parked sheet sits over the check button, so it
   must not be tappable until it has actually arrived. */
.feedback.fx-anim        { transition: none; pointer-events: none; will-change: transform; }
.feedback.fx-anim.up     { pointer-events: auto; }
.feedback.fx-anim .fb-head,
.feedback.fx-anim .fb-head img,
.feedback.fx-anim .fb-ok,
.feedback.fx-anim .fb-x,
.feedback.fx-anim .btn   { animation: none; }
.feedback.fx-anim .fb-x  { transform-origin: 50% 50%; }

/* Same rule: the saved setting, never the media query. This selector is why
   the bolts could never render on a Windows box with animations turned off. */
:root[data-motion="reduced"] .ch-shine,
:root[data-motion="reduced"] .ch-spk { display: none !important; }

/* ============================================================
   ANSWER SCREEN — the UI from NewAnswerAnimation.txt, 1:1.
   Every colour, radius, size and transition below is lifted from
   that file. Scoped to .screen-session so the daily-question card
   and the mock exam keep the app's own look.

   Two values are min- instead of fixed, and only these two: the
   slot's 60px height and the banner's 212px. The reference has one
   short line per option and one line of solution; our options are
   Arabic maths and our solution runs to several lines, so a hard
   height would clip real content. Everything else is verbatim.
   ============================================================ */
/* questionBody() emits .slot everywhere it is used. Outside a session the
   grey base has no meaning, so it stays hidden and the slot is a plain
   wrapper — the choice keeps the app's normal look. */
.slot { position: relative; display: flex; }
.slot > .base { display: none; }
.slot > .choice { flex: 1; }
.screen-session .slot > .base { display: block; }

.screen-session {
  --pick-face: #ddf4ff; --pick-edge: #84d8ff; --pick-ink: #1899d6;
  --grn-face: #d0ffb5;  --grn-edge: #95ed63;  --grn-ink: #58a700;
  --grn-go: #40ca12;    --grn-go-lo: #33a30c;
  --banner-g: #d0fdb3;
  --red-face: #ffdfe0;  --red-edge: #ff8f8f;  --red-ink: #ea2b2b;
  --red-go: #ff4b4b;    --red-go-lo: #e02b2b;
  --banner-r: #ffdfe0;
  --hair: #e5e5e5;      --card-radius: 15px;
}

/* ---- the streak bar ----
   The session used to restyle this into the reference's bar: 17px tall, r9,
   and a flat inset-box-shadow highlight instead of the app's shine line. That
   threw away the Figma bar the rest of the app uses. It is back to the app's
   own bar — track #E5E5E5 r64 h16, fill with the #FBE56D shine line and the
   sweep — and the only thing the session adds is the streak tier, which is
   carried by --bar-fill / --bar-shine from fxPaintBar(). */

/* ---- option cards ---- */
.screen-session .choices { display: flex; flex-direction: column; gap: 10px; }
.screen-session .slot { position: relative; min-height: 62px; display: flex; }
.screen-session .slot > .base {
  position: absolute; inset: 0; border-radius: var(--card-radius);
  background: var(--hair); z-index: 0;
}
.screen-session .choice {
  position: relative; z-index: 1; flex: 1;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: #fff; border: 2px solid var(--hair); border-bottom-width: 4px;
  border-radius: var(--card-radius); box-shadow: none;
  /* the reference's 14.5/600 is its own type scale — the app's answer text
     is 19/500 and stays that way. Structure is borrowed, type is not. */
  font-size: 19px; font-weight: 500; color: var(--ink); text-align: right;
  overflow: hidden; transform-origin: 50% 100%; will-change: transform;
  transition: background-color .06s linear, border-color .06s linear, color .06s linear, opacity .18s;
}
.screen-session .choice:active { transform: none; box-shadow: none; }
.screen-session .choice .ch-letter {
  flex: none; width: 30px; height: 30px; border: 2px solid var(--hair);
  border-radius: 8px; display: grid; place-items: center;
  font-size: 15px; font-weight: 700; color: var(--gray-icon); background: transparent;
}
.screen-session .choice .ch-txt { position: relative; z-index: 2; line-height: 1.3; }
.screen-session .choice.sel { background: var(--pick-face); border-color: var(--pick-edge); color: var(--pick-ink); }
.screen-session .choice.sel .ch-letter { border-color: var(--pick-edge); color: var(--pick-ink); }
.screen-session .choice.correct { background: var(--grn-face); border-color: var(--grn-edge); color: var(--grn-ink); }
.screen-session .choice.correct .ch-letter { border-color: var(--grn-edge); color: var(--grn-ink); }
.screen-session .choice.wrong { background: var(--red-face); border-color: var(--red-edge); color: var(--red-ink); }
.screen-session .choice.wrong .ch-letter { border-color: var(--red-edge); color: var(--red-ink); }
.screen-session .choice.dim { opacity: .4; }
/* the app's own entry/state animations would fight GSAP over transform */
.screen-session .choice, .screen-session .choice.sel, .screen-session .choice.correct,
.screen-session .choice.wrong { animation: none; }

/* ---- the check button ---- */
.screen-session .action-bar .btn {
  height: 58px; border-radius: 14px; margin-bottom: 0;
  background: var(--hair); color: var(--gray-icon); box-shadow: none;
  border: 0; border-bottom: 4px solid transparent;
  font-size: 16px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  transition: background-color .12s, color .12s, opacity .12s;
}
.screen-session .action-bar .btn:not(:disabled) {
  background: var(--grn-go); border-bottom-color: var(--grn-go-lo); color: #fff;
}
.screen-session .action-bar .btn:active { transform: none; }
/* «السابق» beside it: the ghost button at the neighbour's height, a line lip
   instead of the green one. When there is nothing behind it, it fades rather
   than greys out — it is still the same button, just not a way back right now. */
.screen-session .action-bar .btn.mk-side {
  background: #fff; color: var(--blue);
  border: 2px solid var(--line); border-bottom-width: 4px; padding: 0 18px;
}
.screen-session .action-bar .btn.mk-side:disabled { opacity: .45; }
/* «السابق» on the teach cards: the reference's secondary button — white face,
   line border, line lip, grey label — at .btn's own height beside the green
   «التالي». Unavailable = the same button faded, never a grey slab. */
.screen-teach .action-bar .btn.mk-side {
  padding: 0 18px; background: #fff; color: var(--gray);
  border: 2px solid var(--line); box-shadow: 0 5px 0 var(--line);
  transition: transform .08s, box-shadow .08s, opacity .12s;
}
.screen-teach .action-bar .btn.mk-side:active { transform: translateY(5px); box-shadow: 0 0 0 var(--line); }
.screen-teach .action-bar .btn.mk-side:disabled {
  background: #fff; color: var(--gray); box-shadow: 0 5px 0 var(--line); opacity: .45; transform: none;
}

/* ---- the banner ---- */
.screen-session .feedback {
  min-height: 212px; border-radius: 0; overflow: visible;
  background: var(--banner-g); box-shadow: none;
  /* the sheet's button lands exactly where «تحقق» stood: the action bar's
     16px sides and 24px + safe-area foot, at the same 58px height */
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  /* short feedback leaves the sheet's min-height empty: that room goes above, so the button keeps its place */
  display: flex; flex-direction: column; justify-content: flex-end;
}
.screen-session .feedback.bad { background: var(--banner-r); }
/* the green sheet is as tall as what it says, as Duolingo's is: held at 212px it covered the answer it judged, and the step was
   zoomed down to clear it the moment it rose (the user, 2026-11-16: «they are getting bigger when i answer») */
.screen-session .feedback.good { min-height: 0; }
.screen-session .feedback.good .btn { margin-top: 6px; }
.screen-session .feedback.good .ln-fb-note { margin-bottom: 8px; }
/* brief section 5: 200ms power3.out for the win, 160ms power4.out for the miss */
.screen-session .feedback.good { transition-duration: .2s;  transition-timing-function: cubic-bezier(.215,.61,.355,1); }
.screen-session .feedback.bad  { transition-duration: .16s; transition-timing-function: cubic-bezier(.165,.84,.44,1); }
.screen-session .fb-head {
  display: flex; align-items: center; gap: 10px;
  flex-direction: row-reverse; justify-content: flex-end;
  font-size: 26px; font-weight: 700; color: var(--grn-ink);
}
.screen-session .feedback.bad .fb-head { color: var(--red-ink); }
.screen-session .fb-correct, .screen-session .fb-solution {
  margin-top: 8px; font-size: 16px; font-weight: 600;
  color: var(--grn-ink); text-align: right; line-height: 1.45;
}
.screen-session .feedback.bad .fb-correct,
.screen-session .feedback.bad .fb-solution { color: var(--red-ink); }
.screen-session .fb-solution-toggle { color: var(--grn-ink); }
/* the whole solution, zoomed to fit by fitSheet: nothing scrolls (the user, 2026-10-29) */
.screen-session .fb-solution { max-height: none; overflow: visible; }
.screen-session .feedback .btn {
  margin-top: 14px; width: 100%; height: 58px; border: 0; border-radius: 14px;
  background: var(--grn-go); border-bottom: 4px solid var(--grn-go-lo);
  color: #fff; font-size: 16px; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase; box-shadow: none; margin-bottom: 0;
}
.screen-session .feedback.bad .btn,
.screen-session .feedback .btn.btn-red {
  background: var(--red-go); border-bottom-color: var(--red-go-lo);
}
.screen-session .feedback .btn:active { transform: none; }
.screen-session .fb-crest-fill { fill: var(--banner-g); }
.screen-session .feedback.bad .fb-crest-fill { fill: var(--banner-r); }
.screen-session .fb-crest-line { stroke: #8ee000; }
.screen-session .feedback.bad .fb-crest-line { stroke: #ffb3b3; }
/* a free guess is not a mistake: its miss is blue, the sheet and the choice picked (the user, 2026-11-14) */
.screen-session .feedback.bad.free { background: var(--blue-light); }
.screen-session .feedback.bad.free .fb-head,
.screen-session .feedback.bad.free .fb-correct { color: var(--blue-dk); }
.screen-session .feedback.bad.free .fb-x { color: var(--blue); }
.screen-session .feedback.bad.free .btn { background: var(--blue); border-bottom-color: var(--blue-dk); }
.screen-session:has(.feedback.free) .choice.wrong { background: var(--blue-light); border-color: var(--blue-border); color: var(--blue-dk); }
.screen-session:has(.feedback.free) .choice.wrong .ch-letter { border-color: var(--blue-border); color: var(--blue-dk); }

/* ============================================================
   WEB LAYOUT — responsive tiers
   ------------------------------------------------------------
     <= 767px   phone   bottom tab bar, full-bleed column
     >= 600px   phablet column grows to 560
     >= 768px   rail    88px icon rail, fluid content
     >= 1100px  full    260px labelled sidebar
     >= 1320px  wide    sidebar + 304px context aside

   The overlays that used to centre on the VIEWPORT (action bar,
   feedback sheet, toast, floating chest) now centre on the
   CONTENT column. The nav rail sits on the visual RIGHT (the
   reading-start side under RTL) and the context aside on the
   left, so the content centre is:

       50vw + (aside - rail) / 2

   which is what --col-off resolves to at every tier.
   ============================================================ */

:root {
  --rail-w: 0px;                                     /* sidebar width  */
  --aside-w: 0px;                                    /* context column */
  --col-off: calc((var(--aside-w) - var(--rail-w)) / 2);
  --col-max: 430px;    /* session: timer, question, action bar */
  --page-max: 430px;   /* stats / league / settings pages      */
  --path-max: 430px;   /* unit banners + lesson path           */
}

/* both desktop columns are opt-in per tier */
.sidebar, .aside { display: none; }

/* ---- overlays re-anchored to the content column ------------ */
.bottomnav,
.action-bar {
  right: auto;
  left: calc(50% + var(--col-off));
  max-width: var(--col-max);
}
.bottomnav     { transform: translateX(-50%); }
.action-bar    { transform: translateX(-50%); }
/* left = 2*--col-off with right = 0 puts the centre at 50% + --col-off — the
   same place the others land, but with the transform axis left free. */
.feedback {
  left: calc(2 * var(--col-off)); right: 0; margin-inline: auto;
  max-width: var(--col-max);
  transform: translateY(100%);
}
.feedback.show { transform: translateY(0); }
.toast         { left: calc(50% + var(--col-off)); }
.quest-banner  { left: calc(12px + var(--col-off)); right: calc(12px - var(--col-off)); }

/* the win/review result screens re-flow their action bar inline as a
   static block - it must opt out of the column centring entirely */
.action-bar.win-action {
  position: relative; left: auto; right: auto;
  transform: none; width: 100%; padding-inline: 0; border-top: 0;
}

/* the session column: one axis, one width, for every band */
.session-top,
.q-area { width: 100%; max-width: var(--col-max); margin-inline: auto; }
.q-area {
  flex: 1; display: flex; flex-direction: column;
  /* clears the fixed action bar AND the compact correct sheet (≈134px + the
     home-bar inset), set once at render — nothing grows this after an answer,
     because the block is centred and any change here moves the choices */
  padding-bottom: calc(144px + env(safe-area-inset-bottom));
}
.q-area > :first-child { margin-top: auto; }
.q-area > :last-child  { margin-bottom: auto; }
.qtimer { max-width: var(--col-max); }

/* dynamic viewport height so mobile browser chrome cannot overflow */
.app { min-height: 100dvh; }
/* a screen rising in from 16px lower (fadeUp) poked out of the page for its first quarter second and the page could scroll by it;
   clip (not hidden) cuts that off without making a scroll box, so sticky headers keep working (QA, 2026-11-08) */
.app { overflow-y: clip; }

/* A lesson or exam question is a fixed frame exactly one screen tall. The
   header and the action bar are pinned, so letting the PAGE scroll only
   slid the question out from between them; the question body scrolls
   instead. body:has() stops the off-screen feedback sheet, which is
   position:fixed and parked below the fold, from adding a scrollbar. */
.screen-session { height: 100dvh; max-height: 100dvh; overflow: hidden; }
.screen-session .q-area {
  min-height: 0; overflow-y: auto;
  overscroll-behavior: contain; scrollbar-width: none;
}
.screen-session .q-area::-webkit-scrollbar { display: none; }
/* On a phone the question scrolls in the space ABOVE the action bar (98px:
   16 + the 58px button + 24), not under it: on a short phone the keypad's
   last row, a fourth choice or a tile sat behind «تحقق», where a tap on ⌫
   submitted the answer (the audit, 2026-10-28). Margin + padding still add up
   to the old 144px, so the block centres exactly where it did. The fade now
   sits on the bar's edge, where it can be seen: a clipped answer reads as
   "there is more". When nothing overflows, the faded strip is empty padding. */
@media (max-width: 767px) {
  .screen-session .q-area {
    margin-bottom: calc(98px + env(safe-area-inset-bottom));
    padding-bottom: 46px;
    -webkit-mask-image: linear-gradient(to top, transparent 0, #000 22px);
    mask-image: linear-gradient(to top, transparent 0, #000 22px);
  }
}
/* a question that never gets a verdict sheet (the mock, the level test) keeps no room for one */
@media (max-width: 767px) {
  .screen-session:has(.mock-bar) .q-area, .screen-place .q-area, .screen-session .q-area.lt-see { padding-bottom: 12px; }
}
/* solved, its tiles and help have done their work and give their room to the line (ops at 320 × 568 did not fit beside the sheet) */
.screen-session:has(.rf-chk):has(#fb.show) :is(.rf-tiles, .rf-hint) { visibility: hidden; }   /* hidden in place, so the solved line never jumps (the student tester, 2026-11-08: 155–190px) */
body:has(.screen-session) { overflow: hidden; }
/* a ceremony or a sheet over the path holds the page still under it: nothing scrolls behind it (the user, 2026-10-29) */
body:has(.ask-veil, .method-veil, .chest-veil, .streak-veil, .lesson-pop-veil, .modal-veil, .rankup-veil) { overflow: hidden; }

/* ============================================================
   Pointer and keyboard affordances
   ============================================================ */

/* a visible focus ring everywhere - the app had none */
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 8px;
}
.choice:focus-visible, .node:focus-visible { outline-offset: 2px; }

@media (hover: hover) and (pointer: fine) {
  .btn:not(:disabled):hover        { filter: brightness(1.06); }
  .choice:not(:disabled):hover     { border-color: var(--blue-border); background: #F6FCFF; }
  .choice.sel:not(:disabled):hover { background: var(--blue-light); }
  .node:not(:disabled):not(:active):not(.down):hover { transform: translateY(-2px); }
  .navbtn:hover                    { background: var(--line); }
  .x-btn:hover                     { opacity: .6; }
  .card[onclick]:hover,
  .mistakes-card:hover,
  .rank-card:hover,
  .chest-float:hover .cf-chest     { transform: scale(1.06); }
  .seg button:not(.on):hover       { color: var(--ink); }
  .fb-solution-toggle:hover        { opacity: .75; }
}

/* mouse users need to SEE that the page scrolls */
@media (pointer: fine) {
  html { scrollbar-width: thin; scrollbar-color: var(--gray-shadow) transparent; }
  html::-webkit-scrollbar, body::-webkit-scrollbar { display: block; width: 10px; height: 10px; }
  html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb {
    background: var(--gray-shadow); border-radius: 8px;
    border: 3px solid transparent; background-clip: content-box;
  }
  html::-webkit-scrollbar-track, body::-webkit-scrollbar-track { background: transparent; }
}

/* keyboard hint chips on each choice - real pointers only */
.ch-key {
  display: none; margin-inline-start: auto; flex-shrink: 0;
  min-width: 20px; padding: 1px 6px; border-radius: 6px;
  background: var(--line); color: var(--gray);
  font-size: 12px; font-weight: 800; line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
@media (hover: hover) and (pointer: fine) and (min-width: 768px) {
  .ch-key { display: block; }
  .choice.sel .ch-key     { background: #fff; color: var(--blue-dk); }
  .choice.correct .ch-key { background: #fff; color: var(--green-dk); }
  .choice.wrong .ch-key   { background: #fff; color: var(--red-dk2); }
}

/* ============================================================
   >= 600px - the column stops being phone-shaped
   ============================================================ */
@media (min-width: 600px) and (max-width: 767px) {
  :root { --col-max: 500px; --page-max: 520px; --path-max: 500px; }
  .app { max-width: 560px; }
}

/* ============================================================
   >= 768px - RAIL tier
   ============================================================ */
@media (min-width: 768px) {

  :root {
    --nav-h: 0px;                 /* no bottom bar, nothing to clear */
    --rail-w: 88px;
    --col-max: 600px;
    --page-max: 660px;
    --path-max: 560px;
  }

  body { background: #E8E8E8; }

  .app-shell {
    display: flex;
    direction: rtl;               /* nav rail on the right, aside on the left */
    min-height: 100dvh;
    max-width: none;              /* fill the viewport - see the 2400px cap below */
    margin: 0 auto;
    background: var(--snow);
  }

  /* ---- rail / sidebar ---------------------------- */
  .sidebar {
    display: flex; flex-direction: column;
    width: var(--rail-w); flex-shrink: 0;
    background: var(--snow);
    border-left: 2px solid var(--line);
    position: sticky; top: 0;
    height: 100dvh; direction: rtl; z-index: 20;
  }

  .sb-logo {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; padding: 18px 10px;
    font-size: 20px; font-weight: 800; color: var(--green-dk);
    border-bottom: 2px solid var(--line); white-space: nowrap;
  }
  .sb-logo span { display: none; }          /* wordmark only when there is room */

  /* the nav scrolls; logo and footer stay put on short windows */
  .sb-nav {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: 10px 8px; display: flex; flex-direction: column; gap: 4px;
  }

  .sb-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 4px; width: 100%;
    font-family: var(--font); font-size: 15px; font-weight: 700;
    color: var(--ink); background: none; border: none; border-radius: 14px;
    cursor: pointer; direction: rtl; transition: background .12s, color .12s;
  }
  .sb-item .sb-label { display: none; }
  .sb-item .sb-short { font-size: 11px; font-weight: 800; letter-spacing: .1px; }
  .sb-item:hover  { background: var(--line); }
  .sb-item.active { background: var(--green-bg); color: var(--green-dk); font-weight: 800; }
  .sb-item img    { flex-shrink: 0; opacity: .62; }
  .sb-item.active img { opacity: 1; }

  .sb-foot { display: none; }               /* statbar carries the counters here */

  /* ---- content column ---------------------------- */
  .app {
    flex: 1; min-width: 0; max-width: none;
    margin: 0; box-shadow: none;
    min-height: 100dvh; direction: rtl;
  }

  .bottomnav { display: none !important; }
  .screen:not(.screen-full) { padding-bottom: 40px; }

  /* a lesson is a focused mode - the nav gets out of the way.
     --col-off is computed on :root, so re-declaring --rail-w alone would
     not reach it; all three are reset together on the shell. */
  .app-shell:has(.screen-full) .sidebar,
  .app-shell:has(.screen-full) .aside { display: none; }
  .app-shell:has(.screen-full) { --rail-w: 0px; --aside-w: 0px; --col-off: 0px; }

  /* path and banners share one axis and one width.
     width:100% is required, not decorative: margin-inline:auto cancels
     align-self:stretch on a flex column child, which would otherwise
     shrink these to fit-content instead of filling to max-width. */
  .path        { width: 100%; max-width: var(--path-max); margin-inline: auto; }
  /* more horizontal room on desktop keeps most lesson titles on one line */
  .node-label  { max-width: 156px; font-size: 13.5px; }
  .node-col.bob .node-label { font-size: 15px; }

  /* the lesson popup is a bubble under the node, not a full-width sheet */
  .lesson-pop { max-width: 360px; }
  .unit-banner { width: calc(100% - 32px); max-width: var(--path-max); margin-inline: auto; }

  .statbar { padding: 0 24px; justify-content: flex-start; gap: 26px; }

  /* the docked bars stay on the reading axis but gain an edge, so they
     read as panels instead of floating white on white.
     (Deliberately NOT percentage padding: these are position:fixed, so a
     percentage would resolve against the viewport, not the element.) */
  .action-bar, .feedback {
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -6px 26px rgba(75,75,75,.10);
  }
  .action-bar { border-top: 2px solid var(--line); }

  /* the question block sits in the vertical middle of the free space.
     auto margins rather than justify-content:center: when the content is
     taller than the area the margins collapse to 0 and nothing is clipped. */
  .q-area {
    padding-inline: 24px; padding-bottom: 190px;
    display: flex; flex-direction: column;
  }
  .q-area > *              { flex-shrink: 0; }
  .q-area > :first-child   { margin-top: auto; }
  .q-area > :last-child    { margin-bottom: auto; }
  .toast  { bottom: 116px; }

  /* the daily chest tracks the left edge of the path column */
  .chest-float {
    bottom: 20px;
    left: max(14px, calc(50% + var(--col-off) - var(--path-max) / 2 - 82px));
  }

  /* pages get a reading width instead of stretching edge to edge */
  .page { width: 100%; max-width: var(--page-max); margin-inline: auto; }
  /* these sit above the path, so they take the PATH width, not the page
     width - otherwise the yellow card is visibly wider than the banner. */
  .ec2, .due-card {
    width: calc(100% - 32px); max-width: var(--path-max); margin-inline: auto;
  }

  .tiles { grid-template-columns: repeat(4, 1fr); }

  /* mock-exam question navigator rides the same reading axis */
  .qnav { width: 100%; max-width: var(--col-max); margin-inline: auto; }

  /* the method sheet stops being a bottom sheet and becomes a dialog */
  .method-veil { align-items: center; }
  .method-sheet {
    max-width: 620px; border-radius: 22px; max-height: 78dvh;
    padding: 18px 24px 24px;
    transform: translateY(20px) scale(.97); opacity: 0;
    transition: transform .28s cubic-bezier(.25,1.1,.4,1), opacity .22s ease;
  }
  .method-veil.show .method-sheet { transform: none; opacity: 1; }
  .book-sheet.bk-paged { height: 78dvh; }
  .ms-grip { display: none; }
}

/* ============================================================
   >= 1100px - FULL sidebar with labels
   ============================================================ */
@media (min-width: 1100px) {

  :root {
    --rail-w: 260px;
    --col-max: 640px;
    --page-max: 720px;
    --path-max: 580px;
  }

  .sb-logo { justify-content: flex-start; padding: 22px 20px 18px; }
  .sb-logo span { display: inline; }

  .sb-nav { padding: 12px 12px; gap: 3px; }
  .sb-item {
    flex-direction: row; justify-content: flex-start;
    gap: 12px; padding: 12px 14px; text-align: right;
  }
  .sb-item .sb-label { display: inline; }
  .sb-item .sb-short { display: none; }

  .sb-foot {
    display: flex; gap: 20px; direction: rtl;
    padding: 16px 20px; border-top: 2px solid var(--line);
  }
  .sf-stat {
    display: flex; align-items: center; gap: 5px;
    font-size: 15px; font-weight: 800; color: var(--ink);
  }

  /* counters live in the sidebar footer now - no duplicate row */
  .statbar { display: none; }

  /* ...but the statbar was also the column's top breathing room, so without
     it every tab starts flush against the viewport edge. The league is the
     clearest casualty: .lb-tier.cur is scale(1.32) translateY(-3px), so the
     enlarged badge overflows ~16px above its box and gets cut off. */
  .screen:not(.screen-full) { padding-top: 26px; }

  /* two-column choices only once the COLUMN, not the window, can hold them */
  .choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .cmp-wrap ~ .choices { display: flex; flex-direction: column; }
}

/* ============================================================
   >= 1320px - WIDE: sidebar + context aside
   ============================================================ */
@media (min-width: 1320px) {

  :root {
    --aside-w: 304px;
    --col-max: 660px;
    --page-max: 760px;
    --path-max: 600px;
  }

  .aside {
    display: flex; flex-direction: column; gap: 14px;
    width: var(--aside-w); flex-shrink: 0;
    padding: 20px 18px;
    border-right: 2px solid var(--line);
    position: sticky; top: 0; height: 100dvh;
    overflow-y: auto; direction: rtl;
  }

  .as-card {
    border: 2px solid var(--line); border-radius: 16px;
    padding: 14px; background: #fff;
  }
  .as-card h4 {
    margin: 0 0 10px; font-size: 13px; font-weight: 800;
    color: var(--gray); letter-spacing: .3px;
  }

  .as-rank {
    display: flex; align-items: center; gap: 12px; width: 100%;
    text-align: right; cursor: pointer; font-family: var(--font);
    background: none; border: 0; padding: 0;
  }
  .as-rank .rank-badge { height: 46px; width: auto; display: block; }
  .as-rank b    { display: block; font-size: 16px; color: var(--ink); }
  .as-rank span { font-size: 13px; font-weight: 600; color: var(--gray); }
  .as-rank .as-go { margin-inline-start: auto; font-size: 14px; font-weight: 800; color: var(--gray-icon); }

  .as-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .as-stat {
    display: flex; align-items: center; gap: 9px;
    border: 2px solid var(--line); border-radius: 14px; padding: 10px 11px;
  }
  .as-stat .as-v { font-size: 16px; font-weight: 800; line-height: 1.15; }
  .as-stat .as-l { font-size: 11.5px; font-weight: 700; color: var(--gray-icon); }

  .as-quest {
    width: 100%; text-align: right; cursor: pointer;
    font-family: var(--font); background: none; border: 0; padding: 0;
  }
  .as-quest-row { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
  .as-quest-row b { flex: 1; font-size: 15px; }
  .as-quest .cf-chest { width: 40px; height: 38px; }
  .as-quest-sub { font-size: 12.5px; font-weight: 700; color: var(--gray); margin-top: 8px; }

  /* the quest lives in the aside - no floating chest to collide with it */
  .chest-float { display: none; }
}

/* ============================================================
   Large displays — the shell fills the viewport at every tier,
   so the side columns have to grow with it. Otherwise "full
   width" just means a wider empty gutter around the path.

   --col-off stays correct at any shell width: with the shell at
   100vw the content spans rail..(100vw - aside), so its centre
   is 50vw + (rail - aside) / 2, which is what --col-off is.
   ============================================================ */

@media (min-width: 1600px) {
  :root {
    --rail-w: 288px;
    --aside-w: 336px;
    --col-max: 700px;
    --page-max: 860px;
    --path-max: 660px;
  }

  .sb-logo { font-size: 22px; padding: 26px 24px 20px; }
  .sb-nav  { padding: 14px 16px; }
  .sb-item { padding: 14px 16px; font-size: 16px; }
  .sb-foot { padding: 18px 24px; }

  .aside { padding: 24px 22px; gap: 16px; }
  .as-card { padding: 16px; }
}

@media (min-width: 1900px) {
  :root {
    --rail-w: 320px;
    --aside-w: 372px;
    --col-max: 760px;
    --page-max: 940px;
    --path-max: 720px;
  }

  .sb-item { font-size: 17px; }
  .q-kicker { font-size: 28px; }
  .q-stem { font-size: 21px; }
}

/* Very wide / ultrawide: stop growing the reading column and let the
   shell breathe instead, so text lines never become unreadable. */
@media (min-width: 2400px) {
  .app-shell {
    max-width: 2400px;
    box-shadow: 0 0 0 1px var(--line), 0 20px 80px rgba(0,0,0,.14);
  }
}

/* ============================================================
   UI/UX pass — the path reads as a path
   ============================================================ */
.path { position: relative; }
.path-row { z-index: 1; }

/* tighter rhythm: one more lesson per screen without crowding the labels */
.path-row { height: 128px; }
.node { margin-top: 6px; }

/* the unit header stays with you while you scroll its lessons — and only
   its lessons: .unit-block is the sticky container, so the next unit's
   banner pushes this one off instead of sliding over it */
.unit-block { position: relative; }
.unit-banner {
  position: sticky; top: 54px; z-index: 26;
  margin-top: 14px;
}

/* the question stem is a heading now, so the choices own the card look */
.q-kicker { color: var(--gray); }

@media (min-width: 1100px) {
  /* the counters are hidden at this width, so the banner docks to the top */
  .unit-banner { top: 0; }
}

@media (min-width: 768px) {
  .path-row { height: 134px; }
}

/* ============================================================
   SETTINGS
   ------------------------------------------------------------
   A hub of short pages, like a phone's own settings: your card
   on top, then grouped lists, each row a coloured icon tile on
   its lip, its name and a value. Each page opens with a back
   arrow and slides in from the side it is going to.
   ============================================================ */
.set-page { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.set-page h1 { margin-bottom: 6px; }
.set-in-fwd { animation: setInFwd .26s var(--ease) both; }
.set-in-back { animation: setInBack .26s var(--ease) both; }
@keyframes setInFwd { from { opacity: 0; transform: translateX(-28px); } }
@keyframes setInBack { from { opacity: 0; transform: translateX(28px); } }
[data-motion="reduced"] .set-in-fwd, [data-motion="reduced"] .set-in-back { animation: none; }

.set-head { display: flex; align-items: center; gap: 6px; margin: 0 -6px 4px; }
.set-head h1 { margin: 0; font-size: 22px; }
.set-back {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 12px;
  background: none; color: var(--gray-icon); cursor: pointer;
}
.set-back:hover { background: var(--surface-hover); }
.set-back:active { transform: scale(.94); }

/* your card */
.set-me {
  display: flex; align-items: center; gap: 14px; width: 100%; margin-bottom: 6px; text-align: right; cursor: pointer;
  padding: 14px 16px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 18px; background: var(--snow);
  font-family: inherit; color: var(--ink); transition: background-color .14s;
}
.set-me:hover { background: var(--surface-hover); }
.set-me:active { transform: translateY(2px); border-bottom-width: 2px; margin-bottom: 8px; }
.set-av {
  width: 58px; height: 58px; flex: none; border-radius: 50%;
  display: grid; place-items: center; background: var(--pv, var(--green)); color: var(--snow);
  font-size: 27px; font-weight: 800; box-shadow: 0 4px 0 var(--pv-dk, var(--green-lip));
}
.set-av span { transform: translateY(-2px); }
.set-av.big { width: 96px; height: 96px; font-size: 44px; box-shadow: 0 6px 0 var(--pv-dk, var(--green-lip)); }
.set-me-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.set-me-tx b { font-size: 19px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-me-tx small { font-size: 13px; font-weight: 600; color: var(--gray); }
.set-me-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.set-me-stats i {
  display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-size: 12.5px; font-weight: 800;
  padding: 1px 9px; border-radius: 99px; background: var(--surface-hover); color: var(--gray);
}
.set-me-stats .sm-fire { color: var(--orange); }
.set-me-stats .sm-xp { color: var(--gold-dk); }
.set-me-stats .rank-badge { height: 16px; width: auto; }

/* lists */
.set-lab { padding: 8px 4px 0; font-size: 13px; font-weight: 800; color: var(--gray-icon); }
.set-lab-danger { color: var(--red); }
.set-list { border: 2px solid var(--line); border-radius: 16px; background: var(--snow); overflow: hidden; }
.set-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px;
  padding: 10px 14px; border: 0; background: none; text-align: right;
  font-family: inherit; color: var(--ink);
}
.set-item + .set-item { border-top: 2px solid var(--line); }
.set-item-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.set-item-tx b { font-size: 16px; font-weight: 700; }
.set-item-tx small { font-size: 12.5px; font-weight: 600; color: var(--gray); line-height: 1.4; }
.set-link { cursor: pointer; transition: background-color .14s; }
.set-link:hover { background: var(--surface-hover); }
.set-link:active { background: var(--line); }
.set-val { font-size: 14px; font-weight: 700; color: var(--gray); white-space: nowrap; }
.set-chev { flex: none; width: 22px; height: 22px; color: var(--gray-icon); }
.set-item .rank-badge { width: auto; flex: none; }
.set-danger .set-item-tx b { color: var(--red-dk2); }

/* a flat line icon in the row's grey (the user, 2026-10-27: «wouldn't be better
   to be icons flat, not this childish icons»); only the reset is red */
.set-ic { width: 26px; height: 26px; flex: none; display: grid; place-items: center; color: var(--gray); }
.set-ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.set-ic svg .f { fill: currentColor; stroke: none; }
.set-danger .set-ic, .set-note .set-ic { color: var(--ic); }

/* the account page */
.set-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 6px; text-align: center; }
.set-hero .set-av.big { margin-bottom: 10px; animation: setPop .4s var(--ease) both; }
@keyframes setPop { from { transform: scale(.7); opacity: 0; } }
[data-motion="reduced"] .set-hero .set-av.big { animation: none; }
.set-hero-name { font-size: 22px; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; min-width: 0; }   /* a long Latin name pushed the page sideways */
.set-hero-sub { font-size: 13.5px; font-weight: 600; color: var(--gray); }
.set-hero-btn { width: auto; min-width: 150px; height: 44px; margin-top: 10px; padding: 0 22px; font-size: 15px; }
.set-hero .set-me-edit { width: 100%; }
.set-me-edit { display: flex; flex-direction: column; gap: 10px; }
.set-me-edit .login-input { margin: 0; animation: none; text-align: center; }
.set-me-btns { display: flex; gap: 8px; }
.set-me-btns .btn { height: 46px; font-size: 15px; }
.set-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 4px; }
.set-stat {
  display: flex; flex-direction: column; padding: 12px 14px; border: 2px solid var(--line); border-radius: 16px; background: var(--snow);
}
.set-stat b { font-size: 22px; font-weight: 800; color: var(--st); line-height: 1.3; }
.set-stat small { font-size: 13px; font-weight: 700; color: var(--gray); }

/* the training page: the goal as rows of question tiles, the track as two cards */
.set-goals { display: flex; flex-direction: column; gap: 10px; }
.set-goal, .set-track {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: right; cursor: pointer;
  padding: 12px 14px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 16px; background: var(--snow);
  font-family: inherit; color: var(--ink); transition: background-color .14s, border-color .14s;
}
.set-goal:active, .set-track:active { transform: translateY(2px); border-bottom-width: 2px; }
.set-goal.on, .set-track.on { border-color: var(--blue-border); background: var(--blue-light); }
.set-goal-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.set-goal-tx b, .set-track b { font-size: 16px; font-weight: 800; }
.set-goal-tx small, .set-track small { font-size: 12.5px; font-weight: 600; color: var(--gray); }
.set-goal.on .set-goal-tx b, .set-track.on b { color: var(--blue-dk); }
.set-goal .gl-grid { flex: none; }
.set-tracks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.set-track { flex-direction: column; align-items: flex-start; gap: 2px; }

/* the data page's note */
.set-note {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
  background: var(--green-bg); color: var(--ink);
}
.set-note span { display: flex; flex-direction: column; gap: 2px; }
.set-note b { font-size: 15px; font-weight: 800; color: var(--green-dk); }
.set-note small { font-size: 13px; font-weight: 600; line-height: 1.5; }

/* the about page */
.set-app { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; }
.set-app img { border-radius: 22px; box-shadow: 0 4px 0 var(--line); margin-bottom: 8px; }
.set-app b { font-size: 22px; font-weight: 800; color: var(--ink); }
.set-app small { font-size: 13.5px; font-weight: 700; color: var(--gray); }

/* the one line of the old disclaimer that has to stay somewhere a student
   can read it */
.set-foot { margin: 8px 6px 0; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--gray); line-height: 1.7; }

@media (min-width: 768px) { .set-page { max-width: 560px; } }

/* ============================================================
   EXAM DATE — calendar picker
   ------------------------------------------------------------
   Replaces the three dropdowns. Everything is scoped to
   .exam-pick and every colour comes from the app's tokens; the
   source component shipped its own copy of the Duolingo palette,
   which would have been a second source of truth for the same
   five greens.

   Motion is gated on :root[data-motion], never on the raw
   prefers-reduced-motion query — Windows reports "reduce" far
   more often than anyone means it, and this project has been
   bitten by that twice already.
   ============================================================ */
.exam-pick {
  --polar: #F7F7F7;                 /* one surface tint the palette lacks */
  --ease: cubic-bezier(.2,.8,.25,1);
  /* NOT --col-max. That is a reading measure and it reaches 760px on a wide
     display; seven columns of it make ~105px cells and a grid 630px tall, which
     pushed the save button off the bottom. A calendar's width is set by what a
     day cell should be, not by how wide the page is. */
  width: 100%; max-width: 472px; margin-inline: auto;   /* 440 of content + 2x16 gutter */
  /* one screen, no scroll: the calendar takes whatever is left after the
     header, the countdown and the footer have been paid */
  height: 100dvh;
  display: flex; flex-direction: column;
  /* .screen-full supplies no horizontal padding, so without this the title and
     both cards sit flush against the phone's edge. */
  /* the title sat almost against the status bar; give it room to breathe */
  padding: clamp(26px, 5vh, 48px) 16px calc(8px + env(safe-area-inset-bottom, 0px));
  padding-inline: max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  overflow: hidden;
}
.exam-pick h1 {
  flex: none; font-size: clamp(20px, 5.4vw, 27px); font-weight: 800;
  line-height: 1.3; margin: 0;
}

/* ---- countdown ---- */
.ep-count {
  flex: none;
  margin: clamp(8px, 1.8vh, 16px) 0 clamp(8px, 1.4vh, 14px);
  padding: clamp(10px, 1.5vh, 14px) 16px;
  background: var(--snow); border: 2px solid var(--line); border-bottom-width: 4px;
  border-radius: 16px; display: flex; align-items: center; gap: 14px;
}
.ep-badge {
  flex: none; width: clamp(52px, 8vh, 66px); height: clamp(52px, 8vh, 66px); border-radius: 18px;
  background: var(--green-bg); display: grid; place-items: center;
  font-size: 28px; font-weight: 800; color: var(--green-dk); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ep-badge.flash { animation: epBadge .52s var(--ease) .58s forwards; }
@keyframes epBadge {
  0%{transform:scale(1.22,.84)} 28%{transform:scale(.93,1.06)}
  52%{transform:scale(1.06,.97)} 76%{transform:scale(.98,1.01)} 100%{transform:scale(1,1)}
}
.ep-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ep-meta.flash { animation: epRise .4s var(--ease) .64s forwards; }
@keyframes epRise { 0%{transform:translateY(7px)} 100%{transform:none} }
.ep-unit { font-size: 18px; font-weight: 800; color: var(--green-dk); }
.ep-when { font-size: 14px; font-weight: 600; color: var(--ink); }
.ep-hijri { font-size: 13px; font-weight: 500; color: var(--gray-icon); }
.ep-count.empty .ep-badge { background: var(--polar); color: var(--gray-icon); font-size: 30px; }
.ep-count.empty .ep-unit { color: var(--gray); }

/* ---- calendar ---- */
.ep-cal {
  /* hugs its contents rather than stretching: with the grid capped near square
     a stretched card left a band of dead space under the legend */
  flex: 0 1 auto; min-height: 0;          /* min-height:0 or the grid cannot shrink */
  position: relative; background: var(--snow);
  border: 2px solid var(--line); border-bottom-width: 4px;
  border-radius: 16px; padding: clamp(8px, 1.4vh, 14px) 10px;
  display: flex; flex-direction: column;
}
.ep-top {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px clamp(6px, 1.2vh, 12px);
}
.ep-month { font-size: 19px; font-weight: 800; color: var(--ink); }
.ep-nav { display: flex; gap: 8px; }
.ep-nav button {
  width: 40px; height: 40px; border: 2px solid var(--line); border-bottom-width: 4px;
  background: var(--snow); border-radius: 14px; color: var(--blue);
  font-size: 18px; font-weight: 800; cursor: pointer; display: grid; place-items: center;
  transition: background-color .12s var(--ease), transform .08s var(--ease);
}
.ep-nav button:hover:not(:disabled) { background: var(--polar); }
.ep-nav button:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; }
.ep-nav button:disabled { color: var(--line); cursor: not-allowed; }

.ep-dow {
  flex: none; display: grid; grid-template-columns: repeat(7,1fr);
  gap: 5px; margin-bottom: clamp(4px, .8vh, 8px);
}
.ep-dow span {
  text-align: center; font-size: 12px; font-weight: 700; color: var(--gray-icon); letter-spacing: .2px;
}
.ep-dow span.we { color: #D9C48A; }

/* The rows split whatever height is left, so a 5-row month and a 6-row month
   both fill the card instead of one of them overflowing it. */
.ep-grid {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: repeat(7,1fr);
  grid-auto-rows: minmax(0, 1fr); gap: 5px;
  /* A tall phone leaves more height than seven columns are wide, and the rows
     would divide all of it — 47 wide by 70 tall reads as a list, not a
     calendar. aspect-ratio sizes the block from its own WIDTH (a percentage
     max-height cannot: percentages there resolve against height), so cells come
     out square when there is room; max-height still wins on a short window and
     lets them compress instead of overflowing. */
  flex: 0 1 auto;
  width: 100%;
  aspect-ratio: 7 / 6;
  max-height: 100%;
}
.ep-grid.slide-r { animation: epSlideR .26s var(--ease); }
.ep-grid.slide-l { animation: epSlideL .26s var(--ease); }
@keyframes epSlideR { from{transform:translateX(-16px);opacity:0} to{transform:none;opacity:1} }
@keyframes epSlideL { from{transform:translateX(16px);opacity:0} to{transform:none;opacity:1} }

/* No aspect-ratio: the cell fills its grid row. With aspect-ratio the row was
   sized from the column width, which is what made the cells enormous on a wide
   display and forced the page to scroll. */
.ep-day {
  position: relative; min-width: 0; min-height: 0;
  border: 2px solid transparent; background: transparent;
  border-radius: clamp(9px, 1.6vh, 14px); cursor: pointer; font-family: inherit;
  font-size: clamp(13px, 2vh, 16px); font-weight: 700;
  color: var(--ink); display: grid; place-items: center;
  transition: background-color .12s var(--ease), transform .08s var(--ease);
}
.ep-day.pad { visibility: hidden; }
.ep-day:hover:not(:disabled):not(.selected) { background: var(--polar); }
.ep-day:active:not(:disabled) { transform: scale(.92); }
.ep-day:disabled { color: #DEDEDE; cursor: default; }

/* the stretch of days between now and the exam — the plan, not just a range */
.ep-day.run { background: var(--green-bg); border-radius: 6px; color: #4C8B18; }
.ep-day.run.run-start { border-start-start-radius: clamp(9px,1.6vh,14px); border-end-start-radius: clamp(9px,1.6vh,14px); }
.ep-day.run.run-end { border-start-end-radius: clamp(9px,1.6vh,14px); border-end-end-radius: clamp(9px,1.6vh,14px); }
.ep-day.today {
  background: var(--blue-light); border-color: var(--blue-border); color: var(--blue-dk);
  font-weight: 800;
}
.ep-day.selected {
  background: var(--green); border-color: var(--green-dk); border-bottom-width: 4px;
  color: #fff; font-weight: 800;
}

/* the landing: crouch, launch, hang, fall, two decaying bounces */
.ep-day.jump { animation: epJump 1s both; transform-origin: bottom center; z-index: 3; }
@keyframes epJump {
  0%  {transform:translateY(0) scale(1,1);          animation-timing-function:cubic-bezier(.34,.1,.64,1)}
  8%  {transform:translateY(4px) scale(1.24,.74);   animation-timing-function:cubic-bezier(.05,.7,.1,1)}
  12% {transform:translateY(-12px) scale(.82,1.32); animation-timing-function:cubic-bezier(.1,.6,.35,1)}
  21% {transform:translateY(-34px) scale(.9,1.16);  animation-timing-function:cubic-bezier(.25,.55,.45,1)}
  32% {transform:translateY(-48px) scale(.98,1.04); animation-timing-function:cubic-bezier(.3,.5,.5,1)}
  38% {transform:translateY(-52px) scale(1,1);      animation-timing-function:cubic-bezier(.55,.05,.85,.3)}
  47% {transform:translateY(-35px) scale(.94,1.1)}
  54% {transform:translateY(-7px) scale(.86,1.22);  animation-timing-function:cubic-bezier(.4,0,.2,1)}
  58% {transform:translateY(0) scale(1.3,.7);       animation-timing-function:cubic-bezier(.1,.7,.3,1)}
  64% {transform:translateY(-16px) scale(.92,1.11); animation-timing-function:cubic-bezier(.5,.05,.8,.4)}
  71% {transform:translateY(0) scale(1.16,.86);     animation-timing-function:cubic-bezier(.1,.8,.3,1)}
  77% {transform:translateY(-5px) scale(.97,1.05);  animation-timing-function:cubic-bezier(.5,.05,.8,.4)}
  82% {transform:translateY(0) scale(1.08,.93)}
  89% {transform:translateY(-1.5px) scale(.99,1.01)}
  95% {transform:translateY(0) scale(1.02,.98)}
  100%{transform:translateY(0) scale(1,1)}
}

.ep-fx { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.ep-fx-back { z-index: 0; } .ep-fx-front { z-index: 5; }
.ep-fx .shade {
  position: absolute; border-radius: 50%;
  background: rgba(30,50,20,.3); filter: blur(2.5px); animation: epShade 1s both;
}
@keyframes epShade {
  0%{transform:scale(1,1);opacity:.22} 8%{transform:scale(1.3,1);opacity:.26}
  38%{transform:scale(.26,.6);opacity:.03} 58%{transform:scale(1.45,1.1);opacity:.3}
  64%{transform:scale(.75,.85);opacity:.12} 71%{transform:scale(1.2,1);opacity:.24}
  82%{transform:scale(1.05,1);opacity:.18} 100%{transform:scale(1,1);opacity:0}
}
.ep-fx .spark {
  position: absolute; border-radius: 50%; opacity: 0;
  animation: epSpark .5s cubic-bezier(.2,.7,.4,1) .58s both;
}
@keyframes epSpark {
  0%{transform:translate(0,0) scale(.3);opacity:1} 70%{opacity:1}
  100%{transform:translate(var(--tx),var(--ty)) scale(.2);opacity:0}
}
.ep-cal.thud { animation: epThud .24s ease-out .56s; }
@keyframes epThud { 0%,100%{transform:translateY(0)} 45%{transform:translateY(2px)} }

.ep-day.run.anim { background-color: transparent; animation: epRunIn .3s var(--ease) forwards; }
@keyframes epRunIn {
  0%  {background-color:rgba(214,255,184,0);transform:scale(1)}
  45% {background-color:var(--green-bg);transform:scale(1.18)}
  100%{background-color:var(--green-bg);transform:scale(1)}
}

.ep-legend {
  flex: none; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
  padding-top: clamp(6px, 1.2vh, 12px); margin-top: clamp(4px, 1vh, 10px);
  font-size: 12px; font-weight: 600; color: var(--gray-icon);
}
/* the first thing to go when there is genuinely no room */
@media (max-height: 620px) { .ep-legend { display: none; } }
.ep-legend i {
  display: inline-block; width: 11px; height: 11px; border-radius: 4px;
  margin-inline-end: 5px; vertical-align: -1px;
}
.ep-legend .l1 { background: var(--green); }
.ep-legend .l2 { background: var(--green-bg); }
.ep-legend .l3 { background: var(--blue-light); box-shadow: inset 0 0 0 2px var(--blue-border); }

/* ---- footer ---- */
.ep-foot {
  /* The slack goes BELOW the footer, so the button follows the calendar
     instead of floating ~100px under it. */
  flex: none; margin-top: clamp(10px, 1.8vh, 22px); margin-bottom: auto;
  padding-top: clamp(10px, 1.8vh, 22px);
  padding-bottom: 2px; border-top: 2px solid var(--line);
}
.ep-ghost {
  display: block; width: 100%; margin-top: clamp(6px, 1.2vh, 12px); padding: 6px;
  background: none; border: 0; cursor: pointer; font-family: inherit;
  font-size: 15px; font-weight: 700; color: var(--gray-icon);
}
.ep-ghost:hover { color: var(--gray); }

/* the project's motion switch, not the OS query */
:root[data-motion="reduced"] .exam-pick *,
:root[data-motion="reduced"] .exam-pick *::before,
:root[data-motion="reduced"] .exam-pick *::after {
  animation: none !important; transition: none !important;
}

/* ---- entrance ----------------------------------------------------------
   One staged sequence rather than four things appearing at once: the title
   drops in, the countdown and the calendar rise behind it, then the days
   cascade across the grid and the footer arrives last. The cascade is what
   makes it read as a calendar being dealt out; its per-cell delay is set in
   epMonth(), so it follows the real grid order including the leading pads.
   .ep-enter is removed once it has played, or every month change would
   re-run it. Reduced motion already kills all of this a few rules below. */
@keyframes epInTitle {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes epInCard {
  from { opacity: 0; transform: translateY(22px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes epInDay {
  0%   { opacity: 0; transform: scale(.45) translateY(6px); }
  70%  { opacity: 1; transform: scale(1.06) translateY(0); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes epInFoot {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.exam-pick.ep-enter > h1 {
  animation: epInTitle .5s cubic-bezier(.22,1.2,.36,1) both;
}
.exam-pick.ep-enter .ep-count {
  animation: epInCard .52s cubic-bezier(.22,1.14,.36,1) .10s both;
}
.exam-pick.ep-enter .ep-cal {
  animation: epInCard .54s cubic-bezier(.22,1.14,.36,1) .18s both;
}
.exam-pick.ep-enter .ep-day {
  /* --d is the cell's index in the grid, set in JS */
  animation: epInDay .42s cubic-bezier(.3,1.5,.45,1) calc(.30s + var(--d, 0) * 13ms) both;
}
.exam-pick.ep-enter .ep-foot {
  animation: epInFoot .46s cubic-bezier(.22,1.14,.36,1) .40s both;
}
/* the month label and arrows come with their card, not on their own clock */
.exam-pick.ep-enter .ep-top,
.exam-pick.ep-enter .ep-dow,
.exam-pick.ep-enter .ep-legend { animation: epInFoot .4s ease .26s both; }

/* ============================================================
   EXAM COUNTDOWN CARD
   ------------------------------------------------------------
   Built on the app's card idiom — 2px border, 4px bottom lip,
   18px radius — so it sits with the unit banner and the daily
   card instead of beside them. The tone class carries the whole
   escalation: one variable set per urgency band, everything else
   reads from it.
   ============================================================ */
.ec2 {
  --tone: var(--blue);
  --tone-dk: var(--blue-dk);
  --tone-bg: var(--blue-light);
  --tone-ink: var(--blue-dk);

  /* the same box as .unit-banner below it — same width formula,
     same 16px gutters. It was width:100% with no margin, so it full-bled to the
     phone's edges while every card under it was inset. */
  display: flex; align-items: center; gap: 14px;
  width: calc(100% - 32px); margin: 0 16px 14px;
  background: var(--snow); border: 2px solid var(--line); border-bottom-width: 4px;
  border-radius: 18px; padding: 13px 14px; cursor: pointer; text-align: right;
  font-family: inherit;
  transition: background-color .15s, border-color .15s, transform .07s;
  animation: fadeUp .4s ease backwards;
}
.ec2:hover { background: var(--tone-bg); border-color: var(--tone); }
.ec2:active { transform: translateY(2px); border-bottom-width: 2px; }
.ec2:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* the number is the object, not a word inside a sentence */
.ec2-num {
  flex: none; width: 66px; height: 66px; border-radius: 19px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--tone); color: #fff;
  box-shadow: 0 3px 0 var(--tone-dk);
  line-height: 1;
}
.ec2-num b {
  font-size: 29px; font-weight: 800; font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.ec2-num i {
  font-style: normal; font-size: 11.5px; font-weight: 700;
  opacity: .88; margin-top: 3px;
}
.ec2-today-ic { font-size: 30px !important; }

.ec2-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ec2-body > b { font-size: 16px; font-weight: 800; color: var(--ink); line-height: 1.35; }
.ec2-sub { font-size: 12.5px; font-weight: 600; color: var(--gray); line-height: 1.5; }
.ec2-empty .ec2-sub, .ec2-past .ec2-sub { text-wrap: balance; }

/* Readiness as ten segments. A continuous bar at 3% is a sliver that reads as
   broken, and 3% is what a student sees after their first lesson; one lit
   segment out of ten reads as "started". */
.ec2-ready { display: flex; align-items: center; gap: 9px; margin-top: 7px; }
.ec2-pips { display: flex; gap: 3.5px; flex: none; }
.ec2-pips i {
  width: 10px; height: 10px; border-radius: 3px; background: var(--line);
  transition: background-color .2s;
}
.ec2-pips i.on {
  background: var(--tone);
  animation: ec2Pip .34s cubic-bezier(.3,1.6,.45,1) calc(.18s + var(--p) * 45ms) backwards;
}
@keyframes ec2Pip {
  0%   { transform: scale(.3); background: var(--line); }
  60%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.ec2-pct {
  font-size: 11.5px; font-weight: 700; color: var(--gray-icon);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}

.ec2-go {
  flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; color: var(--gray-icon);
  transition: transform .15s ease, color .15s;
}
.ec2-chev { width: 100%; height: 100%; display: block; }
.ec2:hover .ec2-go { color: var(--tone); transform: translateX(-3px); }

/* ---- the escalation ---- */
.ec2-far    { --tone: var(--green);  --tone-dk: var(--green-lip); --tone-bg: var(--green-bg);   --tone-ink: var(--green-dk); }
.ec2-soon   { --tone: var(--gold);   --tone-dk: var(--gold-dk);   --tone-bg: #FFF6D6;           --tone-ink: var(--brown); }
.ec2-near   { --tone: var(--orange); --tone-dk: #C97600;          --tone-bg: #FFEFD6;           --tone-ink: #A35E00; }
.ec2-urgent { --tone: var(--red);    --tone-dk: var(--red-dk2);   --tone-bg: var(--red-bg);     --tone-ink: var(--red-dk2); }
.ec2-today  { --tone: var(--gold);   --tone-dk: var(--gold-dk);   --tone-bg: #FFF6D6;           --tone-ink: var(--brown); }

/* the last week reads as urgent through colour alone — a card that never stops
   moving on the home screen is a card you learn to ignore */
.ec2-urgent .ec2-body > b,
.ec2-today .ec2-body > b { color: var(--tone-ink); }

/* ---- empty and expired ---- */
.ec2-empty .ec2-num {
  background: var(--blue-light); color: var(--blue); box-shadow: 0 3px 0 var(--blue-border);
}
.ec2-past .ec2-num {
  background: var(--line); color: var(--gray-icon); box-shadow: 0 3px 0 var(--divider);
}
.ec2-empty .ec2-body > b { color: var(--blue-dk); }
.ec2-empty .ec2-plus { font-style: normal; font-size: 34px; font-weight: 700; line-height: 1; }
.ec2-past .ec2-num b { font-size: 26px; }
.ec2-empty:hover, .ec2-past:hover { background: var(--line); border-color: var(--gray-icon); }

:root[data-motion="reduced"] .ec2,
:root[data-motion="reduced"] .ec2 * { animation: none !important; }

/* This block is appended after the 768px tier, so the shorthand margin above
   outranks the centring rule there by source order. Restate it here rather
   than moving the whole block and risking the rest of the cascade. */
@media (min-width: 768px) {
  .ec2 { margin-inline: auto; }
}

/* ============================================================
   فهيم — the mascot
   ------------------------------------------------------------
   One flat PNG per emotional state plus a small motion layer. Not Rive, not
   Lottie, not a layered SVG rig — the states are art, and only the entrance
   is animated.

   HE CAN NEVER BE MIRRORED. `transform: scaleX(-1)` reverses the قدرات on his
   book, and reversed Arabic is not a stylistic choice, it is a typo the whole
   audience can read. He points to the viewer's left, so in an RTL column he
   belongs at the inline-start edge, pointing into the content — never flipped
   to face the other way.
   ============================================================ */
.mascot {
  display: block; width: auto; height: auto;
  user-select: none; -webkit-user-drag: none;
}
.mascot.pop      { animation: mascotPop .42s cubic-bezier(.3,1.6,.5,1) backwards; }
.mascot.bob      { animation: mascotBob 2.4s ease-in-out infinite; }
.mascot.bob-fast { animation: mascotBob .9s ease-in-out infinite; }   /* urgency = tempo, not new art */
.mascot.shake    { animation: mascotShake .4s ease; }

@keyframes mascotPop {
  from { transform: translateY(14px) scale(.72); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@keyframes mascotBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
@keyframes mascotShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-5px); }
  75%      { transform: translateX(5px); }
}

:root[data-motion="reduced"] .mascot { animation: none !important; }

/* ---------- the win screen: فهيم replaces the flame ----------
   Nothing behind him. The motion lives in winHeroPlay() (app.js, GSAP): a drop-in
   with a hard landing, then hop, hop, sway, again — with a live shadow. These rules
   only lay the two pieces out; he starts invisible so the drop, not the paint, is
   the first thing seen (GSAP sets opacity 1 on the first frame; without GSAP the
   reduced-motion rule below shows him still). */
.qd-hero { overflow: visible; margin-bottom: 4px; }
.qd-mascot { position: relative; z-index: 1; height: 100%; opacity: 0; will-change: transform; }
.qd-shadow {
  position: absolute; bottom: 3%; left: 50%; width: 44%; height: 7%;
  margin-left: -22%; border-radius: 50%;
  background: rgba(31, 31, 31, .16); filter: blur(1.5px);
  opacity: 0; will-change: transform;
}
@media (max-height: 700px) { .qd-hero { --wh: 196px !important; } }
:root[data-motion="reduced"] .qd-mascot, :root[data-motion="reduced"] .qd-shadow { opacity: 1; }

/* ---------- the mock exam home: steady before a hard thing ----------
   He rises into the card and plants the stick with a small settle (mhReady), then
   breathes (mhBreathe). Big on purpose: this card is the one screen a student
   opens deliberately, so he can carry it. */
.mh-hero {
  position: relative; height: 232px; margin: -4px 0 8px;
  display: flex; align-items: flex-end; justify-content: center;
}
.mh-spot {
  position: absolute; bottom: 4px; width: 210px; height: 64px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(28, 176, 246, .22), rgba(28, 176, 246, 0) 70%);
  animation: fadeUp .5s .3s ease backwards;
}
.mh-mascot {
  position: relative; height: 100%; transform-origin: 50% 100%;
  animation: mhReady .75s cubic-bezier(.25, 1.35, .4, 1) .1s backwards,
             mhBreathe 3.4s 1.2s ease-in-out infinite;
}
@keyframes mhReady {
  0%   { transform: translateY(46px) scale(.88); opacity: 0; }
  65%  { transform: translateY(-8px) scale(1.03, .98); opacity: 1; }
  82%  { transform: translateY(2px) scale(.99, 1.01); }
  100% { transform: none; opacity: 1; }
}
@keyframes mhBreathe {
  0%, 100% { transform: scale(1, 1); }
  50%      { transform: scale(1.012, 1.018) translateY(-1px); }
}
@media (max-height: 700px) { .mh-hero { height: 190px; } }
:root[data-motion="reduced"] .mh-hero * { animation: none !important; opacity: 1; }

/* ---------- "إليك ما ستحصل عليه" — first-run value screen ----------
   Modelled on the Duolingo screen in assets/mascot/reference/duolingo: a headline at
   the top, three icon/title/subtitle rows, one CTA at the bottom. */
.iv-screen { display: flex; flex-direction: column; padding: 18px 20px calc(20px + env(safe-area-inset-bottom)); }
.iv-top { display: flex; align-items: flex-start; justify-content: center; gap: 8px; margin: 8px 0 22px; }
.iv-mascot { height: 184px; flex-shrink: 0; }
/* the bubble hangs at his head, not his chest: he is the taller of the two,
   so it sits at the top of the row with a margin that lands the tail on
   the line of his glasses */
.iv-bubble {
  position: relative; align-self: flex-start; margin: 22px 0 0;
  background: var(--snow); border: 2px solid var(--line); border-radius: 16px;
  padding: 12px 15px; font-size: 17px; font-weight: 700; color: var(--ink);
  max-width: 210px; line-height: 1.5;
  animation: fadeUp .34s .1s ease backwards;
}
/* the tail points at فهيم. The bubble comes first in the row, so in RTL he
   stands at its inline-END (the left); the tail used to hang off the other
   side and point at nothing */
.iv-bubble::after,
.iv-bubble::before {
  content: ""; position: absolute; top: 50%; margin-top: -9px;
  border: 9px solid transparent; inset-inline-end: -18px;
}
.iv-bubble::before { border-inline-start-color: var(--line); }
.iv-bubble::after  { border-inline-start-color: var(--snow); margin-inline-end: 3px; }

/* The rows used to take the leftover height and stack at the top of it, which on
   a tall phone left a third of the screen blank between the last row and the
   button. The slack belongs to فهيم and the rows together — .iv-body holds the
   pair and centres it, so the button stays pinned at the bottom and the mascot
   is not stranded at the top with a void under him. */
.iv-body { display: flex; flex-direction: column; justify-content: center; flex: 1; min-height: 0; }
.iv-rows { display: flex; flex-direction: column; gap: 4px; }
.iv-row {
  display: flex; align-items: center; gap: 14px; padding: 15px 4px;
  animation: fadeUp .38s var(--d, .2s) ease backwards;
}
.iv-row + .iv-row { border-top: 2px solid var(--line); }
.iv-promise { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; margin-top: 14px; }
.iv-promise span {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px 5px 12px; border-radius: 999px;
  background: var(--green-bg); color: var(--green-dk); font-size: 13.5px; font-weight: 800;
  animation: titleIn .4s var(--d) cubic-bezier(.3,1.5,.5,1) backwards;
}
.iv-promise svg { width: 14px; height: 14px; }
:root[data-motion="reduced"] .iv-promise span { animation: none; }
.iv-ic {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.iv-purple .iv-ic { background: var(--purple-tint); }
.iv-blue   .iv-ic { background: var(--blue-light); }
.iv-gold   .iv-ic { background: #FFF3C4; }
.iv-tx { display: flex; flex-direction: column; gap: 3px; }
.iv-tx b { font-size: 16.5px; font-weight: 800; color: var(--ink); line-height: 1.35; }
.iv-tx span { font-size: 14px; font-weight: 600; color: var(--gray); line-height: 1.55; }
.iv-cta { margin-top: 18px; }

@media (max-height: 660px) {
  .iv-mascot { height: 140px; }
  .iv-bubble { margin-top: 12px; }
  .iv-row { padding: 11px 4px; }
  .iv-top { margin-bottom: 14px; }
}

/* ============================================================
   SHORT LESSONS (js/data/learn.js) — the exercise shapes.
   One idea a screen: a reveal, a choice, a tile to place, a
   keypad, pairs to match, steps to order. The option card is
   the session's own (.screen-session .choice), so the jump and
   the miss land on these exactly as they do on a question.
   ============================================================ */
.ln-area { display: flex; flex-direction: column; padding-top: 14px; }
.ln-area.lt-see { justify-content: center; }
.ln-area > .ln-tag { align-self: flex-start; }
.ln-tag {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px;
  padding: 4px 11px 3px; border-radius: 999px;
  font-size: 13px; font-weight: 800; letter-spacing: .2px;
  background: var(--purple-tint); color: var(--purple-dk);
  animation: fadeUp .3s ease backwards;
}
.ln-tag.exam { background: var(--gold-bg); color: #8A6D00; }
.ln-tag.again { background: var(--orange-bg); color: #C76F00; }
.ln-tag.recall { background: var(--blue-light); color: var(--blue-dk); }
.ln-tag img { display: block; }
.ln-q { font-size: 22px; font-weight: 700; line-height: 1.5; color: var(--ink); margin: 0 0 14px; text-wrap: pretty; }
.ln-hl { font-weight: 800; color: var(--blue-dk); background: var(--blue-light); border-radius: 8px; padding: 0 6px; }
.ln-big {
  font-size: 28px; font-weight: 800; line-height: 1.5; text-align: center; color: var(--ink);
  background: #fff; border: 2px solid var(--line); border-radius: 16px; box-shadow: 0 2px 0 var(--line);
  padding: 16px 12px; margin: 0 0 18px; letter-spacing: .5px; text-wrap: balance;
}
.ln-fig { margin: 0 0 14px; }
.ln-big.fs-m, .ln-eq.fs-m { font-size: 23px; }
.ln-big.fs-s, .ln-eq.fs-s { font-size: 19px; letter-spacing: 0; }
.ln-row.fs-m { font-size: 22px; }
.ln-row.fs-s { font-size: 18px; }
.ln-row.win.fs-m { font-size: 24px; }
.ln-pr.fs-s { font-size: 16px; }

/* the reveal: the slow way, then the trick, row by row */
.ln-see { text-align: center; }
.ln-kick { font-size: 13.5px; font-weight: 800; color: var(--li-c, var(--green)); margin-bottom: 6px; animation: fadeUp .3s ease backwards; }
.ln-h { font-size: 25px; font-weight: 700; color: var(--ink); line-height: 1.35; margin: 0 0 18px; text-wrap: balance; animation: fadeUp .35s .05s ease backwards; }
.ln-rows { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ln-row {
  font-size: 26px; font-weight: 800; line-height: 1.45; color: var(--ink);
  animation: fadeUp .45s var(--d, 0s) cubic-bezier(.3,1.3,.5,1) backwards; text-wrap: balance;
}
.ln-row.slow { font-size: 19px; font-weight: 700; color: var(--gray-icon); }
.ln-row.note { font-size: 16px; font-weight: 700; color: var(--gray); line-height: 1.6; }
.ln-row.win {
  font-size: 30px; color: var(--green-dk); background: var(--green-bg);
  border-radius: 16px; padding: 6px 18px;
}
/* a shorter phone: the reveal's rows a step closer and smaller, so the card reads at full size */
@media (max-height: 660px) {
  .ln-h { font-size: 23px; margin-bottom: 10px; }
  .ln-rows { gap: 6px; }
  .ln-row { font-size: 23px; }
  .ln-row.win { font-size: 26px; padding: 4px 16px; }
}
/* the rule the card lands on, in Duolingo's own yellow (2026-10-23: «make the
   law yellow — not the last yellow, the regular Duolingo yellow — and the
   things in the law in blue»): pale bee yellow on a bee-yellow border and lip,
   the bulb in a yellow badge, «القاعدة» and ↻ over the rule in ink. It springs
   in after the last row, the bulb wobbles and lights, the rule lands a word at
   a time, then its terms turn blue one after another and the card settles
   (rulePlay) */
.ln-rule {
  position: relative; display: flex; align-items: flex-start; gap: 14px;
  margin: 28px auto 0; max-width: 390px; padding: 16px 16px 16px 18px; text-align: start;
  background: var(--gold-bg); border: 2px solid var(--gold); border-bottom-width: 5px; border-radius: 20px;
  animation: ruleIn .55s var(--d, 0s) cubic-bezier(.3, 1.6, .5, 1) backwards;
}
@keyframes ruleIn { 0% { opacity: 0; transform: translateY(14px) scale(.9); } 60% { opacity: 1; } 100% { transform: none; } }
.ln-rule-ic {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 4px 0 var(--gold-dk);
  animation: bulbWob .6s calc(var(--d, 0s) + .45s) ease-out backwards;
}
.ln-rule-ic svg { width: 26px; height: 26px; color: var(--snow); overflow: visible; }
.ln-rule-ic svg path { fill: var(--gold-soft); animation: bulbOn .35s calc(var(--d, 0s) + .55s) ease-out backwards; }
.ln-rule.said .ln-rule-ic svg path { fill: var(--snow); transition: fill .25s; }
@keyframes bulbWob { 0% { transform: scale(.6) rotate(-20deg); } 45% { transform: scale(1.12) rotate(10deg); } 75% { transform: scale(.96) rotate(-4deg); } 100% { transform: none; } }
@keyframes bulbOn { from { fill: transparent; } }
.ln-rule-body { display: block; flex: 1; min-width: 0; }
.ln-rule-tag { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 800; line-height: 1.2; color: var(--brown); }
.ln-rule-again {
  display: grid; place-items: center; width: 30px; height: 30px; margin: -6px 0 -6px -6px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--brown); cursor: pointer;
}
.ln-rule-again svg { width: 18px; height: 18px; }
.ln-rule-again:active { transform: scale(.88); }
.ln-rule-tx { display: block; margin-top: 4px; font-size: 22px; line-height: 1.65; font-weight: 800; color: var(--ink); text-wrap: balance; }
.ln-rule.ln-rule-see { display: block; box-sizing: border-box; width: 100%; padding: 12px 10px 16px; }
.ln-rule-see .rf-head .ln-rule-again { margin: -6px auto -6px -6px; }
.ln-rule-see .ln-rule-tx {
  display: flex; flex-wrap: nowrap; justify-content: safe center; align-items: center; gap: .2em;
  margin-top: 12px; white-space: nowrap; line-height: 1.5; min-width: 0;
}
.ln-rule-see .rk { padding: 0 .3em; }
.ln-rule-see .rw.op { font-size: 1.1em; padding: 0; }
.ln-rule-see .rw-br { flex-basis: 100%; height: 0; }
.ln-rule-see .ln-rule-tx.two { flex-wrap: wrap; row-gap: .2em; white-space: normal; }
.ln-rule-see .rw { flex: none; }
.rw.par { color: var(--gray); font-weight: 700; }
.ln-rule-note { display: block; margin-top: 8px; text-align: center; font-size: 14px; font-weight: 700; color: var(--brown); }
.rw { display: inline-block; animation: rwIn .32s calc(var(--d, 0s) + .45s + var(--i) * 110ms) cubic-bezier(.3, 1.6, .5, 1) backwards; }
.rw.op { font-size: 1.2em; line-height: 1.2; color: var(--gold-dk); padding: 0 2px; }
/* a term is a blue chip like the lesson's own «اضرب» and «٥» (.ln-hl), lit in turn */
.rk { border-radius: 9px; padding: 0 7px; margin: 1px 0; line-height: 1.5; color: var(--ink); background: transparent; }
.ln-rule.said .rk { color: var(--blue-dk); background: var(--blue-light); animation: rkLit .42s calc(var(--t) * 240ms) cubic-bezier(.3, 1.6, .5, 1) backwards; }
@keyframes rwIn { 0% { opacity: 0; transform: translateY(10px) scale(.7); } 100% { opacity: 1; transform: none; } }
@keyframes rkLit { 0% { color: var(--ink); background: transparent; transform: none; } 40% { color: var(--blue-dk); background: var(--blue-light); transform: translateY(-4px) scale(1.12); } 100% { transform: none; } }

/* short answers sit in a grid: numbers are read at a glance, not down a list */
.ln-choices.ch-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.ln-choices.ch-grid.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 340px) { .ln-choices.ch-grid.n3 .choice { font-size: 16px; padding-inline: 4px; } }
.screen-session .ln-choices.ch-grid .choice { justify-content: center; text-align: center; font-size: 25px; font-weight: 700; min-height: 68px; }
.screen-session .ln-choices .choice .ch-txt { line-height: 1.4; }
.screen-session .ln-tf .choice { flex-direction: column; gap: 4px; min-height: 92px; font-size: 21px; }
.tf-ico {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-size: 19px; font-weight: 800; color: #fff;
}
.tf-ico.ok { background: var(--green); }
.tf-ico.no { background: var(--red); }
.ln-q-tf { margin-bottom: 10px; }

/* fill the step: blanks in the line, tiles under it */
.ln-eq {
  font-size: 28px; font-weight: 800; line-height: 2.1; text-align: center; color: var(--ink);
  background: #fff; border: 2px solid var(--line); border-radius: 16px; box-shadow: 0 2px 0 var(--line);
  padding: 14px 10px; text-wrap: balance;
}
.ln-eq.stacked { font-size: 24px; line-height: 1.9; padding: 10px 14px; }
.ln-eq.stacked .ln-step + .ln-step { border-top: 1px dashed var(--line); }
.ln-eq.stacked .ln-blank { height: 44px; min-width: 56px; font-size: 22px; }
/* a placed chip shrinks with its line (rfFit) to 26px tall: its tap area stays
   at least 42 by reaching 8px above and below it (the audit, 2026-10-28) */
.ln-eq .ln-blank { position: relative; }
.ln-eq .ln-blank::after { content: ""; position: absolute; left: 0; right: 0; top: -8px; bottom: -8px; }
.nw { white-space: nowrap; }
/* four blanks on one line: narrower boxes so «_ × _ × _ = _» never breaks after an operator */
.ln-eq.tight { font-size: 24px; padding-inline: 6px; }
.ln-eq.tight .ln-blank { min-width: 46px; margin: 0 2px; padding: 0 6px; font-size: 22px; }
.ln-blank {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  min-width: 62px; height: 50px; margin: 0 4px; padding: 0 10px;
  border: 2px dashed var(--gray-icon); border-radius: 12px; background: #F7F7F7;
  font: inherit; font-size: 24px; color: var(--blue-dk);
}
.ln-blank.filled { border-style: solid; border-color: var(--blue-border); background: var(--blue-light); animation: tilePop .18s ease; }
.ln-blank.right { border-color: var(--green); background: var(--green-bg); color: var(--green-dk); }
.ln-blank.wrong { border-color: var(--red); background: var(--red-bg); color: var(--red-dk2); }
.ln-blank:disabled { cursor: default; }
.ln-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.ln-tile {
  min-width: 58px; padding: 8px 16px; border-radius: 13px;
  background: #fff; border: 2px solid var(--line); border-bottom-width: 4px;
  font: inherit; font-size: 22px; font-weight: 700; color: var(--ink);
  transition: transform .06s;
}
.ln-tile:active { transform: translateY(2px); border-bottom-width: 2px; }
.ln-tile.used { background: var(--line); color: transparent; border-color: var(--line); pointer-events: none; }
.ln-tile.used .ln-hl { background: transparent; color: transparent; }
.ln-tile:disabled { cursor: default; }
@keyframes tilePop { 0% { transform: scale(.85); } 70% { transform: scale(1.06); } 100% { transform: none; } }

/* the two screens after every rule (rfBody), drawn as a fill is: the ask,
   the line in the fill's white box (the numbers screen with its example over
   a dashed rule), grey dashed blanks that turn blue, the fill's white tiles.
   rfFit keeps each line on one line. */
.rf-head { display: flex; align-items: center; gap: 8px; }
.rf-head .ln-rule-ic { width: 30px; height: 30px; box-shadow: 0 3px 0 var(--gold-dk); }
.rf-head .ln-rule-ic svg { width: 17px; height: 17px; }
.ln-eq.rf-box { box-sizing: border-box; width: 100%; min-width: 0; padding: 14px 10px; line-height: 1.2; text-wrap: nowrap; }
.rf-box .rf-ex { font-size: 24px; font-weight: 800; line-height: 1.5; color: var(--ink); white-space: nowrap; padding: 0 4px 10px; margin-bottom: 12px; border-bottom: 1px dashed var(--line); }
.rf-box .rf-ex.rf-say { white-space: normal; text-wrap: balance; font-size: 19px; line-height: 1.55; }
.rf-box .rf-ex .rf-exl { font-size: inherit; line-height: 1.2; --bh: 1.5em; }
.rf-line {
  display: flex; flex-wrap: nowrap; justify-content: safe center; align-items: center; gap: .26em; width: 100%; min-width: 0;
  font-size: 28px; font-weight: 800; line-height: 1.2; color: var(--ink); white-space: nowrap; --bh: 1.8em;
}
.rf-words .rf-line { font-size: 24px; gap: .2em; }
.rf-words .rf-line .ln-blank { padding: 0 .3em; }
.rf-line + .rf-line { margin-top: 12px; }
/* the numbers screen's steps, one under the other, a dashed rule between them as the example has (rfRows) */
.rf-num .rf-line + .rf-line { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.rf-t { display: inline-flex; align-items: center; height: var(--bh); flex: none; }
/* the absolute-value bar is drawn thin, tall and grey so «| ١» never reads as «||» (QA, 2026-11-08) */
.rf-t.abs { font-weight: 400; color: var(--gray); transform: scaleY(1.3); padding-inline: .12em; }
/* «… ÷ ٢» stacked as the exam prints a fraction (rfStack): the top over a bar over the bottom */
.ln-row { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .22em; vertical-align: middle; }
.ln-row .rf-fn, .ln-row .rf-fd { gap: .22em; }
.rf-fr { display: inline-flex; flex-direction: column; align-items: center; flex: none; }
.rf-fn, .rf-fd { display: flex; align-items: center; justify-content: center; gap: inherit; flex: none; }
.rf-line .rf-fr .rf-fn, .rf-line .rf-fr .rf-fd { gap: .26em; }
.rf-words .rf-line .rf-fr .rf-fn, .rf-words .rf-line .rf-fr .rf-fd { gap: .2em; }
.rf-fn { padding: 0 .15em .14em; border-bottom: .1em solid var(--ink); min-width: 100%; box-sizing: border-box; }
.rf-fd { padding-top: .14em; }
.rf-t.par { color: var(--gray); font-weight: 700; }
.rf-line .ln-blank {
  flex: none; height: var(--bh); min-width: 2.2em; margin: 0; padding: 0 .4em; font-size: .86em; border-radius: 12px;
  border: 2px dashed var(--gray-icon); background: #F7F7F7; color: var(--blue-dk); white-space: nowrap;
}
/* a fraction placed in a blank sits inside its height rather than spilling over it (QA, 2026-11-08: ٣/١٠ cut at both ends) */
.rf-line .ln-blank .fr, .rf-tiles .ln-tile .fr { font-size: .64em; line-height: 1; }
.rf-line .ln-blank.filled, .rf-line .ln-blank.right { border: 2px solid var(--blue-border); background: var(--blue-light); color: var(--blue-dk); }
.rf-line .ln-blank.wrong { border: 2px solid var(--red); background: var(--red-bg); color: var(--red-dk2); }
.rf-line .ln-blank.shown { border-style: solid; border-color: var(--blue-border); background: var(--snow); color: var(--blue-dk); }
.rf-line .ln-blank.right, .rf-line .ln-blank.wrong, .rf-line .ln-blank.shown { animation: none; }
.rf-hint { margin: 14px 0 0; text-align: center; font-size: 14px; font-weight: 700; color: var(--gray); }
.rf-hint:empty { display: none; }
@keyframes rfWarn { 0% { transform: scale(.8); opacity: 0; } 100% { transform: none; opacity: 1; } }
/* the help after a miss (rfHelp): a white card with the bulb, the trick's rows
   or the rule again, the word to look for in blue; tiles that belong nowhere
   in the rule turn to empty slots; the first blank still to fill pulses */
.rf-hint.help {
  display: flex; align-items: flex-start; gap: 10px; box-sizing: border-box; width: 100%; max-width: 420px;
  margin: 14px auto 0; padding: 11px 14px; border: 2px solid var(--line); border-radius: 16px; background: var(--snow);
  color: var(--ink); text-align: start; font-size: 15px; line-height: 1.5;
}
.rf-hint.help.go { animation: rfWarn .4s cubic-bezier(.3, 1.6, .5, 1); }
.rf-help-ic { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: var(--snow); }
.rf-help-ic svg { width: 17px; height: 17px; }
.rf-help-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; padding-top: 2px; }
.rf-help-tx > b:first-child { color: var(--gray); font-size: 13px; }
.rf-tr { font-size: 16px; font-weight: 800; color: var(--ink); direction: rtl; }
.rf-help-tx .ln-hl { display: inline-block; padding: 0 6px; line-height: 1.3; }   /* its tint as tall as the line, not the font's whole box (QA, 2026-11-08: it poked out of a one-line help) */
.rf-tiles .ln-tile.out { background: var(--line); border-color: var(--line); color: transparent; box-shadow: none; pointer-events: none; animation: rfOut .3s ease-out; }
@keyframes rfOut { from { transform: scale(1.06); } to { transform: none; } }
.rf-line .ln-blank.pt { border-color: var(--blue); animation: rfPt .9s ease-in-out 3; }
@keyframes rfPt { 0%, 100% { transform: none; } 45% { transform: scale(1.15); } }
:root[data-motion="reduced"] .rf-hint.help.go, :root[data-motion="reduced"] .rf-tiles .ln-tile.out,
:root[data-motion="reduced"] .rf-line .ln-blank.pt { animation: none; }
.rf-tiles .ln-tile.used { color: transparent; }
/* «كمّل الخطوة» answers each number as it lands (rfInstant): a right one stays green, فهيم says what is wrong with a wrong
   one, and the screen has no «تحقق» (its place is kept, so «متابعة» lands where every other screen's button stands) */
.rf-line .ln-blank.lk { border: 2px solid var(--green-pale); background: var(--green-bg); color: var(--green-dk); animation: none; }
.rf-hint.rf-fh { align-items: center; }
.rf-hint.rf-fh .rf-help-fh { flex: none; width: 46px; height: 46px; object-fit: contain; }
.rf-hint.rf-fh .rf-help-tx > b:first-child { color: var(--red-dk2); font-size: 15px; }
.rf-hint.rf-fh .rf-help-tx > b.ok { color: var(--green-dk); }   /* the praise after a miss is green, never the miss's red (QA, 2026-11-08) */
.ln-bw { display: inline-flex; flex-direction: column; align-items: center; vertical-align: top; line-height: 1; margin: 0 2px; }
.tc-rf { width: 100%; }
.tc-rf .tc-why { margin-top: 14px; }

/* order the steps: they land on a ruled line */
.ln-line {
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; min-height: 124px;
  padding: 8px 2px; border-radius: 4px;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 59px, var(--line) 59px, var(--line) 61px);
}
.ln-line .ln-tile { animation: tilePop .18s ease; font-size: 18px; }
.lt-order .ln-tiles .ln-tile { font-size: 18px; }
.ln-line.right .ln-tile { border-color: var(--green); color: var(--green-dk); background: var(--green-bg); }
/* Duolingo's right answer on a word chip (adWave): its correct colours —
   seaSponge face, turtle lip and border, treeFrog text — the grey slab under
   it, the pale band across its face and its two sparkles */
.ln-blank.ad-ok, .ln-line .ln-tile.ad-ok, .rf-line .ln-blank.ad-ok, .ln-eq.rf-num .ln-blank.ad-ok {
  border-style: solid; border-color: var(--green-pale); background: var(--green-bg); color: var(--green-dk);
}
.ln-blank.ad-ok .ln-hl, .ln-line .ln-tile.ad-ok .ln-hl { background: transparent; color: inherit; }
.ad-go { position: relative; z-index: 1; }
.ad-slab { position: absolute; z-index: 0; display: block; background: var(--line); opacity: 0; pointer-events: none; }
.ad-sh { position: absolute; inset: 0; z-index: -1; display: block; border-radius: inherit; overflow: hidden; pointer-events: none; }
.ad-sh b { position: absolute; top: 0; bottom: 0; left: 0; width: 38px; background: #F8FFF2; transform-origin: 0 0; translate: -200px 0; }
.ad-sp { position: absolute; z-index: 1; display: block; pointer-events: none; scale: 0; }
.ad-sp svg { display: block; width: 100%; height: 100%; fill: #F8FFF2; }
.ad-sp.a { top: 4px; left: 4px; }
.ad-sp.b { bottom: 4px; right: 4px; }
.ln-line.wrong .ln-tile { border-color: var(--red); color: var(--red-dk2); background: var(--red-bg); }

/* type it: an Arabic keypad, because recalling a number beats recognising one */
.ln-input {
  height: 66px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--blue-border); border-radius: 16px; background: #fff;
  font-size: 34px; font-weight: 800; color: var(--ink); letter-spacing: 2px;
}
/* a typed fraction stands over its bar inside the box's own height, so neither the border nor the keypad moves (QA, 2026-11-08:
   «٤/١١» ran 8px over the border) */
.ln-input .fr { font-size: .62em; line-height: 1; }
.ln-input { min-height: 61px; }
.ln-input.right { border-color: var(--green); background: var(--green-bg); color: var(--green-dk); }
.ln-input.wrong { border-color: var(--red); background: var(--red-bg); color: var(--red-dk2); }
.ln-caret { width: 3px; height: 34px; border-radius: 2px; background: var(--blue); animation: caretBlink 1s steps(1) infinite; }
@keyframes caretBlink { 50% { opacity: 0; } }
.ln-unit { text-align: center; font-size: 15px; font-weight: 700; color: var(--gray); margin-top: 6px; }
.ln-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.ln-pad > span { display: block; }
.ln-key {
  height: 52px; border-radius: 13px; background: #fff;
  border: 2px solid var(--line); border-bottom-width: 4px;
  font: inherit; font-size: 25px; font-weight: 700; color: var(--ink);
}
.ln-key:active { transform: translateY(2px); border-bottom-width: 2px; }
.ln-key.del { color: var(--gray); font-size: 21px; }
/* a short phone (320×568) fits the whole keypad above the bar */
@media (max-height: 640px) {
  .ln-pad { gap: 6px; margin-top: 8px; }
  .ln-key { height: 40px; font-size: 22px; }
}
.ln-key:disabled { opacity: .5; }

/* match pairs */
.ln-pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }   /* the right-answer wave jumps 24px: a top-row tile cleared the ask by 12 (QA, 2026-11-08) */
.ln-col { display: flex; flex-direction: column; gap: 10px; }
.ln-pr {
  min-height: 60px; padding: 8px 10px; border-radius: 15px;
  background: #fff; border: 2px solid var(--line); border-bottom-width: 4px;
  font: inherit; font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.35;
  transition: background-color .12s, border-color .12s, color .12s, opacity .3s;
}
.ln-pr.sel { background: var(--blue-light); border-color: var(--blue-border); color: var(--blue-dk); }
.ln-pr.ok { background: var(--green-bg); border-color: var(--green); color: var(--green-dk); }
.ln-pr.bad { background: var(--red-bg); border-color: var(--red); color: var(--red-dk2); }
.ln-pr.gone { background: #fff; border-color: var(--line); color: var(--line); }
.ln-pr.gone .ln-hl { background: transparent; color: var(--line); }

/* the sheet's teaching lines */
.ln-fb-note { font-size: 15.5px; font-weight: 700; color: var(--green-dk); line-height: 1.6; margin: -4px 0 4px; }
.ln-why {
  background: rgba(255,255,255,.78); border-radius: 12px; padding: 10px 12px; margin: 8px 0 4px;
  font-size: 15.5px; font-weight: 700; color: var(--ink); line-height: 1.65;
}
.feedback .fb-correct b { font-weight: 800; }
.ln-back { font-size: 13px; font-weight: 700; color: var(--red-dk2); opacity: .8; margin: 4px 0 0; }

/* the node's lessons on the win screen, and on the start bubble */
.win-steps { display: flex; justify-content: center; gap: 6px; margin: 4px 0 14px; }
.win-steps i { width: 30px; height: 9px; border-radius: 99px; background: var(--line); animation: fadeUp .3s var(--d, 0s) ease backwards; }
.win-steps i.on { background: var(--gold); }
.win-steps i.now { animation: fadeUp .3s var(--d, 0s) ease backwards, stepPop .5s calc(var(--d, 0s) + .3s) ease; }
@keyframes stepPop { 50% { transform: scaleY(1.6) scaleX(1.15); } }
.lp-sub { color: #fff; opacity: .92; font-size: 14px; font-weight: 700; margin: 2px 2px 10px; }

:root[data-motion="reduced"] .node-dia, :root[data-motion="reduced"] .node-ghost { display: none; }
:root[data-motion="reduced"] .node-ring, :root[data-motion="reduced"] .node-ring * { animation: none; }
:root[data-motion="reduced"] .ln-row, :root[data-motion="reduced"] .ln-rule, :root[data-motion="reduced"] .ln-h,
:root[data-motion="reduced"] .ln-rule-ic, :root[data-motion="reduced"] .ln-rule-ic svg path, :root[data-motion="reduced"] .rw, :root[data-motion="reduced"] .ln-rule .rk,
:root[data-motion="reduced"] .ln-kick, :root[data-motion="reduced"] .ln-tag, :root[data-motion="reduced"] .ln-blank.filled,
:root[data-motion="reduced"] .ln-line .ln-tile, :root[data-motion="reduced"] .win-steps i,
:root[data-motion="reduced"] .ln-pr.bad, :root[data-motion="reduced"] .ln-caret { animation: none; }

/* «كم تعرف عن القسم الكمي؟» — three cards, one pick, then المتابعة */
.lv-screen { justify-content: flex-start; padding-top: 56px; }
.lv-title { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.35; margin: 0 0 22px; text-wrap: balance; animation: fadeUp .35s ease backwards; }
.lv-list { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; margin-bottom: auto; }
.lv-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: right;
  padding: 14px 16px; border-radius: 16px; background: #fff;
  border: 2px solid var(--line); border-bottom-width: 4px;
  font: inherit; color: var(--ink);
  animation: fadeUp .4s var(--d, 0s) ease backwards;
  transition: background-color .12s, border-color .12s;
}
.lv-card:active { transform: translateY(2px); border-bottom-width: 2px; }
.lv-card.sel { background: var(--blue-light); border-color: var(--blue-border); }
.lv-ic { width: 46px; height: 46px; border-radius: 13px; background: #F7F7F7; display: grid; place-items: center; flex-shrink: 0; }
.lv-card.sel .lv-ic { background: #fff; }
.lv-tx { display: flex; flex-direction: column; gap: 2px; }
.lv-tx b { font-size: 18px; font-weight: 700; }
.lv-tx span { font-size: 14px; font-weight: 600; color: var(--gray); line-height: 1.5; }
.lv-card.sel .lv-tx b { color: var(--blue-dk); }
.lv-cta { margin-top: 24px; }

/* the level the check found */
.pl-level {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  margin: 2px 0 4px; animation: fadeUp .4s .3s ease backwards;
}
.pl-level span { font-size: 14px; font-weight: 700; color: var(--gray); }
.pl-level b { font-size: 34px; font-weight: 800; color: var(--gold-dk); line-height: 1.2; }
.place-row.skip { opacity: .55; }
.pl-start { font-size: 15.5px; font-weight: 700; color: var(--ink); margin: 10px 0 14px; text-align: center; }
:root[data-motion="reduced"] .lv-title, :root[data-motion="reduced"] .lv-card, :root[data-motion="reduced"] .pl-level { animation: none; }

/* ============================================================
   The first run — Duolingo's shape: a welcome that asks for nothing, then one
   question a screen under a green progress bar with a back arrow, the options
   fading up one after another, each screen sliding in from the side it is
   going to (from the left going forward, in RTL; from the right going back).
   ============================================================ */
.wl-screen { display: flex; flex-direction: column; padding: 24px 22px calc(22px + env(safe-area-inset-bottom)); }
.wl-body { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.wl-title { font-size: 40px; font-weight: 800; color: var(--green); line-height: 1.2; animation: titleIn .5s .45s cubic-bezier(.3,1.5,.5,1) backwards; }
.wl-sub { font-size: 18px; font-weight: 700; color: var(--gray); line-height: 1.6; margin: 6px 0 16px; max-width: 300px; text-wrap: balance; animation: fadeUp .4s .6s ease backwards; }
.wl-badges { margin-bottom: 0; animation-delay: .7s; }
.wl-cta { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 420px; margin: 0 auto; animation: fadeUp .4s .8s ease backwards; }
.wl-cta .btn { height: 50px; font-size: 17px; }
/* arriving from the loading screen (splashOut in app.js): the coins and the name
   are its copies until they land, then these take over; the line, the chips and
   the button come in as Brilliant reveals, a fade and a rise on its curve */
.wl-mark .qs-word { display: block; width: 150px; height: auto; margin: 0 auto; overflow: visible; }
.qs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* the screen's own entrance is cut as the hand-off starts (it is still under the loading screen):
   the name and coins fly to where the title and hero will stay, not to where they are mid-slide */
.wl-screen.wl-in { animation: none; }
.wl-in .welcome-hero, .wl-in .wl-title { animation: none; visibility: hidden; }
.wl-in.wl-landed .welcome-hero { visibility: visible; animation: welcomeFloat 4.2s 1.2s ease-in-out infinite; }
.wl-in.wl-landed .wl-title { visibility: visible; }
.wl-in .wl-sub, .wl-in .wl-badges, .wl-in .wl-cta { animation: wlRise calc(1s * var(--qs-k, 1)) cubic-bezier(.22,1,.36,1) backwards, wlFade calc(.7s * var(--qs-k, 1)) ease-out backwards; animation-delay: calc(var(--wl-d) * var(--qs-k, 1)); }
.wl-in .wl-sub { --wl-d: .46s; } .wl-in .wl-badges { --wl-d: .54s; } .wl-in .wl-cta { --wl-d: .62s; }
/* a look whose ground gathers itself into «ابدأ الآن» (--qs-exit: cta in the look): the button is where the
   ground lands, so it does not rise in; it shows once the ground is on its face and grows its lip and label */
.wl-in.wl-morph .wl-cta { animation: none; }
.wl-in.wl-morph .wl-cta .btn { visibility: hidden; }
.wl-in.wl-morph.wl-cta-on .wl-cta .btn, .wl-in.wl-morph.wl-landed .wl-cta .btn { visibility: visible; }
.wl-in.wl-morph.wl-cta-on .wl-cta .btn { animation: wlBtnIn calc(.34s * var(--qs-k, 1)) cubic-bezier(.3,1.4,.5,1) backwards; }
@keyframes wlBtnIn { from { color: transparent; box-shadow: 0 0 0 var(--green-lip); } }
@keyframes wlRise { from { translate: 0 24px; } }
@keyframes wlFade { from { opacity: 0; } }

.ob-screen { display: flex; flex-direction: column; padding: 0 20px calc(20px + env(safe-area-inset-bottom)); }
/* nothing past the phone's sides may widen the page: «جرّب»'s rule card pops in at 112% and ran 10px off
   both edges, and the phone scrolled sideways after it and back, a shake (the user, 2026-10-30). clip,
   not hidden: no scroll box, so a sticky or a scrollIntoView inside is unaffected */
.ob-screen { overflow-x: clip; }
.ob-top { display: flex; align-items: center; gap: 10px; height: 60px; flex-shrink: 0; }
.ob-back { border: 0; background: none; color: var(--gray-icon); min-width: 44px; min-height: 44px; display: grid; place-items: center; margin-inline-start: -10px; border-radius: 12px; }
.ob-back:active { background: var(--surface-hover); }
.ob-back.off { visibility: hidden; }
.ob-prog.off { visibility: hidden; }
.ob-prog { --bar-fill: var(--green); --bar-shine: rgba(255,255,255,.32); }
.ob-prog > i { transition: width .5s cubic-bezier(.3,1.4,.5,1); }
.ob-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: 14px; animation: obIn .34s cubic-bezier(.2,.9,.3,1) backwards; }
.ob-stage.rev { animation-name: obBack; }
@keyframes obIn   { from { opacity: 0; transform: translateX(-36px); } }
@keyframes obBack { from { opacity: 0; transform: translateX(36px); } }
.ob-title { font-size: 25px; font-weight: 800; color: var(--ink); line-height: 1.4; margin: 0 0 18px; text-wrap: balance; }
.ob-sub { font-size: 15px; font-weight: 600; color: var(--gray); margin: -10px 0 18px; }
.ob-note { font-size: 14px; font-weight: 600; color: var(--gray); text-align: center; margin-top: 14px; animation: fadeUp .4s calc(var(--se, .2s) + .25s) ease backwards; }
.ob-list { display: flex; flex-direction: column; gap: 10px; }
.ob-opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: start;
  min-height: 58px; padding: 12px 16px; border-radius: 16px; background: var(--snow);
  border: 2px solid var(--line); border-bottom-width: 4px; font: inherit; color: var(--ink);
  animation: fadeUp .38s var(--d, 0s) ease backwards;
  transition: background-color .12s, border-color .12s;
}
.ob-opt .ob-t { font-size: 17px; font-weight: 700; }
.ob-opt.sel, .ob-fork.sel { background: var(--blue-light); border-color: var(--blue-border); }
.ob-opt.sel .ob-t, .ob-opt.sel .ob-tx b, .ob-fork.sel .ob-tx b { color: var(--blue-dk); }
.lv { flex-shrink: 0; overflow: visible; }
.lv-track, .lv-arc { fill: none; stroke-width: 7; stroke-linecap: round; }
.lv-track { stroke: var(--line); }
.lv-arc { stroke: var(--tone); stroke-dasharray: calc(var(--f) * 1px) 200px; }
.lv-needle { stroke: var(--ink); stroke-width: 3.6; stroke-linecap: round; transform-origin: 24px 28px; transform: rotate(var(--a)); }
.lv-hub { fill: var(--ink); }
.ob-opt.sel .lv-needle { animation: lvSwing .6s cubic-bezier(.3,1.5,.5,1); }
.ob-opt.sel .lv-arc { animation: lvFill .5s ease-out; }
@keyframes lvSwing { from { transform: rotate(0deg); } }
@keyframes lvFill { from { stroke-dasharray: 0 200px; } }
.ob-tx { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ob-tx b { font-size: 17px; font-weight: 800; }
.ob-tx span { font-size: 14px; font-weight: 600; color: var(--gray); line-height: 1.5; }
.ob-tag { font-size: 14px; font-weight: 800; color: var(--gray); flex-shrink: 0; }
.ob-opt.sel .ob-tag { color: var(--blue-dk); }
.ob-input { width: 100%; font-size: 20px; height: 58px; animation: fadeUp .38s .1s ease backwards; }
.ob-forks { display: flex; flex-direction: column; gap: 14px; }
.ob-fork {
  position: relative; display: flex; align-items: center; gap: 16px; width: 100%; text-align: start;
  padding: 20px 16px; border-radius: 18px; background: var(--snow);
  border: 2px solid var(--line); border-bottom-width: 5px; font: inherit; color: var(--ink);
  animation: fadeUp .4s var(--d, 0s) ease backwards;
  transition: background-color .12s, border-color .12s;
}
.ob-art { width: 76px; height: 76px; border-radius: 20px; display: grid; place-items: center; flex-shrink: 0; }
.ob-purple { background: var(--purple-tint); }
.ob-blue { background: var(--blue-light); }
.ob-fork.sel .ob-art { background: var(--snow); }
.ob-fork .ob-tx b { font-size: 19px; }
.ob-rec {
  position: absolute; top: -12px; inset-inline-start: 16px;
  padding: 2px 10px; border-radius: 999px; background: var(--green); color: #fff;
  font-size: 12.5px; font-weight: 800; letter-spacing: .3px;
}
.ob-cta { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; flex-shrink: 0; }
.ob-cta:not(.ts-up) {
  position: sticky; bottom: 0; z-index: 3; background: var(--snow);
  margin: 0 -20px calc(-20px - env(safe-area-inset-bottom)); padding: 14px 20px calc(20px + env(safe-area-inset-bottom));
}
@media (max-height: 700px) {
  .ob-cta:not(.ts-up)::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; background: linear-gradient(transparent, var(--snow)); pointer-events: none; }
}
.ob-cta .btn { height: 50px; font-size: 17px; }
.ob-value .ob-stage { padding-top: 0; }
.iv-red .iv-ic { background: var(--red-bg); }
.pi-rows { margin-top: 4px; }
.ob-opt:active, .ob-fork:active { transform: translateY(2px); border-bottom-width: 2px; }

/* «جرّب»: one comparison item, then the swap rule shown on the numbers themselves */
.ts { display: flex; flex-direction: column; }
.ts-cmp { position: relative; display: flex; gap: 30px; margin: 2px 0 16px; animation: fadeUp .38s var(--se, .15s) ease backwards; }
.ts-box { padding: 14px 8px; transition: border-color .2s, background-color .2s, box-shadow .2s; will-change: transform; }
.ts-box .cmp-v { font-size: 23px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.ts-n, .ts-p { display: inline-block; }
.ts-n { will-change: transform; position: relative; z-index: 1; }
.ts-box .cmp-v { position: relative; }
/* where a flying number will land: its own digits, pale, under it (tasteSwap) */
.ts-ghost { position: absolute; color: var(--line); opacity: 0; pointer-events: none; }
.ts-box.same, .ts.shown .ts-box { border-color: var(--green); background: var(--green-bg); box-shadow: 0 2px 0 var(--green); }
.ts-box.same .cmp-t, .ts.shown .ts-box .cmp-t { color: var(--green-dk); }
/* between the values: a grey «؟» while it is asked, then a flat «=» of two
   green bars (no disc, no lip — the user: «replace the = with better UI not
   this 3D») */
.ts-eq { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; z-index: 2; pointer-events: none; }
.ts-q { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 24px; font-weight: 800; line-height: 1; color: var(--gray-icon); }
.ts-bar { position: absolute; left: 2px; right: 2px; height: 5px; border-radius: 3px; background: var(--green); transform: scaleX(0); }
.ts-bar:nth-of-type(2) { top: 7px; }
.ts-bar:nth-of-type(3) { bottom: 7px; }
.ts.shown .ts-q { opacity: 0; }
.ts.shown .ts-bar { transform: none; }
.ts-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ts-opt { min-height: 54px; padding: 10px 12px; justify-content: center; text-align: center; font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.ts-opt:disabled { color: var(--ink); }
.ts-opt.ok { background: var(--green-bg); border-color: var(--green); color: var(--green-dk); }
.ts-opt.dim { opacity: .5; }
/* the answer sheet: the lesson's own green sheet with the trick on it. It stands at the foot of the step from the first frame,
   hidden under «اختر إجابة» (which sits exactly where its «المتابعة» will), so the step is laid out and fitted for it; the
   answer only slides it up, as a lesson's sheet rises (the user, 2026-11-16: «not making the screen shake or jumping») */
.ob-cta.ts-up { padding-top: 0; margin: 0 -20px calc(-20px - env(safe-area-inset-bottom)); }
.ob-cta.ts-cta { position: relative; gap: 0; background: none; padding-top: 12px; }   /* the sheet's wave stands 10px over it */
.feedback.ts-fb { position: relative; bottom: auto; max-width: none; z-index: 5; box-shadow: none;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 8px 20px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(100%); visibility: hidden;
  transition: transform .2s cubic-bezier(.215,.61,.355,1), visibility 0s .2s; }
.feedback.ts-fb.show { transform: none; visibility: visible; transition: transform .2s cubic-bezier(.215,.61,.355,1), visibility 0s; }
.feedback.ts-fb.fx-anim { transition: none; }   /* the lesson's own slide (fxSheetIn) carries it, and must read it at rest */
.ts-cta .ts-wait { position: absolute; z-index: 4; left: 20px; right: 20px; width: auto; bottom: calc(18px + env(safe-area-inset-bottom)); }
.feedback.ts-fb .fb-head { font-size: 21px; gap: 8px; }
.feedback.ts-fb .fb-ok { width: 26px; height: 26px; }
.feedback.ts-fb .fb-ok svg { width: 15px; height: 15px; }
.feedback.ts-fb .btn { margin-top: 12px; height: 50px; font-size: 17px; }
/* the trick, flat on a white panel with no rim and no icon (the user, 2026-11-16: «remove the borders»,
   then the bulb): the swap rule with its two letters as flat chips — أ blue, ب purple — so the swap reads
   at a glance, then what it means */
.ts-rl { display: flex; align-items: center; margin-top: 10px; padding: 10px 14px; border-radius: 16px; background: #fff; }
.ts-rl-t { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.ts-rl-f { display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 19px; font-weight: 800; line-height: 1.3; color: var(--ink); white-space: nowrap; }
.ts-rl-s { display: inline-flex; align-items: center; gap: 3px; }
.ts-rl-f em { font-style: normal; font-size: 22px; color: var(--green-dk); }
.ts-l { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 5px; border-radius: 8px; font-style: normal; font-size: 18px; }
.ts-l.a { background: var(--blue-light); color: var(--blue-dk); }
.ts-l.b { background: var(--purple-tint); color: var(--purple-dk); }
.ts-rl-c { font-size: 13.5px; font-weight: 700; line-height: 1.4; color: var(--gray); }
.feedback.ts-fb.show:not(.still) .ts-rl { animation: fadeUp .3s .12s ease backwards; }
.feedback.ts-fb.still, .feedback.ts-fb.still * { transition: none; animation: none; }
:root[data-motion="reduced"] .ts-cmp, :root[data-motion="reduced"] .ts-rl { animation: none; }
/* a short phone: the sheet a size tighter, so the step it is fitted around reads near full size */
@media (max-height: 700px) {
  .feedback.ts-fb { padding-top: 4px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .feedback.ts-fb .fb-head { font-size: 19px; }
  .ts-rl { margin-top: 6px; padding: 7px 12px; }
  .ts-rl-f { font-size: 17px; gap: 7px; }
  .ts-l { min-width: 26px; height: 26px; font-size: 16px; }
  .ts-rl-c { font-size: 12.5px; }
  .feedback.ts-fb .btn { margin-top: 8px; height: 48px; }
  .ts-cta .ts-wait { bottom: calc(14px + env(safe-area-inset-bottom)); height: 48px; }
}

/* ---------- the level test ---------- */
.pl-segs { flex: 1; display: flex; gap: 6px; }
.pl-seg { flex: 1; height: 14px; border-radius: 64px; background: var(--line); overflow: hidden; }
.pl-seg > i { display: block; height: 100%; border-radius: 64px; background: var(--blue); transition: width .5s cubic-bezier(.3,1.4,.5,1); }
.pl-seg.done > i { background: var(--green); }
.pl-unit { display: flex; align-items: center; gap: 8px; padding: 0 18px; margin-top: 2px; font-size: 14px; font-weight: 700; color: var(--gray); }
.pl-unit b { color: var(--blue-dk); }
.pl-unit > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-unit > :not(:last-child) { white-space: nowrap; flex-shrink: 0; }
/* the unit's name wraps rather than losing its end on a narrow phone (QA, 2026-11-08: «… هامة في الق…» at 320) */
@media (max-width: 360px) { .pl-unit > span:last-child { white-space: normal; text-overflow: clip; line-height: 1.3; } }
/* the exam's own name for what is being asked: حساب / هندسة / جبر */
.pl-tag { flex-shrink: 0; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; }
.pl-ar  { background: var(--blue-light); color: var(--blue-dk); }
.pl-geo { background: var(--gold-bg); color: var(--gold-dk); }
.pl-alg { background: var(--purple-tint); color: var(--purple-dk); }
.screen-place .q-area { animation: obIn .32s cubic-bezier(.2,.9,.3,1) backwards; }
.pl-actions { display: flex; gap: 12px; }
.pl-actions .btn { flex: 1; }
/* «ما أعرف» is the teach cards' secondary button: white face, line border and lip, grey label */
.screen-place .action-bar .btn.btn-ghost, .screen-place .action-bar .btn.btn-ghost:not(:disabled) {
  flex: 0 0 38%; background: var(--snow); color: var(--gray);
  border: 2px solid var(--line); border-bottom-width: 4px;
}

/* ---------- the level test's result ---------- */
.pl-head { font-size: 26px; font-weight: 800; color: var(--ink); text-align: center; line-height: 1.35; margin: 4px 0 8px; text-wrap: balance; animation: titleIn .5s .3s cubic-bezier(.3,1.5,.5,1) backwards; }
.pl-badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px; border-radius: 999px;
  background: var(--blue-light); color: var(--blue-dk); font-size: 15px; font-weight: 700;
  animation: fadeUp .4s .45s ease backwards;
}
.pl-badge b { font-weight: 800; }
.pl-units { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 8px; margin: 12px auto 18px; }
.pl-urow {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--snow); animation: fadeUp .38s var(--d) ease backwards;
}
.pl-uic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-weight: 800; background: var(--line); color: var(--gray); }
.pl-uic svg { width: 18px; height: 18px; }
.pl-utx { display: flex; flex-direction: column; text-align: start; min-width: 0; }
.pl-utx b { font-size: 15px; font-weight: 800; color: var(--ink); }
.pl-utx span { font-size: 13px; font-weight: 600; color: var(--gray); }
.pl-urow.ok .pl-uic { background: var(--green); color: #fff; }
.pl-urow.here { border-color: var(--blue-border); background: var(--blue-light); }
.pl-urow.here .pl-uic { background: var(--blue); color: #fff; }
.pl-urow.here .pl-utx span { color: var(--blue-dk); font-weight: 700; }
.pl-urow.later { opacity: .6; }
.pl-urow.part .pl-uic { background: var(--green-bg); color: var(--green-dk); }
.pl-utx { flex: 1; }
.pl-dots { display: flex; gap: 4px; flex-shrink: 0; }
.pl-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.pl-dots i.ok { background: var(--green); }
.pl-dots i.no { background: var(--divider); }
.pl-facts { width: 100%; max-width: 360px; margin: 0 auto 6px; display: flex; flex-direction: column; gap: 4px; text-align: center; animation: fadeUp .4s 1s ease backwards; }
.pl-facts p { margin: 0; font-size: 14px; font-weight: 700; color: var(--gray); line-height: 1.55; text-wrap: balance; }
.pl-facts b { color: var(--ink); font-weight: 800; }
.pl-facts .pl-honest { font-size: 12.5px; font-weight: 600; }

:root[data-motion="reduced"] .ob-opt.sel .lv-needle, :root[data-motion="reduced"] .ob-opt.sel .lv-arc, :root[data-motion="reduced"] .wl-title, :root[data-motion="reduced"] .wl-sub,
:root[data-motion="reduced"] .wl-cta, :root[data-motion="reduced"] .ob-stage, :root[data-motion="reduced"] .ob-opt,
:root[data-motion="reduced"] .ob-fork, :root[data-motion="reduced"] .ob-note, :root[data-motion="reduced"] .ob-input, :root[data-motion="reduced"] .ob-profile .ob-cta > *,
:root[data-motion="reduced"] .screen-place .q-area, :root[data-motion="reduced"] .pl-head, :root[data-motion="reduced"] .pl-badge,
:root[data-motion="reduced"] .pl-urow { animation: none; }

/* ---------- فهيم in the first run: Duolingo's two layouts ----------
   TOP — he talks, nothing to pick: big, centred, his bubble above him with the
   tail pointing down. SIDE — he asks: small, at the bubble's inline-end (the
   left in RTL, where his open hand and pointer face the bubble — he is never
   mirrored, the book's Arabic would reverse), the answers under the pair. */
.obt { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-bottom: 8px; }
.obt-bubble {
  position: relative; margin: 0 0 20px; max-width: 330px;
  background: var(--snow); border: 2px solid var(--line); border-radius: 18px;
  padding: 14px 20px; font-size: 21px; font-weight: 800; color: var(--ink); line-height: 1.6; text-wrap: balance;
  transform-origin: 50% 100%; animation: bubPop .25s .3s cubic-bezier(.4,0,.2,1) backwards;
}
.obt-bubble::before, .obt-bubble::after {
  content: ""; position: absolute; top: 100%; left: 50%; margin-left: -11px;
  border: 11px solid transparent;
}
.obt-bubble::before { border-top-color: var(--line); }
.obt-bubble::after  { border-top-color: var(--snow); margin-top: -3px; }
.obt-duo {
  height: clamp(232px, 41vh, 340px);   /* the user, 2026-10-27: «make the mascots bigger here» — as big as the phone allows */ transform-origin: 50% 100%;
  animation: obDuoInS .55s .08s cubic-bezier(.3,1.5,.5,1) backwards, obBreathe 3.4s .8s ease-in-out infinite;
}
.obt:has(.obt-chips) .obt-duo { height: clamp(160px, 30vh, 300px); }   /* chips under him: a little less of him, so a small phone does not scroll */
@media (max-height: 620px) { .obt:has(.obt-chips) .obt-duo { height: 124px; } }
@keyframes obDuoIn { from { opacity: 0; transform: translateY(34px) scale(.82); } }
@keyframes obDuoInS { from { opacity: 0; translate: 0 34px; scale: .82; } }   /* beside obBreathe: see springInS */
@keyframes obBreathe { 50% { transform: scale(1.012, 1.02) translateY(-2px); } }
.obt-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 18px; animation: fadeUp .4s .5s ease backwards; }
.obt-chips span { padding: 5px 12px; border-radius: 999px; background: var(--blue-light); color: var(--blue-dk); font-size: 14px; font-weight: 700; }

.obs { display: flex; align-items: flex-end; gap: 4px; margin-bottom: 16px; }
.obs-say { flex: 1; min-width: 0; padding-bottom: 26px; }
.obs-bubble {
  position: relative; margin: 0;
  background: var(--snow); border: 2px solid var(--line); border-radius: 16px;
  padding: 12px 15px; font-size: 19px; font-weight: 800; color: var(--ink); line-height: 1.55; text-wrap: balance;
  transform-origin: 0% 80%; animation: bubPop .25s .3s cubic-bezier(.4,0,.2,1) backwards;
}
.obs-bubble::before, .obs-bubble::after {
  content: ""; position: absolute; bottom: 14px; inset-inline-end: -19px;
  border: 9px solid transparent;
}
.obs-bubble::before { border-inline-start-color: var(--line); }
.obs-bubble::after  { border-inline-start-color: var(--snow); margin-inline-end: 3px; }
/* the bubble pops out of its own tail, as Duolingo's does */
@keyframes bubPop { from { opacity: 0; transform: scale(.1); } }
.obs-sub { font-size: 14px; font-weight: 600; color: var(--gray); margin: 8px 4px 0; }
.obs-duo { height: 124px; flex-shrink: 0; transform-origin: 50% 100%; animation: obDuoIn .45s cubic-bezier(.3,1.5,.5,1) backwards; }

/* signing in (renderSign): Duolingo's wall, Brilliant's ways in, Duolingo's
   name step, and their avatar sealed among the shapes */
.si { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.si-screen .ob-cta .login-skip { padding-top: 10px; }
/* Brilliant's flat shapes: they pop in round whatever they frame, then float */
.si-shapes { position: absolute; inset: 0; pointer-events: none; }
.si-sh { position: absolute; width: 30px; height: 30px; animation: siShIn .55s calc(.3s + var(--k) * .07s) cubic-bezier(.3, 1.6, .5, 1) backwards; }
.si-sh svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .14)); animation: siBob var(--b, 3s) var(--bd, 0s) ease-in-out infinite alternate; }
.si-sh0 { --k: 0; --b: 3.2s; inset-inline-start: 4%; top: 14%; }
.si-sh1 { --k: 1; --b: 2.6s; --bd: -.8s; inset-inline-start: 16%; top: 62%; width: 24px; height: 24px; }
.si-sh2 { --k: 2; --b: 3.6s; --bd: -1.5s; inset-inline-end: 12%; top: 8%; width: 28px; height: 28px; }
.si-sh3 { --k: 3; --b: 2.9s; --bd: -.4s; inset-inline-end: 3%; top: 52%; }
.si-sh4 { --k: 4; --b: 3.3s; --bd: -2s; inset-inline-start: 30%; top: 0; width: 22px; height: 22px; }
.si-sh5 { --k: 5; --b: 2.8s; --bd: -1.1s; inset-inline-end: 26%; top: 80%; width: 20px; height: 20px; }
@keyframes siShIn { from { opacity: 0; transform: scale(0) rotate(-120deg); } }
@keyframes siBob { from { transform: translateY(-4px) rotate(-8deg); } to { transform: translateY(5px) rotate(8deg); } }
/* wall */
.si-wall { justify-content: center; gap: 6px; }
.si-say { position: relative; margin: 0 auto; }
.si-hero { position: relative; width: 100%; max-width: 340px; height: 230px; display: flex; justify-content: center; align-items: flex-end; }
.si-duo { position: relative; height: 210px; transform-origin: 50% 100%; animation: obDuoIn .5s .15s cubic-bezier(.3, 1.5, .5, 1) backwards; }
.si-earn { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 18px; }
.si-earn span {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px 6px; border: 2px solid var(--line); border-radius: 14px; white-space: nowrap;
  font-size: 13px; font-weight: 700; color: var(--gray); animation: fadeUp .4s calc(.8s + var(--k) * .1s) cubic-bezier(.3, 1.4, .5, 1) backwards;
}
.si-earn b { font-size: 16px; font-weight: 800; color: var(--ink); }
.si-earn img { width: 22px; height: 22px; object-fit: contain; }
/* how: Airbnb's «Log in or sign up» in our paint — فهيم where its logo stands,
   the email field, «متابعة», «أو», Google and Apple as square 3D buttons, the terms */
.si-how, .si-name, .si-pass, .si-done { justify-content: flex-start; padding-top: 8px; }
.si-fh { display: flex; justify-content: center; align-items: flex-end; height: 132px; }
.si-fh-img { height: 132px; transform-origin: 50% 100%; animation: obDuoIn .5s .1s cubic-bezier(.3, 1.5, .5, 1) backwards; }
.si-title { margin: 0; font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1.3; animation: fadeUp .4s .2s ease backwards; }
.si-how .si-title { margin-top: 10px; font-size: 24px; }
.si-sub { margin: 6px 8px 0; font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--gray); text-wrap: balance; animation: fadeUp .4s .28s ease backwards; }
.si-field { position: relative; display: block; width: 100%; margin-top: 22px; animation: fadeUp .4s .28s ease backwards; }
.si-email {
  display: block; width: 100%; height: 56px; padding: 0 16px; box-sizing: border-box;
  font-family: var(--font); font-size: 17px; font-weight: 600; color: var(--ink); text-align: left;
  background: #F7F7F7; border: 2px solid var(--line); border-radius: 14px; outline: none;
  transition: border-color .15s, background .15s;
}
.si-email:placeholder-shown { direction: rtl; text-align: right; }
.si-email::placeholder { color: var(--gray-icon); font-weight: 600; }
.si-email:focus { border-color: var(--blue-border); background: #fff; }
.si-email:focus-visible { outline: none; }
.si-field.err .si-email { border-color: var(--red); background: var(--red-bg); padding-right: 46px; }
.si-err-ic { position: absolute; right: 14px; top: 50%; translate: 0 -50%; width: 22px; height: 22px; color: var(--red); }
.si-err-ic svg { display: block; width: 100%; height: 100%; }
.si-msg { width: 100%; text-align: start; }
.si-bad { margin: 8px 4px 0; font-size: 14px; font-weight: 700; color: var(--red); }
.si-sug-h { margin: 6px 4px 0; font-size: 14px; font-weight: 800; color: var(--ink); }
.si-sug { display: block; margin: 4px auto 0; padding: 6px 10px; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 800; color: var(--blue); cursor: pointer; }
.si-go { width: 100%; margin-top: 14px; animation: fadeUp .4s .34s ease backwards; }
.si-or { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 20px; font-size: 14px; font-weight: 700; color: var(--gray); animation: fadeUp .4s .4s ease backwards; }
.si-or::before, .si-or::after { content: ""; flex: 1; height: 2px; background: var(--line); }
.si-squares { display: flex; justify-content: center; gap: 14px; margin-top: 16px; }
.si-sq {
  display: grid; place-items: center; width: 68px; height: 62px; padding: 0; color: var(--ink); background: var(--snow);
  border: 2px solid var(--line); border-bottom-width: 5px; border-radius: 16px; cursor: pointer;
  animation: fadeUp .4s .46s cubic-bezier(.3, 1.4, .5, 1) backwards;
}
.si-sq + .si-sq { animation-delay: .52s; }
.si-sq svg { width: 26px; height: 26px; }
.si-sq:active { transform: translateY(3px); border-bottom-width: 2px; margin-top: 3px; }
.si-terms { margin: 18px 8px 0; font-size: 13px; font-weight: 600; line-height: 1.6; color: var(--gray); text-align: center; text-wrap: balance; animation: fadeUp .4s .58s ease backwards; }
.si-terms a { color: var(--ink); font-weight: 800; text-decoration: none; }
.ob-cta .si-terms { margin-top: 12px; animation: none; }
/* name and password: Duolingo's steps — the question on the start side, the fields under it */
.si-name, .si-pass { align-items: stretch; text-align: start; }
.si-q { margin: 6px 0 0; font-size: 24px; font-weight: 800; line-height: 1.35; color: var(--ink); animation: fadeUp .4s .1s ease backwards; }
.si-pair { margin-top: 18px; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: #F7F7F7; animation: fadeUp .4s .18s ease backwards; }
.si-in { display: block; width: 100%; height: 54px; padding: 0 16px; box-sizing: border-box; border: 0; background: transparent; font-family: var(--font); font-size: 17px; font-weight: 600; color: var(--ink); outline: none; }
.si-in + .si-in { border-top: 2px solid var(--line); }
.si-in::placeholder { color: var(--gray-icon); font-weight: 600; }
.si-in:focus { background: #fff; }
.si-in.err { background: var(--red-bg); animation: shake .4s ease; }
.si-hint { margin: 8px 4px 0; font-size: 14px; font-weight: 600; color: var(--gray); }
.si-name .si-go { margin-top: 18px; }
.si-pass .si-field { margin-top: 18px; animation-delay: .18s; }
.si-pw .si-email { padding-right: 54px; }
.si-eye { position: absolute; right: 6px; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--blue); cursor: pointer; }
.si-eye svg { width: 24px; height: 24px; }
.si-rule { display: flex; align-items: center; gap: 7px; margin: 10px 4px 0; font-size: 14px; font-weight: 700; color: var(--gray); transition: color .2s; }
.si-rule svg { width: 18px; height: 18px; padding: 2px; box-sizing: border-box; border-radius: 50%; background: var(--line); transition: background .2s; }
.si-rule.ok { color: var(--green-dk); }
.si-rule.ok svg { background: var(--green); }
/* done: فهيم leaps in under his bubble, then what was saved is stamped green */
.si-done { justify-content: center; gap: 4px; }
.si-hero-done { height: 214px; }
.si-joy { display: block; transform-origin: 50% 100%; }
.si-duo.si-leap { animation: siLeap .9s .12s cubic-bezier(.3, 1.2, .5, 1) backwards; }
@keyframes siLeap {
  0% { opacity: 0; translate: 0 70px; scale: .7 .7; }
  30% { opacity: 1; translate: 0 -34px; scale: .94 1.08; }
  55% { translate: 0 6px; scale: 1.1 .9; }
  75% { translate: 0 -8px; scale: .98 1.03; }
  100% { translate: 0 0; scale: 1 1; }
}
.si-done-go { animation: fadeUp .4s 2.6s ease backwards; }
/* the done screen: «هدفك ٩٩٪» */
.sd .si-hero-done { height: 196px; }
.sd .si-duo { height: 186px; }
.sd-cap { margin: 16px 8px 0; font-size: 15px; font-weight: 700; color: var(--gray); line-height: 1.6; text-wrap: balance; animation: fadeUp .4s calc(var(--se, .9s) + .3s) ease backwards; }
.sd-cap b { color: var(--ink); font-weight: 800; }
/* 2 ٩٩ */
.sd-goal { display: flex; flex-direction: column; align-items: center; margin-top: 4px; animation: fadeUp .4s var(--se, .9s) ease backwards; }
.sd-lab { font-size: 15px; font-weight: 800; color: var(--gray); }
.sd-goal b { font-size: 76px; font-weight: 800; line-height: 1.05; color: var(--ink); }
.sd-ish { font-size: 18px; font-weight: 800; color: var(--green-dk); opacity: 0; translate: 0 6px; }
.sd-goal.hit b { color: var(--green); animation: sdHit .5s cubic-bezier(.3, 1.6, .5, 1); }
.sd-goal.hit .sd-ish { opacity: 1; translate: 0 0; transition: opacity .3s .1s, translate .3s .1s; }
@keyframes sdHit { 0% { scale: 1; } 35% { scale: 1.25 .85; } 65% { scale: .94 1.06; } 100% { scale: 1; } }
:root[data-motion="reduced"] .sd-cap, :root[data-motion="reduced"] .sd-goal { animation: none; }
:root[data-motion="reduced"] .si-sh, :root[data-motion="reduced"] .si-sh svg, :root[data-motion="reduced"] .si-duo, :root[data-motion="reduced"] .si-earn span,
:root[data-motion="reduced"] .si-fh-img, :root[data-motion="reduced"] .si-title, :root[data-motion="reduced"] .si-sub, :root[data-motion="reduced"] .si-field,
:root[data-motion="reduced"] .si-go, :root[data-motion="reduced"] .si-or, :root[data-motion="reduced"] .si-sq, :root[data-motion="reduced"] .si-terms,
:root[data-motion="reduced"] .si-q, :root[data-motion="reduced"] .si-pair, :root[data-motion="reduced"] .si-leap,
:root[data-motion="reduced"] .si-done-go { animation: none; }
.ob-say .w { opacity: 0; transition: opacity .18s ease; }
.ob-say .w.on { opacity: 1; }
.ob-say .hl { color: var(--blue-dk); }
/* .complete h1 is the win screen's gold title; his bubble is not a title */
.complete h1.pl-say { margin: 4px 0 2px; font-size: 19px; color: var(--ink); letter-spacing: 0; }
.place-scene .pl-say + * { margin-top: 6px; }
.complete.place-scene { justify-content: flex-start; overflow: hidden; padding-top: 18px; }
.place-scene .pl-units { gap: 6px; margin: 10px auto 12px; }
.place-scene .pl-urow { padding: 8px 12px; }
/* the button stays in reach under the unit list, as it does on every win screen */
.place-scene .action-bar.pl-cta {
  position: sticky; bottom: 0; max-width: 360px; margin-top: auto;
  padding: 12px 0 calc(14px + env(safe-area-inset-bottom)); background: var(--snow);
}
/* a shorter phone: فهيم a size down and the rows closer, so the result reads at full size (nothing scrolls) */
@media (max-height: 780px) {
  .complete.place-scene { padding-top: 8px; }
  .place-scene .qd-hero { --wh: 92px !important; }
  .complete h1.pl-say { font-size: 17px; line-height: 1.45; }
  .place-scene .pl-units { gap: 5px; margin: 8px auto 8px; }
  .place-scene .pl-urow { padding: 6px 12px; gap: 10px; }
  .place-scene .pl-uic { width: 28px; height: 28px; }
  .place-scene .pl-utx b { font-size: 14px; }
  .place-scene .pl-utx span { font-size: 12.5px; }
  .place-scene .pl-facts p { font-size: 13px; line-height: 1.45; }
  .place-scene .action-bar.pl-cta { padding-top: 8px; }
}
@media (max-height: 660px) {
  .complete.place-scene { padding-bottom: 12px; }
  .place-scene .qd-hero { --wh: 72px !important; }
  .place-scene .obt-bubble.pl-say { padding: 10px 14px; }
  .place-scene .pl-units { gap: 4px; margin: 6px auto 6px; }
  .place-scene .pl-urow { padding: 4px 12px; }
  .place-scene .pl-facts p { font-size: 12.5px; line-height: 1.4; }
}

:root[data-motion="reduced"] .obt-duo, :root[data-motion="reduced"] .obs-duo, :root[data-motion="reduced"] .obt-bubble,
:root[data-motion="reduced"] .obs-bubble, :root[data-motion="reduced"] .obt-chips { animation: none; }
:root[data-motion="reduced"] .ob-say .w { opacity: 1; transition: none; }

/* ---------- the win screen (lessonComplete): stars thrown by فهيم, the
   lesson ticked off like a task, the stats that flatter ---------- */
.wn { justify-content: flex-start; padding: 18px 16px 0; overflow: hidden; }
.wn-top { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; }
.wn .qd-hero { margin-bottom: 0; }
.wn .win-stars { gap: 14px; margin: 4px 0 8px; position: relative; }
.wn .wstar { width: 54px; height: 54px; transform: none; animation: none; will-change: transform; }
.wn .wstar:nth-child(2) { margin-top: -12px; }
.wn .wstar svg path { fill: var(--line); stroke: var(--line); transition: fill .08s, stroke .08s; }
.wn .wstar.on svg path { fill: var(--gold); stroke: var(--gold); }
.wn .wstar.on { filter: drop-shadow(0 4px 0 var(--gold-dk)); }
.wstar-fly { position: absolute; left: 0; top: 0; width: 54px; height: 54px; z-index: 5; pointer-events: none; filter: drop-shadow(0 4px 0 var(--gold-dk)); }
.wstar-fly svg { display: block; width: 100%; height: 100%; }
.wstar-fly svg path { fill: var(--gold); stroke: var(--gold); }
.win-stars { --star-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Cpath d='M22 4.2l5.6 12.1 13.2 1.4-9.9 8.9 2.8 13-11.7-6.6-11.7 6.6 2.8-13-9.9-8.9 13.2-1.4z' stroke='%23000' stroke-width='5' stroke-linejoin='round'/%3E%3C/svg%3E"); }
/* a clean run: one light sweep across the three, masked to the stars */
.win-stars.shine .wstar.on { position: relative; }
.win-stars.shine .wstar.on::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.85) 50%, transparent 65%);
  background-size: 300% 100%; background-position: 120% 0;
  -webkit-mask: var(--star-mask) center / contain no-repeat; mask: var(--star-mask) center / contain no-repeat;
  animation: wnShine .9s ease-out forwards;
}
@keyframes wnShine { to { background-position: -40% 0; } }
.wn-say { font-size: 19px; font-weight: 700; color: var(--gray); margin: 0 0 22px; line-height: 1.5; max-width: 330px; text-wrap: balance; }

.wn-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.wn-tx > b { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 16px; font-weight: 800; color: var(--ink); }
.wn-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wn-next { font-size: 13px; font-weight: 700; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wn-task.full .wn-next { color: var(--green-dk); }
.wn .action-bar.wn-cta {
  position: sticky; bottom: 0; width: 100%; max-width: 360px; margin-top: auto;
  padding: 10px 0 calc(14px + env(safe-area-inset-bottom)); background: var(--snow);
  display: flex; flex-direction: column; gap: 10px;
}
@media (max-height: 760px) { .wn .qd-hero { --wh: 160px !important; } .wn .wstar, .wstar-fly { width: 46px; height: 46px; } }
:root[data-motion="reduced"] .win-stars.shine .wstar.on::after { animation: none; display: none; }

/* ---------- the win screen's own pieces (winPlay, A.winMore) ----------
   Duolingo's lesson-complete layout: a gold title, a grey line under it, then
   three stat cards a colour each — a white label on its colour strip over a
   white body with the number in the colour. The XP card turns grey at zero. */
.wn .win-action .btn, .wp .win-action .btn { animation: none; }
.wn .win-action .btn::after, .wp .win-action .btn::after { animation: none; display: none; }
.complete h1.wn-title {
  margin: 4px 0 8px; font-size: 32px; line-height: 1.15; letter-spacing: 0; color: var(--gold);
  text-shadow: 0 2px 0 rgba(200, 140, 0, .25); will-change: transform;
}

/* «تقدّمك اليوم»: what the lesson did to the day, a card at a time */
.wp { justify-content: flex-start; padding-top: 48px; }
/* a short phone: «المسار» sat under the fold on «تقدّمك اليوم» (320×568) */
@media (max-height: 620px) { .wp { padding-top: 18px; } .wp-list { gap: 10px; } }
.cl { justify-content: flex-start; padding-top: 44px; }
/* the league climb (A.winClimb): the board in a window that follows your row */
.cl-kick { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; color: var(--gray); animation: fadeUp .4s cubic-bezier(.3,1.2,.5,1) backwards; }
.cl-kick .rank-badge { height: 30px; width: auto; }
.cl-rank { display: flex; flex-direction: column; align-items: center; margin-top: 12px; line-height: 1; }
.cl-rank > span { font-size: 14px; font-weight: 800; color: var(--gray-icon); margin-bottom: 6px; }
/* «مركزك»: the podium medal's drawing at 96px, its number in HTML on the disc
   (so it can roll, clipped to the disc) */
.cl-medal { position: relative; width: 96px; height: 98.3px; transform-origin: 50% 80%; animation: clMedalIn .6s .15s cubic-bezier(.3,1.6,.5,1) backwards; }
.cl-medal svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .08)); }
.cl-mn { position: absolute; left: 49%; top: 47.8%; width: 64%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; }
.cl-mn b { display: grid; place-items: center; font-size: 36px; font-weight: 800; line-height: 1; color: var(--mi); padding-top: 4px; }
.cl-msh { position: absolute; top: -10%; bottom: -10%; left: -60%; width: 35%; background: rgba(255, 255, 255, .7); transform: skewX(-20deg); pointer-events: none; }
.cl-medal.shine .cl-msh { animation: clMsh .6s .25s ease-in-out; }
@keyframes clMsh { from { left: -60%; } to { left: 130%; } }
@keyframes clMedalIn { 0% { transform: scale(.3) rotate(-14deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
/* a number rolling over in its cell (clRoll) */
.cl-roll { display: inline-grid; overflow: hidden; vertical-align: middle; }
.cl-roll > span { grid-area: 1 / 1; display: inline-flex; align-items: center; justify-content: center; }
.cl-mn .cl-roll { overflow: visible; }
.complete h1.cl-title { font-size: 28px; color: var(--gold-dk); margin: 14px 0 2px; letter-spacing: 0; opacity: 0; transform: scale(.6); }
.complete h1.cl-title.go { animation: clPop .55s cubic-bezier(.3,1.6,.5,1) forwards; }
@keyframes clPop { 0% { opacity: 0; transform: scale(.6); } 60% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
/* 12px wider than the board on each side and the board CLIMB_PAD (16px) down
   from its top, so the lifted row (×1.06) and its shadow are never cut; the
   fades are set by climbPlay (--ft / --fb), only where rows run on past an edge */
.cl-win {
  position: relative; box-sizing: border-box; width: calc(100% + 24px); max-width: 404px; height: 326px; margin: 0 -12px 8px; overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 var(--ft, 0px), #000 calc(100% - var(--fb, 40px)), transparent);
  mask-image: linear-gradient(transparent, #000 var(--ft, 0px), #000 calc(100% - var(--fb, 40px)), transparent);
}
.cl-list { position: absolute; top: 16px; left: 12px; right: 12px; }
/* a shorter phone: the board starts higher, then shows four rows instead of five (nothing scrolls) */
@media (max-height: 700px) { .cl { padding-top: 20px; } }
@media (max-height: 660px) { .cl-win { height: 264px; } }
@media (max-height: 620px) {
  .cl { padding-top: 16px; }
  .cl-win { height: 202px; }
  .cl-medal { width: 72px; height: 73.7px; }
}
.cl-row.me .lb-name { color: var(--brown-dk); }
.cl-row.me .lb-name b { color: var(--brown); }
.cl-row { position: absolute; left: 4px; right: 4px; height: 58px; background: var(--snow); transition: top .36s cubic-bezier(.3, 1.5, .5, 1); }
/* your row: Duolingo's gold on its darker lip, no border (2026-10-26: no
   border; 2026-10-27: «make my name background yellow, nice yellow» over the
   pale cream band), its ink dark brown; lifted, its shadow follows its speed
   (climbPlay) */
.cl-row.me { z-index: 2; background: var(--gold-bg); border-radius: 14px; box-shadow: inset 0 0 0 2px var(--gold), 0 3px 0 var(--gold); }
.cl-row.me.up { box-shadow: inset 0 0 0 2px var(--gold), 0 3px 0 var(--gold), 0 12px 22px rgba(170, 120, 0, .28); }
.cl-row.me .lb-rank, .cl-row.me .lb-xp, .cl-row.me .lb-xp b, .cl-row.me .lb-xp i { color: var(--brown-dk); }
.cl-row .lb-xp b, .cl-row .lb-xp i { display: inline-block; }
.cl-rk { display: inline-flex; width: 30px; justify-content: center; flex-shrink: 0; }
.cl-shine { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.cl-shine i { position: absolute; top: -20%; bottom: -20%; width: 40%; left: -50%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .85), transparent); transform: skewX(-18deg); }
.cl-row.me.shine .cl-shine i { animation: clShine .8s .15s ease-in-out; }
@keyframes clShine { from { left: -50%; } to { left: 120%; } }
.cl-cta { opacity: 0; transform: translateY(18px); pointer-events: none; }
.complete.cl .action-bar.cl-cta { box-sizing: border-box; width: 100%; max-width: 452px; padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); }
.cl-cta.go { opacity: 1; transform: none; pointer-events: auto; transition: opacity .3s .5s, transform .45s .5s cubic-bezier(.3,1.4,.5,1); animation: clCtaWait .6s; }
/* the button takes no tap until it has faded in */
@keyframes clCtaWait { from, to { pointer-events: none; } }
:root[data-motion="reduced"] .cl-kick, :root[data-motion="reduced"] .cl-row, :root[data-motion="reduced"] .cl-medal { animation: none; transition: none; }
.complete h1.wp-title { font-size: 27px; color: var(--gold); margin: 0 0 22px; letter-spacing: 0; }
.wp-list { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.wp-card {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: start;
  border-radius: 18px; border: 2px solid var(--line); border-bottom-width: 4px; background: var(--snow);
  transition: border-color .3s, background-color .3s; will-change: transform;
}
/* a quest card as Duolingo's session end has it (view_daily_quest_session_end_item):
   its title (H2) over the quest bar, the bar's chest on its far end */
.wp-card.wp-quest { flex-direction: column; align-items: stretch; gap: 10px; padding: 16px 16px 14px; }
.wq-h { display: block; font-size: 19px; font-weight: 800; line-height: 1.3; color: var(--ink); }
.wp-card .wn-name { display: block; }
/* the highlight face Duolingo's card flashes as it swells (300ms) */
.wp-card.lit { background: #FFFDF2; border-color: var(--gold-soft); transition-duration: .1s; }
/* the lesson ticked off in its stage */
.wp-card.wn-task.lit { background: var(--snow); border-color: var(--line); }
.wn-task.done { border-color: var(--green); background: var(--green-bg); }
.wn-check { width: 38px; height: 38px; flex-shrink: 0; }
.wn-check svg { display: block; width: 100%; height: 100%; overflow: visible; }
.wn-ring { fill: var(--snow); stroke: var(--line); stroke-width: 3; transition: fill .2s, stroke .2s; }
.wn-task.done .wn-ring { fill: var(--green); stroke: var(--green); }
.wn-tick { fill: none; stroke: var(--snow); stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.wn-task.done .wn-tx > b { color: var(--green-lip); }
.wn-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wn-count { display: inline-block; flex-shrink: 0; font-size: 14px; color: var(--gray); font-variant-numeric: tabular-nums; }
.wn-task.done .wn-count { color: var(--green-lip); }
.wn-bar { position: relative; display: flex; gap: 4px; }
.wn-bar i { position: relative; flex: 1; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.wn-bar i.on { background: var(--gold); }
.wn-bar i u { position: absolute; inset: 0; border-radius: inherit; background: var(--green); transform-origin: right center; transform: scaleX(0); }
.wn-bar i.now u { transform: scaleX(1); }
.wn-task.full .wn-bar i, .wn-task.full .wn-bar i.on { background: var(--green); }
.wn-fx { position: absolute; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 2; }
.wn-task.done .wn-next { color: var(--green-dk); }
.wp-quest.full { border-color: var(--gold); background: var(--gold-bg); }
.wp-quest.full .wq-h { color: var(--gold-dk); }
/* the chest cropped to its drawing (12 75 236 192 of its 260 × 290) so it sits
   centred on the bar's far end, the bar running in under its middle */
.cpb-end > svg.wp-chest { width: 50px; height: 41px; flex-shrink: 0; overflow: visible; }
.wp-quest .cpb-track { margin-left: -25px; }

/* Duolingo's quest bar (ChallengeProgressBarView): the app's bar at 20px, the
   count centred in it — juicyHare over the track, --cpb-ink over the fill, cut
   at the fill's edge — and a 46px end icon over its far end, the bar running
   30% of the way into it */
.cpb { position: relative; display: flex; align-items: center; height: 46px; }
.cpb-track { position: relative; flex: 1; min-width: 0; margin-left: -14px; z-index: 0; }
.cpb-bar { position: relative; display: block; height: 20px; }
.cpb-bar > i { animation: none; min-width: 0; }
.cpb-bar > i::after { top: 4px; height: 6px; right: 16px; left: 16px; border-radius: 6px; background: var(--bar-shine); opacity: .55; }
.cpb-tx {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; line-height: 1; color: #AFAFAF; font-variant-numeric: tabular-nums;
  padding-top: 2px; pointer-events: none; white-space: nowrap;
}
.cpb-tx.on { color: var(--cpb-ink, #fff); }
.cpb-end { position: relative; z-index: 1; flex: none; width: 46px; height: 46px; display: grid; place-items: center; }
.cpb-end > svg { width: 46px; height: 46px; }
/* the particle and the sparkles: Duolingo's sizes (90 / the bar + 24, ×1.5 tall) */
.cpb-fx { position: absolute; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 2; }
.cpb-part { position: absolute; left: -45px; top: -45px; width: 90px; height: 90px; display: block; }
.cpb-spark { position: absolute; left: -12px; right: -12px; top: 50%; display: block; pointer-events: none; z-index: 2; }
.cpb-part svg, .cpb-spark svg { display: block; }
.wp-gem { position: relative; width: 46px; height: 46px; display: grid; place-items: center; flex-shrink: 0; }
/* Duolingo's gem pile (wgLoad): four times the slot, centred on it, so the
   drop starts above the card */
.wp-gem-rv { position: absolute; left: 50%; top: 50%; width: 176px; height: 176px; transform: translate(-50%, -54%); pointer-events: none; visibility: hidden; }
.wp-gem.rv .wp-gem-rv { visibility: visible; }
.wp-gems .wp-gem { margin-inline-start: 14px; }   /* the large pile stays inside its card (QA, 2026-11-08: it spilled over the rim) */
.wp-gem.rv > .ic { visibility: hidden; }
.wp-gems .wn-tx > b { font-size: 19px; color: var(--blue-dk); }
.wp .wn-cta { position: sticky; bottom: 0; width: 100%; max-width: 380px; margin-top: auto; padding: 12px 0 calc(14px + env(safe-area-inset-bottom)); background: var(--snow); display: flex; flex-direction: column; gap: 10px; }
.wn { padding-top: 8px; }
.wn .wst-row { margin-bottom: 0; }
.wn .wn-cta { margin-top: auto; }

/* «كم سؤال تبي تحل يومياً؟»: Duolingo's plain goal rows. Each draws its goal
   as a grid of question tiles (glTiles), five to a row, so the 20 is visibly
   four times the 5; the picked row's tiles turn blue and ripple (glWave) */
.gl-list { gap: 14px; }
.gl-list .ob-opt { position: relative; gap: 14px; min-height: 86px; padding: 14px 16px; }
.gl-list .ob-tx span { font-size: 13.5px; }
.gl-grid { flex-shrink: 0; width: 76px; display: grid; grid-template-columns: repeat(5, 12px); gap: 4px; justify-content: center; align-content: center; }
.gl-grid i { width: 12px; height: 12px; border-radius: 4px; background: var(--gl-c, var(--disabled)); box-shadow: inset 0 -2px 0 var(--gl-s, var(--gray-shadow));
  transition: background-color .2s calc(var(--k) * 12ms), box-shadow .2s calc(var(--k) * 12ms); }
.gl-g5 { --gl-c: var(--green); --gl-s: var(--green-dk); }
.gl-g10 { --gl-c: var(--gold); --gl-s: var(--gold-dk); }
.gl-g20 { --gl-c: var(--orange); --gl-s: var(--orange-dk); }
.gl-list .ob-opt.sel .gl-grid i { --gl-c: var(--blue); --gl-s: var(--blue-dk); }
.gl-grid i.hop { animation: glHop .36s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes glHop { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-6px) scale(1.15, .9); } 70% { transform: translateY(1px) scale(.95, 1.08); } 100% { transform: none; } }
:root[data-motion="reduced"] .gl-grid i.hop { animation: none; }
/* the tag is a chip: grey at rest, blue on the picked row */
.gl-tag { flex-shrink: 0; font-size: 13px; font-weight: 800; color: var(--gray); background: var(--polar, #F7F7F7); border: 2px solid var(--line); border-radius: 99px; padding: 1px 10px; }
.gl-list .ob-opt.sel .gl-tag { color: var(--blue-dk); background: var(--snow); border-color: var(--blue-border); }
/* «الأكثر اختياراً»: a small pill centred on the middle row's top edge */
.gl-list .ob-opt:nth-child(2) { margin-top: 6px; }
.gl-badge { position: absolute; top: -12px; left: 50%; translate: -50% 0; white-space: nowrap; z-index: 2; font-size: 12px; font-weight: 800; color: var(--snow);
  background: var(--gold-dk); border-radius: 99px; padding: 0 12px; line-height: 22px; box-shadow: 0 2px 0 var(--brown);
  animation: glBadge .45s calc(var(--d, 0s) + .4s) cubic-bezier(.3, 1.6, .5, 1) backwards; }
.gl-list .ob-opt.sel .gl-badge { background: var(--blue); box-shadow: 0 2px 0 var(--blue-dk); }
@keyframes glBadge { from { transform: scale(0) rotate(-8deg); } }
/* his reaction to a goal runs a line longer than the question: the bubble keeps
   that room from the start, so the list never shifts under a jumping card */
.ob-goal .obs-bubble { min-height: calc(3 * 1.55em + 28px); }

/* ---------- the victory (winPlay): Duolingo's lesson-complete file
   (assets/fx/lesson-complete.riv) drawn edge to edge over the top of the
   screen down to where its stats begin, فهيم flying where Duo flies, and the
   HTML title and subtitle at the file's own places for when it cannot play ---------- */
.complete.wn { justify-content: flex-start; padding-top: 0; }
.wv-lc { position: relative; flex: none; width: calc(100% + 32px); margin: 0 -16px; height: clamp(300px, 52vh, 460px); }
.wv-rive { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; opacity: 0; }
.wn.rv-on .wv-rive { opacity: 1; }
.wv-fh { position: absolute; left: 0; top: 0; transform-origin: 50% 50%; z-index: 1; will-change: transform; pointer-events: none; }
.wv-fh-in { width: 100%; height: 100%; }
.wv-qd { width: 100%; height: 100%; }
.complete h1.wv-title, .wv-sub { position: absolute; left: 16px; right: 16px; margin: 0; translate: 0 -50%; text-align: center; }
.complete h1.wv-title { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: 0; color: var(--gold); text-shadow: none; }
.wv-sub { font-size: 19px; font-weight: 700; line-height: 1.35; color: var(--gray); text-wrap: balance; }
.wn.rv-wait .wv-title, .wn.rv-wait .wv-sub, .wn.rv-on .wv-title, .wn.rv-on .wv-sub { visibility: hidden; }
.wn .wst-wrap { margin-top: 8px; }
/* the file draws on the whole screen (a perfect run floods it cyan, then lets it go), so nothing under the band cuts it off */
.wn .wst-wrap, .wn .action-bar.wn-cta { z-index: 1; }
.wn .wst-wrap { position: relative; }
.wn .action-bar.wn-cta { background: transparent; }


/* Duolingo's stat cards (stat_component_72_lc_refresh.riv and the legacy
   view_short_lesson_stat_card): three at 28% with 4% between, radius 16, the
   white label on the colour strip, a white body 2px in, icon 24, value 21.
   The body carries its own 2px outline so it reads as a pill before the strip
   rises; --ha / --hb are the pale halo around the pill and then the card. */
.wst-row { display: flex; justify-content: center; gap: 4%; width: 100%; max-width: 390px; margin: 0 auto; }
/* Duolingo's own card file (wstLoad) draws over the row, which stays for
   screen readers and as the fallback; the canvas is the compiled artboard's
   375×134 at the row's width */
.wst-wrap { position: relative; width: 100%; max-width: 390px; margin: 0 auto; }
.wst-rive { position: absolute; left: 0; top: 50%; width: 100%; aspect-ratio: 375 / 134; transform: translateY(-50%); pointer-events: none; opacity: 0; }
.wst-wrap.rive-on .wst-rive { opacity: 1; }
.wst-wrap.rive-on .wst-row { opacity: 0; }
.wst { position: relative; flex: 0 0 28%; height: 100px; }
.wst-pop {
  --hb: 0; position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  border-radius: 16px; box-shadow: 0 0 0 calc(8px * var(--hb)) var(--wt); will-change: transform;
}
.wst-bg { position: absolute; inset: 0; border-radius: 16px; background: var(--wc); }
.wst-t {
  position: relative; width: 100%; height: 30px; display: grid; place-items: center; color: var(--snow);
  font-size: 13.5px; font-weight: 800; white-space: nowrap;
}
.wst-t > span { display: block; }
.wst-v {
  --ha: 0; position: relative; margin: 0 2px 2px; width: calc(100% - 4px); height: 66px; flex-shrink: 0; border-radius: 14px; background: var(--snow);
  box-shadow: 0 0 0 2px var(--wc), 0 0 0 calc(2px + 8px * var(--ha)) var(--wt);
  display: grid; place-items: center; color: var(--wc); font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.wst-in { display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.wst-v .ic, .wst-v svg { width: 24px; height: 24px; flex-shrink: 0; }
.wst-shine { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; pointer-events: none; }
.wst-shine i { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.6) 50%, transparent 65%); transform: translateX(-140%); }
.wst-gl { position: absolute; width: 19px; height: 19px; opacity: 0; pointer-events: none; color: var(--wg); }
.wst-gl svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.wst-g1 { top: -6px; inset-inline-end: -4px; }
.wst-g2 { top: 12px; inset-inline-end: -8px; width: 12px; height: 12px; }
.wst-g3 { bottom: -6px; inset-inline-start: -4px; width: 15px; height: 15px; }
.wst-gold  { --wc: var(--gold); --wt: #FFF3C4; --wg: #FFD43B; }
.wst-gold .wst-v { color: var(--gold-dk); }
.wst-green { --wc: var(--green); --wt: #D7FFB8; --wg: #8EE04E; }
.wst-blue  { --wc: var(--blue);  --wt: #DDF4FF; --wg: #6CCBF8; }
.wst-gray  { --wc: var(--gray-icon); --wt: #F0F0F0; --wg: #D0D0D0; }
.wst-gray .wst-v .ic { filter: grayscale(1); }

/* ============================================================
   «فهيم يتحدّاك» — the path's top once an exam date is set (fqCard
   in app.js; the user picked it from tools/home-top.html round 4):
   فهيم beside a bubble with one quick question and two answers.
   The exam's days moved to the stat bar (.stat-exam).
   ============================================================ */
.fq { position: relative; display: flex; align-items: flex-end; gap: 8px; width: calc(100% - 32px); margin: 0 16px 14px; min-height: 150px; animation: fqRise .45s cubic-bezier(.25,1.1,.4,1) backwards; }
.fq-guy { flex: none; width: 96px; height: 150px; padding: 0; margin: 0; background: none; border: 0; cursor: pointer; transform-origin: 50% 100%;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; animation: fqIn .5s .1s cubic-bezier(.3,1.5,.5,1) backwards; }
.fq-guy .mascot { display: block; width: 150px; height: 150px; margin: 0 -27px; object-fit: contain; object-position: bottom; pointer-events: none; transform-origin: 50% 100%; animation: fqBreath 3s 1s ease-in-out infinite; }
.fq-guy:active .mascot { transform: scale(1.05, .92); animation: none; }
.fq-guy:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 12px; }
.fq-guy.hop { animation: fqHop .45s cubic-bezier(.3,1.4,.5,1); }
.fq-guy.sad { animation: fqNo .45s ease-in-out; }
.fq-bub { flex: 1; min-width: 0; position: relative; align-self: center; background: var(--snow); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 18px; padding: 8px 12px 10px; }
.fq-bub::after { content: ""; position: absolute; right: -9px; top: 26px; width: 13px; height: 13px; background: var(--snow);
  border-right: 2px solid var(--line); border-top: 2px solid var(--line); transform: rotate(45deg); border-radius: 0 3px 0 0; }
.fq-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fq-q { font-size: 22px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.fq-run { display: flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 800; color: var(--orange); opacity: 0; transition: opacity .2s; }
.fq-run.on { opacity: 1; }
.fq-run img { width: 16px; height: 16px; }
.fq-run.bump { animation: fqHop .4s ease-out; }
.fq-ch { display: flex; gap: 8px; margin-top: 6px; }
.fq-b { flex: 1; font: 800 19px/1 var(--font); color: var(--ink); background: var(--snow); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 12px;
  padding: 9px 0 7px; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: opacity .2s; }
.fq-b:active { transform: translateY(2px); border-bottom-width: 2px; }
.fq-b:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.fq-b.ok { background: var(--green-bg); border-color: var(--green-pale); color: var(--green-dk); }
.fq-b.bad { background: var(--red-bg); border-color: var(--red-soft); color: var(--red-dk2); animation: fqShake .4s; }
.fq-b.dim { opacity: .4; }
.fq-say { font-size: 13px; font-weight: 800; color: var(--gray); margin-top: 6px; min-height: 18px; }
.fq-say em { font-style: normal; color: var(--green-dk); }
.fq-w { display: inline-block; opacity: 0; transform: translateY(3px); animation: fqWord .2s calc(var(--i) * .09s) ease-out forwards; }
.fq-in { animation: fqRise .3s ease-out; }
@keyframes fqRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fqWord { to { opacity: 1; transform: none; } }
@keyframes fqIn { from { transform: translateY(30px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fqHop { 0% { transform: none; } 22% { transform: scale(1.06, .88); } 52% { transform: translateY(-18px) scale(.96, 1.06); } 78% { transform: scale(1.04, .94); } 100% { transform: none; } }
@keyframes fqNo { 0%, 100% { transform: none; } 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
@keyframes fqShake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-4px); } }
@keyframes fqBreath { 0%, 100% { transform: none; } 50% { transform: scaleY(1.025) translateY(-1px); } }
:root[data-motion="reduced"] .fq, :root[data-motion="reduced"] .fq * { animation: none !important; transition: none !important; }
:root[data-motion="reduced"] .fq-w { opacity: 1; transform: none; }

/* the exam's days in the stat bar, coloured as the old card was by how near it is */
.stat-exam { background: none; border: 0; padding: 0; margin: 0; font: inherit; font-weight: 700; line-height: 1; color: var(--tone-ink); cursor: pointer; gap: 5px; }
.stat-exam:active { transform: translateY(1px); }
.stat-exam:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
.cal-ic { width: 23px; height: 23px; flex: none; }
.cal-ic .ci-b { fill: var(--snow); stroke: var(--tone); stroke-width: 2.2; }
.cal-ic .ci-h { fill: var(--tone); }
.cal-ic .ci-r { fill: none; stroke: var(--tone-dk); stroke-width: 2.4; stroke-linecap: round; }
/* no date yet: a calendar page with a green «+» on its corner; every few seconds it gives a small nudge and
   the badge pops, so the empty slot asks to be tapped */
.stat-exam-add { width: 40px; height: 40px; justify-content: center; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.cal-add { width: 34px; height: 34px; overflow: visible; transform-origin: 50% 90%; animation: caNudge 4.5s 1.2s ease-in-out infinite; }
.cal-add .ca-lip { fill: var(--blue-dk); }
.cal-add .ca-face { fill: var(--snow); stroke: var(--blue); stroke-width: 2; }
.cal-add .ca-head { fill: var(--blue); }
.cal-add .ca-ring { fill: var(--blue-dk); stroke: var(--snow); stroke-width: 1.4; }
.cal-add .ca-cell { fill: var(--blue-light); }
.cal-add .ca-badge { transform-origin: 26px 26px; animation: caBadge 4.5s 1.2s ease-out infinite; }
.cal-add .ca-badge circle { fill: var(--green); stroke: var(--snow); stroke-width: 2.4; }
.cal-add .ca-badge path { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; }
.stat-exam-add:active .cal-add { animation: none; transform: scale(.9); }
@keyframes caNudge { 0%, 84%, 100% { transform: none; } 88% { transform: rotate(-9deg) scale(1.06); } 92% { transform: rotate(7deg) scale(1.06); } 96% { transform: rotate(-3deg); } }
@keyframes caBadge { 0%, 84%, 100% { transform: none; } 90% { transform: scale(1.25); } 95% { transform: scale(.95); } }
:root[data-motion="reduced"] .cal-add, :root[data-motion="reduced"] .cal-add .ca-badge { animation: none; }

/* ---- shorter phones: last in the file, so they win over every rule they tighten ---- */
/* a shorter phone: «كم سؤال تبي تحل يومياً؟» brings its rows a step closer (nothing scrolls) */
@media (max-height: 660px) {
  .ob-stage { padding-top: 6px; }
  .obs { margin-bottom: 10px; }
  .gl-list { gap: 10px; }
  .gl-list .ob-opt { min-height: 78px; padding: 10px 16px; }
  .ob-note { margin-top: 8px; }
}
/* the smallest phones (320×568 and the like): every step a size more compact, so it fits
   at or near full size instead of being zoomed small (nothing scrolls, the user, 2026-10-29) */
@media (max-height: 600px) {
  /* a question */
  .q-top { margin: 4px 0 8px; }
  .q-stem { font-size: 18px; line-height: 1.55; margin-bottom: 10px; }
  .screen-session .choices { gap: 8px; }
  .screen-session .slot { min-height: 52px; }
  .screen-session .choice { padding: 8px 12px; font-size: 17px; }
  .cmp-wrap { margin: 4px 0 8px; }
  .cmp-box { padding: 8px; }
  .cmp-box .cmp-v { font-size: 18px; }
  /* the first run: فهيم at the side a size down, the rows closer */
  .obs-duo { height: 92px; }
  .obs-say { padding-bottom: 16px; }
  .ob-list { gap: 8px; }
  .ob-opt { min-height: 50px; padding: 8px 14px; }
  .gl-list { gap: 8px; }
  .gl-list .ob-opt { min-height: 66px; padding: 8px 14px; }
  .gl-list .ob-opt:nth-child(2) { margin-top: 4px; }
  .ob-cta { padding-top: 8px; }
  /* «وش هو قدراتي؟» */
  .iv-top { margin: 0 0 8px; }
  .iv-mascot { height: 120px; }
  .iv-row { padding: 9px 4px; }
  .iv-tx b { font-size: 15.5px; }
  .iv-tx span { font-size: 13px; line-height: 1.45; }
  .iv-promise { margin-top: 8px; }
  /* the reveal */
  .ln-h { font-size: 21px; margin-bottom: 8px; }
  .ln-row { font-size: 21px; }
  .ln-row.win { font-size: 24px; }
  .ln-big { padding: 10px; margin-bottom: 10px; }
  .ln-area { padding-top: 4px; }
  .ln-rule.ln-rule-see { padding: 8px 10px 10px; }
  /* signing in: فهيم a size down on the wall */
  .si-hero { height: 164px; }
  .si-duo { height: 150px; }
  .si-earn { margin-top: 8px; }
  /* the level test's result */
  .place-scene .qd-hero { --wh: 60px !important; }
  .complete h1.pl-say { font-size: 15.5px; }
  .place-scene .pl-urow { padding: 3px 10px; }
  .place-scene .pl-utx b { font-size: 13.5px; }
  .place-scene .pl-utx span { font-size: 12px; }
}
/* the sign-in wall's three chips stay on one row at 320 wide (QA, 2026-11-08) */
@media (max-width: 350px) { .si-earn { gap: 4px; } .si-earn span { padding-inline: 8px; font-size: 13px; } .si-earn b { font-size: 14px; } .si-earn img { width: 18px; height: 18px; } }
/* the mock's answers in their own sheet: a list of up to fifty that may run long, with each question's review under it */
.ask-sheet.mock-sheet { max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain; text-align: right; }
.mock-sheet .mk-ans-sub { margin: 2px 0 12px; color: var(--gray); font-weight: 700; font-size: 14px; }
.mock-sheet .fb-solution { max-height: none; overflow: visible; }   /* the sheet scrolls, never a box inside it (QA, 2026-11-08: solutions cut mid-line) */
.mock-sheet #mkAnsOk { margin-top: 14px; width: 100%; position: sticky; bottom: 4px; z-index: 1; }   /* stays in sight while a long solution scrolls (QA, 2026-11-08) */
.mock-ans-btn { width: 100%; }
/* no word left alone on a paragraph's last line («كان»، «٩.»; QA, 2026-11-08) */
body { text-wrap-style: pretty; }
/* the mock's result fits the phone (QA, 2026-11-08: 76% at 402 × 874, scrolling at 320 × 568): the section rows sit tight,
   the flame comes down a size on a phone and gives its room to the numbers on a short one */
.mock-result .result-cards { gap: 12px; margin-bottom: 14px; }
.mock-result .mock-note { margin-bottom: 10px; }
.mock-result .card { padding-block: 12px 8px; margin-bottom: 12px; }
.mock-result .card h3 { margin-bottom: 4px; }
.mock-result .dom-stat { padding: 2px 0; margin-bottom: 4px; }
.mock-result .dom-stat .ds-head { font-size: 14px; margin-bottom: 3px; }
.mock-result .mock-ans-btn { margin-bottom: 12px; }
.mock-result .fail-actions { gap: 8px; }
@media (max-height: 920px) { .mock-result .win-hero { --wh: 112px !important; margin-bottom: 4px; } }
@media (max-height: 700px) {
  .mock-result { padding-top: 14px !important; }
  .mock-result .win-hero { display: none; }
  .mock-result .win-sub { margin-bottom: 10px; }
  .mock-result .rcard .rc-v { height: 50px; }
}
/* no tab bar under the mock's result, so none of its room either: the 96px it kept were zoomed for as content */
.screen:has(> .mock-result) { padding-bottom: 0; }
/* the floating chest takes less of a narrow path: it sat on a lesson title at 320 and 375 (QA, 2026-11-08); `scale`, so its hop keeps the GPU */
@media (max-width: 380px) { .chest-float { scale: .8; transform-origin: 0 100%; } }
/* a miss on a phone this short says only what is wrong and where; the rule is one tap away under «القانون» (QA, 2026-11-08: help at 8px on ops at 320 × 568) */
@media (max-height: 600px) { .rf-hint.rf-fh .rf-help-fh, .rf-hint.rf-fh .rf-tr { display: none; } }
/* a question with a figure on a short phone: the figure gives way first, so the stem and choices stay readable instead of the whole
   question zooming to two thirds (QA, 2026-11-08: the mock at .66 on 320 × 568) */
@media (max-height: 760px) { .screen-session .q-figure { margin: 6px 0 8px; } .screen-session .q-figure svg { max-height: 30vh; width: auto; } }
@media (max-height: 600px) { .screen-session .q-figure svg { max-height: 16vh; } }
.ln-nw { white-space: nowrap; }
/* on a short phone «كمّل الخطوة»'s help is one tight line under the tiles (««٦» مو هنا. هذا مكان … — …»), so a miss costs the
   step as little room as it can (QA, 2026-11-08: the step zoomed from .72 to .61 at 320 × 568) */
@media (max-height: 600px) {
  .rf-hint.help.rf-fh { margin-top: 8px; padding: 6px 10px; font-size: 14px; line-height: 1.35; }
  .rf-hint.rf-fh .rf-help-tx > :not(.rf-tr) { display: inline; }
  .rf-hint.rf-fh .rf-help-tx > * + * { margin-inline-start: .3em; }
}
/* the fail screen's shake never scrolls the page sideways (QA, 2026-11-08: scrollX −9 twice on «نفدت القلوب!») */
html:has(.fail-scene), body:has(.fail-scene) { overflow-x: clip; }
.ri-fig { margin: 8px 0; } .ri-fig svg { max-height: 160px; width: auto; max-width: 100%; }
/* «كمّل الخطوة» keeps its help's room from the start, so a miss, and the «صح!» after it, never move the card and the tiles
   under the finger (QA, 2026-11-08: the tiles jumped 50–160px up and back on each miss); the help is one size on that screen */
.screen-session:has(.rf-chk) #rfHint { min-height: 88px; box-sizing: border-box; flex: none; }
@media (min-height: 701px) { .screen-session:has(.rf-chk) #rfHint { min-height: 96px; } }   /* the second miss's three lines are 92px on a tall phone (QA, 2026-11-08) */
@media (max-height: 600px) { .screen-session:has(.rf-chk) #rfHint { margin-top: 8px; } }   /* empty or filled, the same gap, so the first miss moves nothing */   /* never squeezed under its text; held as tall as the help gets, so a miss never moves the tiles under the finger (QA, 2026-11-08) */
.screen-session:has(.rf-chk) #rfHint:empty { display: block; visibility: hidden; }
.screen-session:has(.rf-chk) #rfHint.help { align-items: center; font-size: 14px; line-height: 1.4; }
/* room for the help's two lines at its largest, so nothing under the finger moves on a miss (QA, 2026-11-08: 7px at 375, 25px at 320) */
@media (max-height: 700px) { .screen-session:has(.rf-chk) .rf-hint.help.rf-fh { padding: 8px 10px; } }
.screen-session:has(.rf-chk) .q-area > #rfHint { margin-bottom: auto; }   /* filled or empty, so the column stays centred where it was */
/* a «كمّل الخطوة» chain of three or four steps on a short phone: its rows sit closer, so solved it stays whole above the
   sheet instead of scrolling its ask under the bar (QA, 2026-11-08: lesson 2's chain at 320 × 568) */
@media (max-height: 600px) {
  .screen-session .ln-eq.rf-box { padding: 8px 8px; }
  .screen-session .rf-box .rf-ex { font-size: 20px; padding-bottom: 6px; margin-bottom: 6px; }
  .screen-session .rf-num .rf-line + .rf-line { margin-top: 2px; padding-top: 2px; }
}
@media (max-height: 600px) { .screen-session:has(.rf-chk):has(.feedback.good.show) .q-area > .rf-q { visibility: hidden; } }
/* solved, the help's reserve is let go: the tiles are gone and nothing more will be said under them (QA, 2026-11-08: the box pushed under the top bar at 320) */
.screen-session:has(.rf-chk):has(.feedback.good.show) .q-area > #rfHint { visibility: hidden; }
@media (max-height: 700px) { .screen-session:has(.rf-chk):has(.feedback.good.show) .q-area > .rf-q { visibility: hidden; } }

/* the sign-in steps on a short phone: فهيم and the gaps give way first, so the fields read at full size */
@media (max-height: 700px) {
  .si-fh, .si-fh-img { height: 104px; }
  .si-field { margin-top: 16px; }
  .si-or { margin-top: 14px; }
  .si-squares { margin-top: 12px; }
  .si-terms { margin-top: 12px; }
}
@media (max-height: 600px) {
  .si-fh, .si-fh-img { height: 72px; }
  .si-how .si-title { margin-top: 4px; font-size: 21px; }
  .si-field { margin-top: 12px; }
  .si-email { height: 50px; }
  .si-bad, .si-sug-h { margin-top: 4px; }
  .si-sug { padding: 2px 10px; }
  .si-go { margin-top: 10px; }
  .si-or { margin-top: 10px; }
  .si-squares { margin-top: 10px; }
  .si-sq { width: 62px; height: 54px; }
  .si-terms { margin-top: 10px; font-size: 12.5px; }
}
/* the chest's gems flying home to the stat bar (gemFly) */
.gem-fly { position: fixed; inset: 0; z-index: 10001; pointer-events: none; }
.gf { position: absolute; display: block; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .14)); will-change: translate, scale; }
.gf svg { display: block; width: 100%; height: 100%; }
.stat-xp.gf-bump { animation: gfBump .28s cubic-bezier(.3, 1.6, .5, 1); }
.stat-xp.gf-done { animation: gfDone .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes gfBump { 0% { scale: 1; } 40% { scale: 1.22; } 100% { scale: 1; } }
@keyframes gfDone { 0% { scale: 1; } 35% { scale: 1.35; } 70% { scale: .94; } 100% { scale: 1; } }
