/* css/fonts.css */
/* self-hosted fonts (SIL Open Font License, see fonts/LICENSE-Heebo.txt). One face, Heebo, as a
   variable font: one file for Hebrew and one for Latin letters, digits and punctuation cover every
   weight from 100 to 900 (task x7, "the line"). The site uses 400/500 for text, 700 for bold and
   800 for titles and big numbers. Two files, so few requests on a first visit. */
@font-face { font-family: 'Heebo'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../fonts/heebo-hebrew-wght-normal.woff2) format('woff2'); unicode-range: U+0307-0308,U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../fonts/heebo-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* css/base.css */
/* =====================================================================
   מ־200 ל־800 — design system (tokens + components), task x7, "the line"
   The world: the way from 200 to 800 is a line, and the day is a line
   with stations. Home opens on a dark band where the estimated score is
   a sun-yellow dot on the 200–800 line; today's tasks are stations on a
   teal route; every practice round runs along a line of stations.
   White page, hairline cards, teal actions, sun yellow only for "you".
   One face: Heebo (800 for display and numbers, 400/500 for text).
   DESIGN.md at the repo root describes the system.
   ===================================================================== */

:root {
  /* ground and ink */
  --bg: #FFFFFF;
  --surface: #FFFFFF;      /* controls: inputs, answer options */
  --card: #FFFFFF;         /* a card is white with a hairline (see .card) */
  --fill: #F3F5F7;         /* soft blocks: list hover, tiles in a group, numbers, the "why" box */
  --fill-2: #E8ECF0;       /* tracks, pressed rows, a block inside a block */
  --fg: #111417;
  --muted: #5E6670;
  --line: #E3E6EA;
  --line-2: #EDF0F2;
  --line-strong: #B8C0C8;
  /* actions are teal; links, selection and focus too */
  --primary: #1B6E8C;
  --primary-ink: #FFFFFF;
  --primary-hover: #165C75;
  --accent: #1B6E8C;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3F1F6;
  --accent-hover: #165C75;
  /* the logo keeps its own teal tile */
  --logo: #1B6E8C;
  /* the band: the dark top of the home screen, the first screen and the hubs' main card */
  --band: #13181D;
  --band-2: #1F262D;
  --band-line: #343D46;
  --band-fg: #FFFFFF;
  --band-muted: #AEB6BF;
  /* the route: the line the stations sit on (travelled part solid, the rest soft) */
  --route: #1B8AAE;
  --route-soft: #C6E3EE;
  --route-ink: #111417;    /* a practice round's travelled line */
  /* subject badges: one colour per subject, a white icon on each (4.5:1 or more) */
  --cv-quant: #C2410C;
  --cv-verbal: #7C3AED;
  --cv-words: #0F62D6;
  --cv-exam: #1B6E8C;
  --cv-plain: #111417;
  --cv-done: #087650;
  /* big brand surfaces: the first screen */
  --brand: var(--band);
  --brand-ink: #FFFFFF;
  /* sun yellow is "you": the score dot, the streak, a new note */
  --mark: #FFD23F;
  --mark-soft: #FFF4CC;
  --mark-ink: #13181D;
  --ok: #087650;
  --ok-soft: #E3F4EC;
  --bad: #C8232F;
  --bad-soft: #FCE8EA;
  --warn: #8F5400;
  --warn-soft: #FFF0D2;
  /* text on a filled green / red bubble */
  --ok-ink: #FFFFFF;
  --bad-ink: #FFFFFF;
  /* callouts: a tip is a sun wash, a warning an amber one */
  --tip-bg: #FFF8DB;
  --tip-line: transparent;
  --warn-bg: var(--warn-soft);
  --warn-line: transparent;
  /* the WhatsApp group link when it is an outline (5:1 on the page) */
  --wa-ink: #0E7A40;
  --wa-soft: rgba(14, 122, 64, .08);
  /* data series (charts and figures only, not decoration) */
  --c1: #7C3AED;           /* verbal */
  --c2: #C2410C;           /* quantitative */
  --c3: #1B6E8C;           /* exams */
  --c4: #087650;
  --c1-soft: #EFE7FD;
  --c2-soft: #FBE9DF;
  --c3-soft: #E3F1F6;
  --c4-soft: #E3F4EC;
  /* depth: flat by default; only things that float (sheets, toasts, menus) cast a shadow */
  --shadow-sm: 0 1px 2px rgba(17, 20, 23, .06);
  --shadow: 0 2px 8px rgba(17, 20, 23, .06), 0 10px 24px rgba(17, 20, 23, .06);
  --shadow-lg: 0 4px 12px rgba(17, 20, 23, .1), 0 24px 56px rgba(17, 20, 23, .22);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 10px;
  --font-display: "Heebo", "Arial Hebrew", "Segoe UI", Tahoma, sans-serif;
  --font-text: "Heebo", "Arial Hebrew", "Segoe UI", Tahoma, sans-serif;
  --fw-display: 800;
  /* type roles: one fixed scale */
  --fs-cap: 13px;
  --fs-sm: 14px;
  --fs-body: 16px;
  --fs-lead: 17px;
  --fs-h4: 17px;
  --fs-h3: 20px;
  --fs-h2: 24px;
  --fs-h1: 30px;
  --fs-hero: 52px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --nav-h: 66px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0D1114;
    --surface: #151B20;
    --card: #12171B;
    --fill: #182027;
    --fill-2: #212A33;
    --fg: #ECF0F3;
    --muted: #9AA5B0;
    --line: #263038;
    --line-2: #1D252C;
    --line-strong: #4A5662;
    --primary: #1B6E8C;
    --primary-ink: #FFFFFF;
    --primary-hover: #22809F;
    --accent: #5FB8D6;
    --accent-ink: #0D1114;
    --accent-soft: #16303A;
    --accent-hover: #7FCAE3;
    --band: #161D23;
    --band-2: #222A32;
    --band-line: #36404A;
    --band-muted: #9AA5B0;
    --route: #2FA3CC;
    --route-soft: #1E3C49;
    --route-ink: #ECF0F3;
    --mark: #FFD23F;
    --mark-soft: #3A3218;
    --mark-ink: #13181D;
    --ok: #3DD39A;
    --ok-soft: #10291F;
    --bad: #FF6B76;
    --bad-soft: #3A181E;
    --warn: #F3B04C;
    --warn-soft: #36280F;
    --ok-ink: #0D1114;
    --bad-ink: #0D1114;
    /* at night a yellow wash turns to mud: a dark panel with a sun hairline instead */
    --tip-bg: #151B20;
    --tip-line: rgba(255, 210, 63, .5);
    --warn-bg: #151B20;
    --warn-line: rgba(243, 176, 76, .5);
    --wa-ink: #4CC587;
    --wa-soft: rgba(76, 197, 135, .12);
    --c1: #A98BFF;
    --c2: #FF8A5C;
    --c3: #5FB8D6;
    --c4: #3DD39A;
    --c1-soft: #2A2143;
    --c2-soft: #3B2016;
    --c3-soft: #16303A;
    --c4-soft: #10291F;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 2px 8px rgba(0, 0, 0, .3), 0 10px 24px rgba(0, 0, 0, .3);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, .4), 0 24px 56px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D1114;
  --surface: #151B20;
  --card: #12171B;
  --fill: #182027;
  --fill-2: #212A33;
  --fg: #ECF0F3;
  --muted: #9AA5B0;
  --line: #263038;
  --line-2: #1D252C;
  --line-strong: #4A5662;
  --primary: #1B6E8C;
  --primary-ink: #FFFFFF;
  --primary-hover: #22809F;
  --accent: #5FB8D6;
  --accent-ink: #0D1114;
  --accent-soft: #16303A;
  --accent-hover: #7FCAE3;
  --band: #161D23;
  --band-2: #222A32;
  --band-line: #36404A;
  --band-muted: #9AA5B0;
  --route: #2FA3CC;
  --route-soft: #1E3C49;
  --route-ink: #ECF0F3;
  --mark: #FFD23F;
  --mark-soft: #3A3218;
  --mark-ink: #13181D;
  --ok: #3DD39A;
  --ok-soft: #10291F;
  --bad: #FF6B76;
  --bad-soft: #3A181E;
  --warn: #F3B04C;
  --warn-soft: #36280F;
  --ok-ink: #0D1114;
  --bad-ink: #0D1114;
  --tip-bg: #151B20;
  --tip-line: rgba(255, 210, 63, .5);
  --warn-bg: #151B20;
  --warn-line: rgba(243, 176, 76, .5);
  --wa-ink: #4CC587;
  --wa-soft: rgba(76, 197, 135, .12);
  --c1: #A98BFF;
  --c2: #FF8A5C;
  --c3: #5FB8D6;
  --c4: #3DD39A;
  --c1-soft: #2A2143;
  --c2-soft: #3B2016;
  --c3-soft: #16303A;
  --c4-soft: #10291F;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 2px 8px rgba(0, 0, 0, .3), 0 10px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, .4), 0 24px 56px rgba(0, 0, 0, .55);
}

/* ------------------------------ base ------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; accent-color: var(--accent);
  /* keyboard focus and in-page jumps never land under the sticky header or the fixed bottom bar */
  scroll-padding-top: 124px; scroll-padding-bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: 1.55;
  direction: rtl;
}
/* browser surfaces carry the world too: selecting text is a sun highlight */
::selection { background: var(--mark-soft); color: var(--fg); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--fw-display); line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: var(--fs-h1); line-height: 1.15; letter-spacing: -.01em; }
h2 { font-size: var(--fs-h2); letter-spacing: -.005em; }
h3 { font-size: var(--fs-h3); font-weight: 700; }
h4 { font-size: var(--fs-h4); font-weight: 700; }
p { margin: 0; }
b, strong { font-weight: 700; }
/* no lone word on the last line. Not around inline math: in Chromium "pretty" stretches the .m spans and the page scrolls sideways */
p:not(:has(.m, .frac)), li:not(:has(.m, .frac)) { text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
@media (hover: hover) { a:hover { text-decoration-thickness: 2.5px; } }
button, input, select, textarea { font: inherit; color: inherit; }
input, textarea { caret-color: var(--accent); }
:focus-visible { outline: 2.5px solid var(--focus, var(--accent)); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.tiny { font-size: var(--fs-cap); }
.lead { font-size: var(--fs-lead); }
/* a quiet label for metadata (question number, level, topic). Never a kicker above a page title */
.eyebrow { font-size: var(--fs-cap); font-weight: 500; color: var(--muted); line-height: 1.4; }
.num, .tab-nums { font-variant-numeric: tabular-nums; }
/* read by screen readers, not drawn */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
mark, .hlw { background: linear-gradient(transparent 40%, var(--mark-soft) 40%, var(--mark-soft) 94%, transparent 94%); color: inherit; padding: 0 2px; }
/* thin, quiet scrollbars where a box scrolls on its own */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* inline math: always left-to-right inside Hebrew text */
.m { direction: ltr; unicode-bidi: isolate; white-space: nowrap; font-variant-numeric: tabular-nums; padding-inline: .12em; }
.m sup, .m sub { font-size: .72em; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.15; margin: 0 2px; font-size: .92em; }
.frac .n { padding: 0 3px; border-bottom: 1.4px solid currentColor; }
.frac .d { padding: 0 3px; }

/* figures produced by the question engine */
.fig { display: flex; justify-content: center; margin: 12px 0; color: var(--fg); }
.fig svg { max-width: 100%; height: auto; overflow: visible; }
.fig .hl { stroke: var(--accent); }
.fig text.hl { fill: var(--accent); stroke: none; }
table.qt { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; margin: 12px auto; font-size: 14.5px; font-variant-numeric: tabular-nums; }
table.qt th, table.qt td { border: 1px solid var(--line); padding: 6px 10px; text-align: center; }
table.qt td { white-space: normal; min-width: 3.5em; }
table.qt th { white-space: normal; min-width: 4em; }
/* scroll shadows: a soft edge shows there is more table to swipe to */
table.qt {
  background:
    linear-gradient(to right, var(--bg) 30%, transparent) left center / 36px 100% no-repeat local,
    linear-gradient(to left, var(--bg) 30%, transparent) right center / 36px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.16), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.16), transparent) right center / 12px 100% no-repeat scroll;
}
table.qt th { background: var(--fill); font-weight: 700; }

/* ------------------------------ layout ------------------------------ */
.wrap { max-width: 780px; margin: 0 auto; padding-inline: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
.sep { height: 1px; background: var(--line); border: 0; margin: 4px 0; }

/* ------------------------------ surfaces ------------------------------ */
/* a card is white with a hairline, like a timetable; a flat card is a soft fill with no line */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.flat { background: var(--fill); border-color: transparent; }
@media (min-width: 720px) { .card { padding: 22px; } }
.panel { background: var(--fill); border-radius: var(--radius-sm); padding: 12px 14px; }
.note { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; }
.tip { background: var(--tip-bg); box-shadow: inset 0 0 0 1px var(--tip-line); border-radius: var(--radius-sm); padding: 12px 14px; }
.warn { background: var(--warn-bg); box-shadow: inset 0 0 0 1px var(--warn-line); border-radius: var(--radius-sm); padding: 12px 14px; }
.okbox { background: var(--ok-soft); border-radius: var(--radius-sm); padding: 12px 14px; }
.badbox { background: var(--bad-soft); border-radius: var(--radius-sm); padding: 12px 14px; }
.note b:first-child, .tip b:first-child, .warn b:first-child { margin-inline-end: 4px; }

/* ------------------------------ labels ------------------------------ */
/* a status label: a small flat tag with square-ish corners, like a sign on a platform */
.stk {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  padding: 4px 10px; border-radius: 8px; font-weight: 800; font-size: 14px; line-height: 1.25;
  background: var(--mark); color: var(--mark-ink);
}
.stk svg { width: 16px; height: 16px; flex: none; }
.stk.ok { background: var(--ok); color: var(--ok-ink); }
.stk.bad { background: var(--bad); color: var(--bad-ink); }
.stk.ink { background: var(--fg); color: var(--bg); }
.stk.white { background: #fff; color: var(--cv, var(--fg)); }
button.stk { border: 0; cursor: pointer; min-height: 34px; }

/* ------------------------------ buttons ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 8px 20px; border-radius: 12px;
  border: 0; background: var(--surface); color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--line-strong);
  font-weight: 700; line-height: 1.25; cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease), transform .08s;
  text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
/* the main action is teal, with a small arrow along the line when it moves you forward */
.btn.primary { background: var(--primary); color: var(--primary-ink); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--accent); box-shadow: none; }
/* a step that cannot be undone (leaving a chapter, deleting): red, and never the default */
.btn.danger { background: var(--bad); color: var(--bad-ink); box-shadow: none; }
@media (hover: hover) {
  .btn:hover { box-shadow: inset 0 0 0 1.5px var(--fg); }
  .btn.primary:hover { background: var(--primary-hover); box-shadow: none; }
  .btn.ghost:hover { background: var(--accent-soft); box-shadow: none; }
  .btn.danger:hover { background: var(--bad); filter: brightness(.94); box-shadow: none; }
}
.btn.sm { min-height: 40px; padding: 6px 14px; font-size: 14.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[disabled]:active { transform: none; }
.btn svg { width: 19px; height: 19px; flex: none; }

.seg { display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 3px; border-radius: 12px; background: var(--fill); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; white-space: nowrap; border: 0; background: transparent; padding: 6px 15px; min-height: 38px; border-radius: 9px; cursor: pointer; font-weight: 700; color: var(--muted); transition: background-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease); }
@media (hover: hover) { .seg button:hover { color: var(--fg); } }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(17, 20, 23, .08); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 8px; background: var(--fill); font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.mark { background: var(--mark); color: var(--mark-ink); }
.chip svg { width: 14px; height: 14px; }
button.chip { position: relative; min-height: 30px; border: 0; cursor: pointer; }
button.chip::after { content: ""; position: absolute; inset: -7px -4px; }

/* ------------------------------ forms ------------------------------ */
input[type="text"], input[type="search"], input[type="number"], input[type="date"],
input[type="email"], input[type="password"], input[type="tel"], input[type="url"], select, textarea {
  width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--fg);
  font-size: 16px; /* below 16px a phone zooms in on focus */
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { min-height: 120px; line-height: 1.7; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14.5px; }

/* ------------------------------ progress ------------------------------ */
.bar { height: 6px; border-radius: 99px; background: var(--fill-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--primary); transition: width .3s var(--ease); }
.bar.ok > i { background: var(--ok); }
/* the round's line (A.sbar): a station per question or card on a line. The line is ink up to
   where you are (--p, set by A.sbar) and grey after it; a station is filled once passed, green or
   red after an answer, and the one you're on is a big ink ring. */
.sbar { position: relative; display: flex; align-items: center; justify-content: space-between; height: 22px; direction: rtl; }
.sbar::before, .sbar::after { content: ""; position: absolute; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; inset-inline-start: 5px; }
.sbar::before { inset-inline-end: 5px; background: var(--line); }
.sbar::after { width: calc((100% - 10px) * var(--p, 0)); background: var(--route-ink); }
.sbar > i { position: relative; z-index: 1; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-strong); }
.sbar > i.on { background: var(--route-ink); box-shadow: none; }
.sbar > i.ok { background: var(--ok); box-shadow: none; }
.sbar > i.bad { background: var(--bad); box-shadow: none; }
.sbar > i.cur { width: 20px; height: 20px; background: var(--surface); box-shadow: inset 0 0 0 5px var(--route-ink); }
/* many stations: smaller dots, so 30 still fit on a phone */
.sbar.many > i { width: 6px; height: 6px; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.sbar.many > i.on, .sbar.many > i.ok, .sbar.many > i.bad { box-shadow: none; }
.sbar.many > i.cur { width: 14px; height: 14px; box-shadow: inset 0 0 0 4px var(--route-ink); }

/* ------------------------- answer options ------------------------- */
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start;
  min-height: 58px; padding: 10px 14px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-size: 17px;
  transition: border-color .18s var(--ease), background-color .18s var(--ease), transform .08s;
}
.opt:active { transform: scale(.99); }
@media (hover: hover) { .opt:hover { border-color: var(--fg); } }
.opt .bub {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums; transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
@media (hover: hover) { .opt:hover .bub { border-color: var(--fg); color: var(--fg); } }
.opt .otx { flex: 1; min-width: 0; }
.opt.sel { border-color: var(--fg); }
.opt.sel .bub { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.opt.ok { border-color: var(--ok); }
.opt.ok .bub { background: var(--ok); border-color: var(--ok); color: var(--ok-ink); }
.opt.bad { border-color: var(--bad); }
.opt.bad .bub { background: var(--bad); border-color: var(--bad); color: var(--bad-ink); }
/* after an answer the two options that matter say so at their end: "נכון" and "בחרתם" */
.opt.ok::after, .opt.bad::after { flex: none; font-size: 14px; font-weight: 800; }
.opt.ok::after { content: "נכון"; color: var(--ok); }
.opt.bad::after { content: "בחרתם"; color: var(--bad); }
.opt.dim { opacity: .55; }
.opt[disabled] { cursor: default; }
.opt[disabled]:active { transform: none; }
.opt[disabled]:hover { border-color: var(--line); }
.opt[disabled]:hover .bub { border-color: var(--line-strong); color: var(--muted); }
.opt.ok[disabled]:hover { border-color: var(--ok); }
.opt.bad[disabled]:hover { border-color: var(--bad); }
.opt.ok[disabled]:hover .bub { border-color: var(--ok); color: var(--ok-ink); }
.opt.bad[disabled]:hover .bub { border-color: var(--bad); color: var(--bad-ink); }


/* ------------------------------ widgets ------------------------------ */
.w { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card .w { background: var(--fill); border-color: transparent; }
.w-title { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 18px; }
.w-desc { color: var(--muted); font-size: 14.5px; }
.w-controls { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.w-ctl { display: flex; flex-direction: column; gap: 2px; min-width: 140px; flex: 1 1 160px; font-size: 14px; }
.w-ctl .w-lab { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-weight: 500; }
.w-ctl .w-val { color: var(--fg); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.w-ctl input[type="range"] { width: 100%; direction: ltr; accent-color: var(--accent); min-height: 30px; margin: 0; }
.w-stage { display: flex; justify-content: center; color: var(--fg); overflow-x: auto; }
.w-stage svg { max-width: 100%; height: auto; overflow: visible; }
.w-read { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.w-kv { display: flex; flex-direction: column; gap: 2px; background: var(--fill); border-radius: var(--radius-sm); padding: 8px 12px; }
.card .w .w-kv, .card .w .w-note { background: var(--surface); }
.w-kv > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.w-kv > b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.w-kv.hi { background: var(--accent-soft); }
.w-kv.hi > b { color: var(--accent); }
.w-note { font-size: 14.5px; background: var(--fill); border-radius: var(--radius-sm); padding: 10px 12px; max-width: 78ch; }
.w-note.ok { background: var(--ok-soft); }
.w-note.bad { background: var(--bad-soft); }

/* SVG helpers for widgets (use as class on SVG elements) */
.sv-fg { stroke: var(--fg); }
.sv-muted { stroke: var(--muted); }
.sv-line { stroke: var(--line); }
.sv-a { stroke: var(--c1); }
.sv-b { stroke: var(--c2); }
.sv-c { stroke: var(--c3); }
.sv-d { stroke: var(--c4); }
.sv-ok { stroke: var(--ok); }
.sv-bad { stroke: var(--bad); }
.fl-none { fill: none; }
.fl-card { fill: var(--card); }
.fl-a { fill: var(--c1-soft); }
.fl-b { fill: var(--c2-soft); }
.fl-c { fill: var(--c3-soft); }
.fl-d { fill: var(--c4-soft); }
.fl-a-solid { fill: var(--c1); }
.fl-b-solid { fill: var(--c2); }
.fl-c-solid { fill: var(--c3); }
.fl-d-solid { fill: var(--c4); }
.fl-ok { fill: var(--ok-soft); }
.fl-bad { fill: var(--bad-soft); }
.fl-ok-solid { fill: var(--ok); }
.fl-bad-solid { fill: var(--bad); }
.fl-muted { fill: var(--fill-2); }
.fl-mark { fill: var(--mark); }
.fl-mark-soft { fill: var(--mark-soft); }
.tx { fill: var(--fg); stroke: none; }
.tx-muted { fill: var(--muted); stroke: none; }
.tx-a { fill: var(--c1); stroke: none; }
.tx-b { fill: var(--c2); stroke: none; }
.tx-ok { fill: var(--ok); stroke: none; }
.tx-bad { fill: var(--bad); stroke: none; }

/* ------------------------------ lessons ------------------------------ */
.lesson { display: flex; flex-direction: column; gap: 18px; }
.lesson .sec { display: flex; flex-direction: column; gap: 8px; }
.lesson .sec h3 { font-size: 19px; }
.lesson .sec ul, .lesson .sec ol { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 4px; }
.prose { max-width: 66ch; }
.prose p + p { margin-top: 8px; }
.stepper { display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; gap: 10px; align-items: flex-start; }
/* step numbers are small ink stations */
.step .sn { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--fg); color: var(--bg); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; font-variant-numeric: tabular-nums; }
.step .sb { flex: 1; min-width: 0; }
.trap { display: flex; gap: 10px; align-items: flex-start; }
.trap::before { content: "!"; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--bad-soft); color: var(--bad); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; margin-top: 2px; }

/* ------------------------------ motion ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* css/app.css */
/* =====================================================================
   מ־200 ל־800 — screens (task x7, "the line"). Tokens and the shared
   components live in base.css; DESIGN.md describes the system.
   Cards are white with a hairline; the home screen opens on a dark band
   with the 200–800 line; the day and every round are lines of stations.
   ===================================================================== */

/* a subject's colour (--cv): only the small badge of a station or a row */
.k-words { --cv: var(--cv-words); }
.k-quant { --cv: var(--cv-quant); }
.k-verbal { --cv: var(--cv-verbal); }
.k-exam { --cv: var(--cv-exam); }
.k-plain { --cv: var(--cv-plain); }
.k-done { --cv: var(--cv-done); }

/* =========================== app shell =========================== */
html, body { min-height: 100%; }
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--bg); box-shadow: 0 1px 0 var(--line);
}
/* on the home screen the top bar is the start of the dark band */
body.home-band .topbar { background: var(--band); color: var(--band-fg); box-shadow: none; }
body.home-band .topbar .in, body.home-band .ss-box { --focus: var(--mark); }
body.home-band .topbar .iconbtn { color: var(--band-fg); }
body.home-band .topbar .chip.accent { background: var(--band-2); color: var(--band-fg); }
body.home-band .searchrow input.ss-input { background: var(--band-2); color: var(--band-fg); }
body.home-band .searchrow input.ss-input::placeholder { color: var(--band-muted); }
body.home-band .searchrow input.ss-input:focus { border-color: var(--mark); background: var(--band-2); box-shadow: none; }
body.home-band .ss-ic, body.home-band .ss-clear { color: var(--band-muted); }
@media (hover: hover) { body.home-band .topbar .iconbtn:hover, body.home-band .ss-clear:hover { background: var(--band-2); color: var(--band-fg); } }
.topbar .in { max-width: 780px; margin: 0 auto; padding: 8px 16px 6px; display: flex; align-items: center; gap: 8px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: var(--fw-display); font-size: 19px; letter-spacing: -.01em; flex: 1; min-width: 0; }
.brand svg { width: 32px; height: 32px; flex: none; }
.topbar .title { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 18px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .chip { font-size: 14px; padding: 5px 11px; }
.topbar .chip svg { width: 16px; height: 16px; }
.iconbtn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--fg); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color .18s var(--ease); }
.iconbtn:hover { background: var(--fill); }
.iconbtn svg { width: 24px; height: 24px; }
main { flex: 1; padding-block: 18px calc(var(--nav-h) + 30px + env(safe-area-inset-bottom, 0px)); }
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--bg); box-shadow: 0 -1px 0 var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.nav .in { max-width: 780px; margin: 0 auto; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); height: var(--nav-h); }
.nav button { position: relative; border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12.5px; font-weight: 500; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color .18s var(--ease); }
/* the current tab is teal, with a short bar on the edge of the bar, like the station you're at */
.nav button svg { width: 24px; height: 24px; }
@media (hover: hover) { .nav button:hover { color: var(--fg); } }   /* no sticky hover after a tap on a phone */
.nav button[aria-current="page"] { color: var(--accent); font-weight: 800; }
.nav button[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 24%; right: 24%; height: 4px; border-radius: 0 0 4px 4px; background: currentColor; }
.nav .dot { display: none; }
.nav button:focus-visible { outline-offset: -3px; border-radius: 12px; }
/* six tabs on a phone: a slightly smaller label keeps "סימולציות" on one line */
@media (max-width: 420px) { .nav button { font-size: 12px; letter-spacing: -.1px; } }
@media (min-width: 960px) {
  .nav { top: 0; bottom: 0; left: auto; right: 0; width: 92px; box-shadow: -1px 0 0 var(--line); padding-top: 76px; }
  .nav button[aria-current="page"]::before { top: 22%; bottom: 22%; left: auto; right: 0; width: 4px; height: auto; border-radius: 4px 0 0 4px; }
  .nav .in { grid-template-columns: 1fr; grid-auto-rows: 78px; height: auto; }
  .shell { padding-right: 92px; }
  main { padding-bottom: 48px; }
}

/* =========================== generic pieces =========================== */
/* a page title: the heading first, then its facts, then a short description */
.hgroup { display: flex; flex-direction: column; gap: 6px; }
.hgroup > .muted:last-child { max-width: 62ch; }
.hg-meta { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); line-height: 1.45; }
.hgroup h1 + .hg-meta { margin-top: -2px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 14px; }
.section-title h2 { font-size: var(--fs-h3); font-weight: var(--fw-display); }
/* a list is a timetable: rows inside one hairline box, a rule between them */
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.list > * + * { box-shadow: inset 0 1px 0 var(--line); }
.li {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; padding: 12px 16px; min-height: 64px;
  border: 0; background: transparent; color: var(--fg); cursor: pointer; transition: background-color .18s var(--ease);
}
@media (hover: hover) { .li:hover { background: var(--fill); } }
.li:focus-visible { outline-offset: -3px; }
.li .lt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.li .lt b { font-weight: 700; }
.li .lt span { font-size: 14px; color: var(--muted); }
.li .chev { flex: none; color: var(--muted); width: 18px; height: 18px; }
/* a row's icon sits in a small tinted circle; the tone picks the colour */
.li .ic { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.li .ic svg { width: 21px; height: 21px; }
.li .ic.b { background: var(--c2-soft); color: var(--c2); }
.li .ic.c { background: var(--c1-soft); color: var(--c1); }
.li .ic.d { background: var(--c4-soft); color: var(--c4); }
.li .done { flex: none; color: var(--ok); }
.li .done svg { width: 22px; height: 22px; }
.badge-exam { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 2px 8px; white-space: nowrap; }
.badge-exam svg { width: 12px; height: 12px; }
.empty { text-align: center; color: var(--muted); padding: 24px 12px; }
.toast {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom, 0px));
  background: var(--fg); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: 14.5px; box-shadow: var(--shadow-lg);
  max-width: calc(100% - 32px); text-align: center;
}
.overlay { position: fixed; inset: 0; z-index: 70; background: rgba(13, 17, 20, .55); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.sheet { width: 100%; max-width: 560px; background: var(--bg); border-radius: 20px; padding: 24px 20px 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-lg); max-height: 86vh; overflow: auto; }
.sheet > h3:first-child { font-size: 22px; font-weight: var(--fw-display); }
@media (min-width: 700px) { .overlay { align-items: center; } }

/* =========================== tiles =========================== */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 6px; text-align: start; padding: 14px 14px 13px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; min-height: 100px; transition: border-color .18s var(--ease), transform .08s; }
@media (hover: hover) { .tile:hover { border-color: var(--fg); } }
.tile:active { transform: scale(.98); }
.tile b { font-weight: 800; font-size: 16px; line-height: 1.3; }
.tile > span { font-size: 13px; color: var(--muted); }
.tile .bar { margin-top: auto; height: 6px; }

/* =========================== flashcards =========================== */
/* the front of a card is the dark band with the word in white; the back is a white card to read */
.flash {
  position: relative; min-height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center;
  background: var(--band); color: #fff; border-radius: 20px; padding: 28px 20px; cursor: pointer; --focus: var(--mark);
}
.flash .fw { font-family: var(--font-display); font-weight: 800; font-size: 44px; line-height: 1.15; letter-spacing: -.01em; }
.flash .fw.idiom { font-size: 32px; font-weight: 800; }
.flash .fnq { font-size: 18px; color: rgba(255, 255, 255, .88); }
.flash .fmeta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.flash .fhint { color: rgba(255, 255, 255, .85); font-size: 14px; font-weight: 500; }
.flash .fd { font-size: 21px; font-weight: 700; max-width: 30ch; line-height: 1.4; }
.flash .fe { color: rgba(255, 255, 255, .88); max-width: 40ch; }
.flash .fe b { color: #fff; font-weight: 700; }
.flash:not(.back) .chip { background: var(--band-2); color: #fff; }
.flash:not(.back) .chip.accent { background: var(--mark); color: var(--mark-ink); }
.flash:not(.back) .badge-exam { background: #fff; color: #8F5400; }
.flash.back { background: var(--card); color: var(--fg); border: 1px solid var(--line); cursor: default; align-items: stretch; text-align: start; --focus: var(--accent); }
.flash.back .fw { font-size: 30px; text-align: center; }
.flash.back .fnq { color: var(--muted); }
.flash.back .fe { color: var(--muted); }
.flash.back .fe b { color: var(--fg); }
.fdetail { display: flex; flex-direction: column; gap: 10px; }
.fdetail .row { gap: 6px; }
.grades { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.grades button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 9px 4px; min-height: 62px; border-radius: 12px; border: 0; background: var(--fill); font-weight: 800; cursor: pointer; font-size: 15px; transition: filter .15s, transform .08s; }
.grades button span { font-size: 12px; font-weight: 500; opacity: .85; }
.grades button:active { transform: scale(.97); }
.grades .g0 { background: var(--bad-soft); color: var(--bad); }
.grades .g1 { background: var(--warn-soft); color: var(--warn); }
.grades .g2 { background: var(--ok-soft); color: var(--ok); }
.grades .g3 { background: var(--accent-soft); color: var(--accent); }
@media (hover: hover) { .grades button:hover { filter: brightness(.96); } }
/* a session runs along its line of stations (A.sbar); the count sits next to it */
.progress-line { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-line .bar, .progress-line .sbar { flex: 1; }
.progress-line .bar { height: 3px; }
.progress-line .bar > i { background: var(--route-ink); }

/* =========================== questions =========================== */
.qcard { display: flex; flex-direction: column; gap: 14px; }
.qmeta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.qtext { font-size: 18px; line-height: 1.7; }
.qtext .stem { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 26px; text-align: center; padding: 6px 0; }
.qsent { font-size: 18px; line-height: 1.85; }
.qsent .blank { display: inline-block; min-width: 72px; border-bottom: 2.5px solid var(--fg); text-align: center; font-weight: 700; padding: 0 4px; }
.qsent .blank.fill-ok { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); border-radius: 6px 6px 0 0; }
.qsent .blank.fill-bad { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); border-radius: 6px 6px 0 0; }
.explain { display: flex; flex-direction: column; gap: 10px; border-radius: 14px; padding: 16px; background: var(--fill); min-width: 0; overflow-x: auto; }
.explain.ok { background: var(--ok-soft); }
.explain.bad { background: var(--fill); }
/* the verdict is a station and a word: green "נכון!", red when it wasn't */
.explain .verdict { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-weight: 800; font-size: 17px; color: var(--fg); }
.explain .verdict::before { content: ""; flex: none; width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.explain .verdict.ok { color: var(--ok); }
.explain .verdict.bad { color: var(--bad); }
/* each option's line starts with its own small circle: the right one filled green, the one
   that was picked (when wrong) ringed red */
.opt-exp { font-size: 14.5px; display: flex; gap: 10px; align-items: flex-start; }
.opt-exp .mk { flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.opt-exp .mk.ok { background: var(--ok); border-color: var(--ok); color: var(--ok-ink); }
.opt-exp .mk.picked { border: 2px solid var(--bad); color: var(--bad); }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; }
.timer.low { color: var(--bad); }
/* the question map: a dot per question. Answered is filled ink, flagged has a sun ring, the
   current one a ring around it. The button keeps a full-size tap area. */
.qgrid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.qgrid button { position: relative; isolation: isolate; min-height: 40px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--fg); font-weight: 700; font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }
.qgrid button::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: 30px; height: 30px; max-width: 100%; transform: translate(-50%, -50%); border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-strong); transition: background-color .18s var(--ease), box-shadow .18s var(--ease); }
.qgrid button.ans { color: var(--bg); }
.qgrid button.ans::before { background: var(--fg); box-shadow: none; }
.qgrid button.flag::before { box-shadow: inset 0 0 0 3px var(--mark); }
.qgrid button.ans.flag::before { box-shadow: inset 0 0 0 3px var(--mark); }
.qgrid button.cur::before { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }
.qgrid button.cur.flag::before { box-shadow: inset 0 0 0 3px var(--mark), 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }
.qgrid button.ok { color: var(--ok-ink); }
.qgrid button.ok::before { background: var(--ok); box-shadow: none; }
.qgrid button.bad { color: var(--bad-ink); }
.qgrid button.bad::before { background: var(--bad); box-shadow: none; }
.qgrid button.skip { color: var(--muted); }
.qgrid button.skip::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.qgrid button:focus-visible { outline: none; }
.qgrid button:focus-visible::before { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4.5px var(--focus, var(--accent)); }
@media (hover: hover) { .qgrid button:not(.ans):not(.ok):not(.bad):hover::before { background: var(--fill-2); } }
.result-big { font-family: var(--font-display); font-weight: 800; font-size: 52px; line-height: 1; color: var(--fg); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.res-stats span { white-space: nowrap; }

/* =========================== drills keypad =========================== */
.drill-q { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 36px; text-align: center; padding: 12px 0; min-height: 80px; display: flex; align-items: center; justify-content: center; }
.drill-in { font-size: 28px; text-align: center; font-weight: 800; direction: ltr; min-height: 56px; border-radius: 12px; background: var(--fill); display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.drill-in.ok { background: var(--ok-soft); color: var(--ok); }
.drill-in.bad { background: var(--bad-soft); color: var(--bad); }
.keypad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; direction: ltr; }
.keypad button { min-height: 56px; border-radius: 12px; border: 0; background: var(--fill); color: var(--fg); font-size: 22px; font-weight: 800; cursor: pointer; transition: background-color .15s, transform .08s; }
@media (hover: hover) { .keypad button:hover { background: var(--fill-2); } }
.keypad button.go { background: var(--primary); color: var(--primary-ink); }
.keypad button:active { transform: scale(.97); }

/* =========================== dictionary =========================== */
.letters { display: flex; flex-wrap: wrap; gap: 6px; }
.letters button { min-width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--fill); color: var(--fg); font-weight: 800; cursor: pointer; }
@media (hover: hover) { .letters button:hover { background: var(--fill-2); } }
.letters button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); }
.dict-row { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; cursor: pointer; }
.dict-row .dw { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dict-row .dw b { font-size: 18px; font-weight: 800; }
.dict-row .dd { color: var(--muted); font-size: 14.5px; }
.list > .dict-row.open { background: var(--fill); cursor: default; }
.dict-row.open .dd { color: var(--fg); }
.entry { display: flex; flex-direction: column; gap: 8px; }
.entry .ex { color: var(--muted); }
.entry .ex b { color: var(--fg); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--line-strong); flex: none; }
.status-dot.learning { background: var(--warn); }
.status-dot.known { background: var(--ok); }
.status-dot.mastered { background: var(--accent); }

/* =========================== lessons =========================== */
.lesson-head { display: flex; flex-direction: column; gap: 6px; }
.lesson-head h1 { font-size: 30px; }
.lesson-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; margin-top: -2px; }
.lesson-head .lead { max-width: 62ch; margin-top: 2px; }
.res-title { font-size: 20px; }
.lesson .sec h3 { font-size: 20px; font-weight: var(--fw-display); }
.lesson .sec p, .lesson .sec li { line-height: 1.75; }
.worked { display: flex; flex-direction: column; gap: 10px; }
.worked .wq { font-weight: 500; line-height: 1.75; }
.worked .wq.pre, .pre { white-space: pre-line; }
.worked ol { margin: 6px 0 0; padding-inline-start: 24px; }
.wsteps { display: flex; flex-direction: column; gap: 8px; }
.wsteps .step { animation: rise .25s ease both; }
@keyframes rise { from { opacity: .3; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pattern { display: flex; flex-direction: column; gap: 6px; }
.pattern .pp { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 21px; }
.passage p { line-height: 1.85; }
.passage .pnum { color: var(--muted); font-size: 13px; font-weight: 800; margin-inline-end: 6px; }
.formula-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.formula { background: var(--fill); border: 0; border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.formula b { font-weight: 800; }
.formula .when { font-size: 13px; color: var(--muted); }
.ref-html table.qt { margin: 8px 0; }
.ref-html p + p { margin-top: 6px; }

/* =========================== writing studio =========================== */
.essay { min-height: 300px; font-size: 16px; line-height: 1.9; }
.phase { display: flex; gap: 4px; }
.phase span { flex: 1; height: 4px; border-radius: 2px; background: var(--fill-2); }
.phase span.on { background: var(--route-ink); }
.phase span.done { background: var(--ok); }
.checklist label { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.checklist input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.ai-out { white-space: pre-line; line-height: 1.8; }

/* =========================== progress =========================== */
.hbar-row { display: grid; grid-template-columns: minmax(90px, 36%) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.hbar-row .bar { height: 10px; }
.hbar-row .v { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; min-width: 42px; text-align: start; }
.daybars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; align-items: end; height: 110px; }
.daybars .db { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; gap: 3px; }
.daybars .db i { display: block; background: var(--route); border-radius: 4px 4px 1px 1px; min-height: 2px; }
.daybars .db.today i { background: var(--mark); }
.daybars .db span { font-size: 11px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.stackbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--fill-2); }
.stackbar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
code.backup { display: block; direction: ltr; text-align: left; font-size: 12px; word-break: break-all; max-height: 120px; overflow: auto; background: var(--fill); padding: 8px 10px; border-radius: 10px; }

/* =========================== quant hub, exam runner, drills =========================== */
.tile .tl { display: flex; flex-wrap: wrap; gap: 4px; }
.tile .tl .chip { font-size: 12px; padding: 1px 8px; }
.tile .tl .chip svg { width: 12px; height: 12px; }
.qexp { line-height: 1.8; min-width: 0; overflow-x: auto; }
.qexp .fig, .qtext .fig { overflow-x: auto; }
.exam-bar {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 58px + var(--sr-h)); z-index: 15;
  background: var(--bg); padding: 8px 0 10px; box-shadow: 0 1px 0 var(--line-2);
}
.exam-bar .timer { font-size: 21px; }
.clock-ic { display: inline-flex; color: var(--muted); }
.clock-ic svg { width: 20px; height: 20px; }
.review { scroll-margin-top: 80px; }
.review summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.review summary::-webkit-details-marker { display: none; }
.review summary .mk { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center; flex: none; }
.review summary .mk svg { width: 14px; height: 14px; }
.review summary .mk.ok { background: var(--ok); color: var(--ok-ink); }
.review summary .mk.bad { background: var(--bad); color: var(--bad-ink); }
.review summary .mk.skip { background: var(--fill-2); color: var(--muted); }
.keypad .go { grid-column: span 2; }
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.yn .btn { min-height: 62px; font-size: 21px; justify-content: center; }
a.li { text-decoration: none; }
ul.bul { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.7; }
.code-box { direction: ltr; text-align: left; min-height: 140px; font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.phase-step.on .sn { background: var(--fg); color: var(--bg); }
.phase-step.past .sn { background: var(--ok); color: var(--ok-ink); }
.phase-step.past .sn svg { width: 15px; height: 15px; }
.phase-step + .phase-step { border-top: 1px solid var(--line-2); padding-top: 10px; }

@media (prefers-reduced-motion: reduce) { .wsteps .step { animation: none; } }

/* reading passage shown above its questions in a mock chapter: scrolls on its own so the question stays in view */
.exam-passage { max-height: 44vh; overflow-y: auto; overscroll-behavior: contain; }
.exam-passage b { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 17px; }
/* reading practice: list of passages */
.plist .li .lvl { font-size: 12px; }

/* =====================================================================
   layout, home, celebrations, lessons, hubs, reading, exam mode
   ===================================================================== */
.chev { display: inline-flex; }
.chev svg { width: 100%; height: auto; display: block; }

/* wide layout on desktop (ע-16): home, lessons, reading, exam */
@media (min-width: 1024px) {
  .wrap.wide { max-width: 1080px; }
  body.wide .topbar .in { max-width: 1080px; }
}
/* exam mode (ע-3): no tab bar while a mock chapter runs */
body.exam-mode .nav { display: none; }
body.exam-mode main { padding-bottom: 40px; }
body.exam-mode .toast { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 960px) { body.exam-mode .shell { padding-right: 0; } }

/* ------------------------------ home ------------------------------ */
/* the dark band: the greeting, the exam countdown and the goal, the score line and the week.
   It runs edge to edge under the top bar; the colour is drawn past the sides with border-image,
   which doesn't widen the page (no sideways scroll). */
body.home-band main { padding-top: 0; }
.hello {
  display: flex; flex-direction: column; gap: 10px; padding: 12px 0 20px;
  background: var(--band); color: var(--band-fg); --focus: var(--mark);
  border-image: linear-gradient(var(--band), var(--band)) fill 0 / / 0 100vmax;
}
.hello h1 { font-size: 30px; font-weight: 800; }
.hello-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 15px; color: var(--band-muted); }
.hello-row b { color: var(--band-fg); font-weight: 800; font-variant-numeric: tabular-nums; }
/* the countdown is a button (to the study plan, or to pick a date) drawn as a quiet outline */
.hl-when { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border: 0; border-radius: 10px; background: var(--band-2); color: var(--band-fg); font-weight: 700; font-size: 15px; cursor: pointer; }
.hl-when svg { width: 17px; height: 17px; flex: none; }
@media (hover: hover) { .hl-when:hover { background: var(--band-line); } }

/* the score line: 200 on the right, 800 on the left, a station every 100. The line is sun yellow
   up to the estimate, where "you" are; the goal is a white ring. A tap opens the progress screen. */
.scoreline { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 6px 0 0; border: 0; background: none; color: inherit; text-align: start; cursor: pointer; border-radius: 12px; }
.sl-cap { font-size: 14px; color: var(--band-muted); }
.sl-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 0; }
.sl-row.lab { padding-top: 38px; }   /* room for the labels above the line */
.sl-row.low { padding-bottom: 38px; }   /* and for the goal's below it */
.sl-end { flex: none; font-size: 13px; font-weight: 700; color: var(--band-muted); font-variant-numeric: tabular-nums; }
.sl-track { position: relative; flex: 1; height: 4px; margin: 0 4px; border-radius: 2px; background: var(--band-line); }
.sl-fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 2px; background: var(--mark); }
.sl-st { position: absolute; top: 50%; width: 12px; height: 12px; margin-top: -6px; margin-inline-start: -6px; border-radius: 50%; background: var(--band); box-shadow: inset 0 0 0 2.5px var(--band-muted); }
.sl-st.on { box-shadow: inset 0 0 0 2.5px var(--mark); }
.sl-you { position: absolute; top: 50%; width: 24px; height: 24px; margin-top: -12px; margin-inline-start: -12px; border-radius: 50%; background: var(--mark); box-shadow: 0 0 0 4px var(--band), 0 0 0 6px var(--mark); }
.sl-tgt { position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px; margin-inline-start: -8px; border-radius: 50%; background: var(--band); box-shadow: inset 0 0 0 3.5px var(--band-fg); }
/* the two labels sit above the line; the goal's moves below when the two are close */
.sl-lab { position: absolute; bottom: 20px; transform: translateX(50%); padding: 2px 9px; border-radius: 8px; font-size: 14px; font-weight: 800; line-height: 1.4; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sl-lab.you { background: var(--mark); color: var(--mark-ink); }
.sl-lab.tgt { background: var(--band); color: var(--band-fg); box-shadow: inset 0 0 0 1.5px var(--band-fg); }
.sl-lab.tgt.low { bottom: auto; top: 20px; }
.sl-note { font-size: 14px; color: var(--band-muted); }
@media (hover: hover) { .scoreline:hover .sl-cap { color: var(--band-fg); text-decoration: underline; text-underline-offset: 3px; } }

/* the week: seven small stations on a line, Sunday on the right; a sun dot for a day with practice */
.hello .week-row { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--band-line); }
.hello .week-row .small { color: var(--band-muted); }
.weekdots { position: relative; display: inline-flex; gap: 6px; }
.weekdots::before { content: ""; position: absolute; inset-inline: 13px; bottom: 6px; height: 2px; background: var(--band-line); }
.weekdots .wd { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 26px; font-size: 12px; font-weight: 500; color: var(--band-muted); line-height: 1.2; }
.weekdots .wd i { width: 14px; height: 14px; border-radius: 50%; background: var(--band); box-shadow: inset 0 0 0 2px var(--band-muted); display: block; }
.weekdots .wd.on i { background: var(--mark); box-shadow: none; }
.weekdots .wd.today span { color: var(--band-fg); font-weight: 800; }
.weekdots .wd.today i { box-shadow: inset 0 0 0 2px var(--band-fg), 0 0 0 2px var(--band), 0 0 0 4px var(--band-fg); }
.weekdots .wd.today.on i { box-shadow: 0 0 0 2px var(--band), 0 0 0 4px var(--band-fg); }
.weekdots .wd.future i { box-shadow: inset 0 0 0 2px var(--band-line); }

.home-grid { display: flex; flex-direction: column; gap: 16px; }
.home-main, .home-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 1024px) {
  .home-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 28px; align-items: start; }
  .home-side { padding-top: 8px; }
}
.day-line { display: flex; flex-direction: column; gap: 6px; }
.day-line > .section-title { margin-top: 4px; }
.hero-count { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* today's line: one station per task on a teal route. The route is solid up to the station you're
   at and soft after it; a done station is a green tick, the current one a big ink ring, the next
   ones hollow, a recommendation dashed. Each stop sets --sy, the height of its station. */
.route { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.stop { --sy: 32px; position: relative; padding-inline-start: 50px; }
.stop::before, .stop::after { content: ""; position: absolute; inset-inline-start: 22px; width: 6px; background: var(--route-soft); }
.stop::before { top: 0; height: var(--sy); }
.stop::after { top: var(--sy); bottom: 0; }
.stop.past::before, .stop.past::after, .stop.cur::before { background: var(--route); }
.stop:first-child::before, .stop:last-child::after { display: none; }
.stop.opt::before, .stop.opt::after { background: repeating-linear-gradient(to bottom, var(--route-soft) 0 7px, transparent 7px 12px); }
.stop .st { --w: 24px; position: absolute; z-index: 1; inset-inline-start: 25px; top: var(--sy); width: var(--w); height: var(--w); margin-top: calc(var(--w) / -2); margin-inline-start: calc(var(--w) / -2);
  border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 5px var(--route); display: flex; align-items: center; justify-content: center; color: var(--ok-ink); }
.stop .st svg { width: 15px; height: 15px; }
.stop.done .st { --w: 28px; background: var(--ok); box-shadow: none; }
.stop.cur { --sy: 42px; padding-block: 6px; }
.stop.cur .st { --w: 34px; box-shadow: inset 0 0 0 8px var(--fg), 0 0 0 6px var(--route-soft); }
.stop.opt .st { --w: 22px; box-shadow: none; border: 3px dashed var(--route); }
.stop.end { --sy: 40px; padding-top: 6px; }
.stop.end .st { --w: 34px; background: var(--ok); box-shadow: 0 0 0 6px var(--ok-soft); }
.stop.end .st svg { width: 19px; height: 19px; }

.plan-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; width: 100%;
  min-height: 64px; padding: 10px 6px; border: 0; border-radius: 14px; background: none; color: var(--fg); text-align: start; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background-color .18s var(--ease);
}
@media (hover: hover) { .plan-item:hover { background: var(--fill); } }
/* the subject's badge: a small circle in its colour with the task's icon */
.plan-item .pc { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--cv, var(--cv-plain)); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.plan-item .pc svg { width: 19px; height: 19px; }
.plan-item .pt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.plan-item .pt b { font-size: 17px; font-weight: 700; line-height: 1.3; }
.plan-item .pt > span { font-size: 14px; color: var(--muted); line-height: 1.35; }
/* the subject ("כמותי:") is read out, not drawn: the badge says it */
.plan-item .pk { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.plan-item .pm { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 14px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan-item .pn { font-weight: 800; color: var(--fg); direction: ltr; unicode-bidi: isolate; }
.plan-item .pn.zero { display: none; }
.plan-item .pdone { color: var(--ok); font-weight: 800; }
.plan-item.done .pc { background: var(--fill-2); color: var(--muted); }
.plan-item.done .pn { display: none; }
.plan-item .opt-chip { margin-inline-start: 6px; padding: 1px 7px; font-size: 12px; font-weight: 800; background: var(--mark); color: var(--mark-ink); vertical-align: 2px; }
.plan-item .pgo { display: none; }

/* the station you're at: a card with an ink frame, and the way on in teal */
.hero { border: 2px solid var(--fg); border-radius: 18px; background: var(--card); }
.hero .plan-item { grid-template-areas: "pc pt pm" "go go go"; padding: 14px 14px 14px; gap: 6px 12px; border-radius: 16px; }
.hero .plan-item .pc { grid-area: pc; align-self: start; margin-top: 2px; }
.hero .plan-item .pt { grid-area: pt; }
.hero .plan-item .pm { grid-area: pm; align-self: start; margin-top: 4px; }
.hero .plan-item .pt b { font-size: 21px; font-weight: 800; }
.hero .plan-item .pgo { grid-area: go; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; margin-top: 8px; border-radius: 12px; background: var(--primary); color: var(--primary-ink); font-size: 17px; font-weight: 800; transition: background-color .18s var(--ease); }
.hero .plan-item .pgo svg { width: 18px; height: 18px; flex: none; }
@media (hover: hover) { .hero .plan-item:hover { background: none; } .hero .plan-item:hover .pgo { background: var(--primary-hover); } }
.hero .plan-item:focus-visible { outline-offset: 2px; }
/* the end of the line: the day is done */
.hero.done { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-color: var(--ok); }
.hero.done h2 { font-size: 22px; font-weight: 800; }
.hero.done .hero-sub { color: var(--muted); font-size: 15px; }
.hero.done .btn { margin-top: 6px; }
/* the plan's emphasis today (more verbal / more quant) and why */
.emph-line { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; background: none; border: 0; padding: 0; min-height: 32px; cursor: pointer; color: var(--fg); }
.emph-line .small { text-decoration: underline; text-underline-offset: 3px; }
.segs { display: flex; gap: 4px; }
.segs i { flex: 1; height: 4px; border-radius: 2px; }

/* ע-9: the first day */
.firstday { display: flex; flex-direction: column; gap: 12px; }
ol.steps3 { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: st; }
ol.steps3 li { position: relative; counter-increment: st; display: flex; gap: 12px; align-items: flex-start; line-height: 1.55; }
/* numbered stations on a short line */
ol.steps3 li::before { content: counter(st); position: relative; z-index: 1; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 3px var(--route); color: var(--fg); font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
ol.steps3 li + li::after { content: ""; position: absolute; inset-inline-start: 12px; bottom: calc(100% - 2px); width: 4px; height: 18px; background: var(--route-soft); }
.linkbtn { background: none; border: 0; padding: 6px 2px; min-height: 36px; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.linkbtn:hover { text-decoration-thickness: 2.5px; }

/* exam date as a slim row, countdown as a card button */
.slimrow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: start; padding: 10px 16px; min-height: 58px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--fg); transition: border-color .18s var(--ease); }
@media (hover: hover) { .slimrow:hover { border-color: var(--fg); } }
.slimrow .sic { flex: none; display: inline-flex; color: var(--accent); }
.slimrow .sic svg { width: 22px; height: 22px; }
.slimrow .grow { flex: 1; min-width: 0; }
.slimrow b { font-weight: 800; }
.countdown { display: flex; align-items: center; gap: 14px; }
.countdown .big { font-family: var(--font-display); font-weight: 800; font-size: 44px; line-height: 1; color: var(--fg); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
/* a card that is a button keeps the card's hairline (and the band's colour on a dark card) */
button.countdown { text-align: start; cursor: pointer; width: 100%; color: inherit; font: inherit; transition: border-color .18s var(--ease), background-color .18s var(--ease); }
.cardlink { text-align: start; cursor: pointer; width: 100%; color: inherit; font: inherit; transition: border-color .18s var(--ease), background-color .18s var(--ease); }
@media (hover: hover) { button.countdown:hover, .cardlink:hover { border-color: var(--fg); } }
.ic-lg { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--fill); color: var(--fg); display: inline-flex; align-items: center; justify-content: center; }
.ic-lg svg { width: 24px; height: 24px; }
/* a hub's main action is a piece of the dark band, with its subject's badge */
.card.canvas { background: var(--band); color: var(--band-fg); border-color: var(--band); --focus: var(--mark); }
.card.canvas .muted, .card.canvas .hg-meta { color: var(--band-muted); }
.card.canvas .ic-lg { background: var(--cv, var(--cv-plain)); color: #fff; }
.card.canvas .chev { color: var(--band-fg) !important; }
.card.canvas h2, .card.canvas h3 { font-weight: 800; }
.card.canvas .btn.primary { background: var(--primary); color: var(--primary-ink); }
.card.canvas .btn:not(.primary):not(.ghost) { background: transparent; color: var(--band-fg); box-shadow: inset 0 0 0 1.5px var(--band-muted); }
.card.canvas .status-dot { box-shadow: 0 0 0 1.5px var(--band); }
.card.canvas .sim-ic { background: var(--cv, var(--cv-plain)); color: #fff; }
.card.canvas .bar, .card.canvas .stackbar { background: var(--band-line); }
.card.canvas input[type="checkbox"] { accent-color: var(--mark); }
@media (hover: hover) {
  .card.canvas.cardlink:hover { border-color: var(--band); background: var(--band-2); }
  .card.canvas .btn.primary:hover { background: var(--primary-hover); }
  .card.canvas .btn:not(.primary):not(.ghost):hover { box-shadow: inset 0 0 0 1.5px var(--band-fg); }
}
.gearbtn { flex: none; color: var(--muted); }
/* on the dark band the main button is white with ink text (the first screen) */
.btn.inverse { background: #fff; color: var(--band); min-height: 54px; font-size: 17px; font-weight: 800; box-shadow: none; }
@media (hover: hover) { .btn.inverse:hover { background: #fff; box-shadow: none; filter: brightness(.94); } }
.btn.inverse svg { width: 18px; height: 18px; fill: currentColor; }

/* ------------------------------ ע-7: finishing a task ------------------------------ */
.donemark { display: inline-flex; width: 64px; height: 64px; flex: none; }
.donemark.big { width: 92px; height: 92px; }
.donemark svg { width: 100%; height: 100%; overflow: visible; }
.dm-ring { fill: none; stroke: var(--ok); stroke-width: 3.5; stroke-dasharray: 100; stroke-dashoffset: 100; animation: dm-draw .3s ease-out forwards; }
.dm-fill { fill: var(--ok); transform-box: fill-box; transform-origin: center; transform: scale(0); animation: dm-pop .26s .24s ease-out forwards; }
.dm-tick { fill: none; stroke: var(--ok-ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; animation: dm-draw .2s .4s ease-out forwards; }
/* a graded chapter or exam ends with a neutral mark in ink: the sheet is handed in, the score says how it went */
.donemark.ink .dm-ring { stroke: var(--fg); }
.donemark.ink .dm-fill { fill: var(--fg); }
.donemark.ink .dm-tick { stroke: var(--bg); }
@keyframes dm-draw { to { stroke-dashoffset: 0; } }
@keyframes dm-pop { 70% { transform: scale(1.08); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .dm-ring, .dm-tick { stroke-dashoffset: 0; }
  .dm-fill { transform: none; }
}
.card.finish { gap: 12px; }
.finish-foot { align-self: stretch; display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 2px; padding-top: 14px; border-top: 1px solid var(--line); }
.finish-foot .fstat { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--ok); }
.finish-foot .fstat svg { width: 18px; height: 18px; flex: none; }
/* the day's line: a station per task, green once done */
.finish-foot .segs { position: relative; width: 100%; max-width: 260px; justify-content: space-between; align-items: center; height: 16px; }
.finish-foot .segs::before { content: ""; position: absolute; inset-inline: 6px; top: 50%; height: 3px; margin-top: -1.5px; background: var(--route-soft); }
.finish-foot .segs i { position: relative; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 3px var(--route); }
.finish-foot .segs i.on { background: var(--ok); box-shadow: none; }
.finish-foot .btn.block { max-width: 420px; }
.sheet.celebrate { align-items: center; text-align: center; gap: 14px; padding: 28px 20px 20px; }
.sheet.celebrate h2 { font-size: 26px; font-weight: 800; }
.streak-line { display: inline-flex; gap: 6px; align-items: center; font-weight: 800; color: var(--c2); }
.streak-line svg { width: 20px; height: 20px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -24px; border-radius: 2px; opacity: 0; animation: cf-fall var(--dur, 2.4s) var(--delay, 0s) cubic-bezier(.2, .6, .35, 1) forwards; }
@keyframes cf-fall {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--dx, 0), 105vh, 0) rotate(var(--rot, 360deg)); }
}

/* ------------------------------ lists & hubs ------------------------------ */
.li.one .lt span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* numbered rows (lessons in order) are stations on a route: a hollow numbered ring, filled green
   when finished, and a line through them from the first to the last */
.li .ic.num { position: relative; z-index: 1; background: var(--card); color: var(--fg); box-shadow: inset 0 0 0 3px var(--route); font-size: 15px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.li .ic.num.ok { background: var(--ok); color: var(--ok-ink); box-shadow: none; }
.li:has(> .ic.num) { position: relative; }
.li:has(> .ic.num)::before { content: ""; position: absolute; inset-inline-start: 34px; top: 0; bottom: 0; width: 4px; background: var(--route-soft); }
.li:has(> .ic.num.ok)::before { background: var(--route); }
.li:has(> .ic.num):first-child::before { top: 50%; }
.li:has(> .ic.num):last-child::before { bottom: 50%; }
.li .chip.mins { flex: none; }

/* ע-11: quant hub. The first steps are three stations on a short line, in reading order */
.startrow { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 4px 0 2px; }
.startrow::before { content: ""; position: absolute; top: 34px; inset-inline: 16.6%; height: 6px; margin-top: -3px; background: var(--route-soft); border-radius: 3px; }
.startcard {
  --cv: var(--cv-quant);
  position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  padding: 0; border: 0; background: none; color: var(--fg); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.startcard:focus-visible { outline: none; }
.startcard:focus-visible .sic { box-shadow: inset 0 0 0 5px var(--route), 0 0 0 3px var(--bg), 0 0 0 5.5px var(--accent); }
/* a station: a white disc in a teal ring, the step's icon in the quant colour */
.startcard .sic {
  width: 60px; height: 60px; border-radius: 50%; margin: 4px 0 6px; color: var(--cv);
  background: var(--card); box-shadow: inset 0 0 0 5px var(--route);
  display: inline-flex; align-items: center; justify-content: center; transition: transform .15s var(--ease);
}
.startcard .sic svg { width: 26px; height: 26px; }
.startcard:active .sic { transform: scale(.95); }
@media (hover: hover) { .startcard:hover .sic { transform: scale(1.05); } }
.startcard b { font-weight: 700; font-size: 14px; line-height: 1.25; }
.startcard .small { font-size: 12px; line-height: 1.35; }
.qgroup { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.qgroup > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 66px; cursor: pointer; border-radius: var(--radius); transition: background-color .18s var(--ease); }
.qgroup > summary::-webkit-details-marker { display: none; }
@media (hover: hover) { .qgroup > summary:hover { background: var(--fill); } }
.qgroup .ic { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--c2-soft); color: var(--c2); display: inline-flex; align-items: center; justify-content: center; }
.qgroup .ic svg { width: 21px; height: 21px; }
.qgroup .gt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qgroup .gt b { font-weight: 800; }
.qgroup .gbar { flex: none; width: 72px; }
.qgroup .gbar .bar { height: 6px; }
.qgroup .gchev { flex: none; width: 18px; height: 18px; color: var(--muted); display: inline-flex; transform: rotate(-90deg); transition: transform .15s; }
.qgroup .gchev svg { width: 18px; height: 18px; }
.qgroup[open] .gchev { transform: rotate(90deg); }
.qgroup > .tiles { padding: 2px 12px 12px; }
.qgroup .tile { background: var(--fill); border-color: transparent; }
@media (hover: hover) { .qgroup .tile:hover { border-color: var(--fg); } }
@media (max-width: 380px) { .qgroup .gbar { display: none; } }

/* ------------------------------ ע-13: lessons ------------------------------ */
.lesson-time { display: inline-flex; align-items: center; gap: 6px; }
.lesson-time svg { width: 16px; height: 16px; flex: none; }
.lesson-sticky { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 59px + var(--sr-h)); z-index: 12; background: var(--bg); margin-inline: -16px; padding: 8px 16px 0; }
.lesson-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.lesson-chips::-webkit-scrollbar { display: none; }
.lchip { flex: none; border: 0; background: var(--fill); color: var(--muted); font-weight: 700; font-size: 13px; padding: 6px 13px; min-height: 38px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.lchip[aria-current="true"] { background: var(--primary); color: var(--primary-ink); }
.lesson-progress { height: 3px; background: var(--line); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.lesson-progress i { display: block; height: 100%; width: 0; background: var(--route-ink); border-radius: 2px; }
.ls-sec { scroll-margin-top: 124px; }
.lesson-cta { margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.lesson-toc { display: none; }
@media (min-width: 1024px) {
  .lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 32px; align-items: start; }
  .lesson-layout > .lesson { max-width: 780px; }
  .lesson-chips { display: none; }
  .lesson-sticky { padding-top: 0; }
  .ls-sec { scroll-margin-top: 84px; }
  .lesson-toc { display: flex; flex-direction: column; gap: 10px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 80px); padding-top: 6px; }
  .toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
  .toc-list button { display: block; width: 100%; text-align: start; background: none; border: 0; border-radius: 12px; padding: 8px 12px; color: var(--muted); font-weight: 700; font-size: 14.5px; cursor: pointer; }
  .toc-list button:hover { color: var(--fg); background: var(--fill); }
  .toc-list button[aria-current="true"] { color: var(--primary-ink); background: var(--primary); }
}

/* ------------------------------ ע-20: reading ------------------------------ */
.read-switch { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 59px + var(--sr-h)); z-index: 12; display: flex; justify-content: center; background: var(--bg); margin-inline: -16px; padding: 8px 16px; box-shadow: 0 1px 0 var(--line-2); }
.read-switch .seg { width: 100%; max-width: 360px; }
.read-switch .seg button { flex: 1; }
.reading-layout { display: flex; flex-direction: column; gap: 14px; }
.reading .passage .ptitle { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 21px; }
#read-passage, #read-qs { scroll-margin-top: 124px; }
.pchip svg { width: 13px; height: 13px; }
.para-sheet { line-height: 1.85; font-size: 16px; }
@media (min-width: 1024px) {
  .read-switch { display: none; }
  .reading-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
  .reading-layout > .passage { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 76px); max-height: calc(100vh - 96px); overflow-y: auto; overscroll-behavior: contain; }
  #read-passage, #read-qs { scroll-margin-top: 80px; }
}

/* ------------------------------ ע-15: exam bar and question map ------------------------------ */
.exam-bar { padding: 8px 0; }
.exam-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.exam-clock { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.mapbtn { flex: 1 1 auto; min-width: 0; max-width: 240px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; padding: 4px 14px; border-radius: 10px; border: 0; background: var(--fill); color: var(--fg); font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
@media (hover: hover) { .mapbtn:hover { background: var(--fill-2); } }
.mapbtn .mchev { display: inline-flex; width: 16px; height: 16px; transform: rotate(-90deg); transition: transform .15s; }
.mapbtn .mchev svg { width: 16px; height: 16px; }
.mapbtn[aria-expanded="true"] .mchev { transform: rotate(90deg); }
.exam-tools { display: inline-flex; align-items: center; gap: 4px; flex: none; }
@media (max-width: 420px) { .mapbtn .mlabel, .exam-tools .tl-label { display: none; } .exam-tools .btn.ghost { padding-inline: 8px; } }
.qmap-panel { padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.qmap-panel[hidden] { display: none; }
.exam-layout { display: flex; flex-direction: column; gap: 14px; }
.exam-side { display: none; }
.qlegend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.qlegend span { display: inline-flex; align-items: center; gap: 6px; }
.qlegend i { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-strong); display: inline-block; }
.qlegend i.ans { background: var(--fg); box-shadow: none; }
.qlegend i.flag { box-shadow: inset 0 0 0 3px var(--mark); }
.qlegend i.ok { background: var(--ok); box-shadow: none; }
.qlegend i.bad { background: var(--bad); box-shadow: none; }
.qlegend i.skip { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
@media (min-width: 1024px) {
  .exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 22px; align-items: start; }
  .exam-layout > .exam-main { max-width: 780px; }
  .exam-side { display: flex; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 134px); }
  .exam-side .qgrid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .mapbtn, .qmap-panel { display: none !important; }
}

/* ------------------------------ ע-25: flashcards ------------------------------ */
.flash.back .fw { font-size: 34px; text-align: center; }
.flash.back .fw.idiom { font-size: 27px; }
.flash.back .fnq { text-align: center; }
.flash.back .fmeta { justify-content: center; }
.fsep { height: 1px; background: var(--line); margin: 2px 0; }
.flash.flip-out { animation: flip-out .125s ease-in forwards; }
.flash.flip-in { animation: flip-in .125s ease-out; }
@keyframes flip-out { to { transform: perspective(900px) rotateY(90deg); } }
@keyframes flip-in { from { transform: perspective(900px) rotateY(-90deg); } to { transform: none; } }

/* =====================================================================
   שלב 2 — the 10-level scale: level meters, first run (ע-10), placement
   ===================================================================== */
body.bare .topbar, body.bare .nav { display: none; }
body.bare main { padding-block: 0 32px; }
@media (min-width: 960px) { body.bare .shell { padding-right: 0; } }

/* level meter: ten small stations on a line that fill up */
.lvmeter { display: inline-flex; gap: 3px; direction: rtl; flex: none; background: linear-gradient(var(--line), var(--line)) center / 100% 2px no-repeat; }
.lvmeter i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-strong); display: block; }
.lvmeter i.on { background: var(--primary); box-shadow: none; }
.lvrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 30px; gap: 10px; align-items: center; }
.lvrow .lvl-label { display: flex; flex-direction: column; min-width: 0; }
.lvrow .lvl-label b { font-weight: 700; font-size: 15px; }
.lvrow .lvnum { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--fg); text-align: center; font-variant-numeric: tabular-nums; }
.lvline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.levels-card h3 { font-size: 19px; font-weight: var(--fw-display); }
.lvdetails > summary { cursor: pointer; font-weight: 800; list-style: none; }
.lvdetails > summary::-webkit-details-marker { display: none; }
.lvdetails[open] > summary { margin-bottom: 10px; }
.chip.lvchip { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 360px) { .lvmeter i { width: 8px; height: 8px; } }

/* ------------------------------ ע-10: the first screen ------------------------------ */
.wow { min-height: 100vh; min-height: 100dvh; background: var(--brand); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; padding: 28px 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
.wow-in { width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.wow-logo { width: 88px; height: 88px; }
.wow-logo svg { width: 100%; height: 100%; }
.wow-logo .lg-bg { fill: var(--brand-ink); }
.wow-logo .lg-lo { fill: var(--brand); }
.wow-logo .lg-fill { fill: var(--mark); transform-box: fill-box; transform-origin: center; animation: lg-fill .7s .25s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes lg-fill { from { transform: scale(0); } to { transform: scale(1); } }
.wow-brand { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 18px; opacity: .92; }
.wow h1 { font-size: 38px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.wow-sub { font-size: 17px; opacity: .94; max-width: 40ch; }
.wow .btn.inverse { margin-top: 8px; --cv: var(--brand); }
.wow .btn.inverse svg { width: 18px; height: 18px; }
.linkbtn.inv { color: inherit; opacity: .92; }
/* p7: the users' WhatsApp group. White on #0E7A40 is 5.4:1; the top-bar button hides in timed exams */
.wa-top { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #0E7A40; color: #fff; display: inline-flex; align-items: center; justify-content: center; margin-inline-start: 2px; }
.wa-top svg { width: 20px; height: 20px; }
.wa-top:hover, .wa-cta:hover { background: #0B6635; }
.wa-top:focus-visible, .wa-cta:focus-visible { outline: 2.5px solid var(--focus, var(--accent)); outline-offset: 2px; }
body.exam-mode .wa-top { display: none; }
.wa-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 9px 18px; min-height: 46px; border-radius: 12px; background: #0E7A40; color: #fff; font-weight: 800; font-size: 15px; text-decoration: none; }
.wa-cta svg { width: 20px; height: 20px; flex: none; }
/* on the sign-in screen the group link stays second to signing in: an outline, not a second filled button */
.auth-wa .wa-cta { background: transparent; color: var(--wa-ink); box-shadow: inset 0 0 0 2px currentColor; }
.auth-wa .wa-cta:hover { background: var(--wa-soft); }
.auth-wa .wa-cta:focus-visible { outline-color: var(--wa-ink); }

.demos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; margin: 8px 0; }
/* the brand surface is the dark band in both themes, so one light wash works for both */
.demo { background: rgba(255, 255, 255, .08); border-radius: 14px; padding: 12px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.demo-cap { font-size: 13px; font-weight: 700; }
.demo-flip { position: relative; width: 100%; height: 46px; perspective: 400px; }
.demo-flip span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--brand-ink); color: var(--brand); font-weight: 800; backface-visibility: hidden; font-size: 15px; padding: 0 4px; }
.demo-flip .f1 { font-family: var(--font-display); font-weight: 800; font-size: 19px; animation: df1 4s infinite; }
.demo-flip .f2 { transform: rotateY(180deg); font-size: 13px; animation: df2 4s infinite; }
@keyframes df1 { 0%, 40% { transform: rotateY(0); } 50%, 90% { transform: rotateY(180deg); } 100% { transform: rotateY(360deg); } }
@keyframes df2 { 0%, 40% { transform: rotateY(180deg); } 50%, 90% { transform: rotateY(360deg); } 100% { transform: rotateY(540deg); } }
.demo-bar { width: 100%; height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; }
.demo-bar .track { flex: none; width: 90%; height: 8px; border-radius: 6px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.demo-bar .track i { display: block; height: 100%; width: 35%; background: var(--mark); border-radius: 6px; animation: dbar 3s ease-in-out infinite alternate; }
@keyframes dbar { from { width: 10%; } to { width: 60%; } }
.demo-bar b { font-size: 15px; }
.demo-timer { height: 46px; display: flex; align-items: center; gap: 6px; }
.demo-timer svg { width: 20px; height: 20px; }
.demo-clock { font-size: 22px; font-weight: 800; }
.demos.still .f1, .demos.still .f2, .demos.still .track i { animation: none; }
.demos.still .f2 { display: none; }

/* ------------------------------ ע-10: one question per screen ------------------------------ */
.ob { padding-top: calc(12px + env(safe-area-inset-top, 0px)); max-width: 560px; }
.ob-top { display: flex; align-items: center; gap: 10px; }
.ob-top .iconbtn { margin-inline-start: -8px; }
.ob-prog { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.ob-prog i { display: block; height: 100%; background: var(--route-ink); border-radius: 2px; transition: width .25s; }
.ob-head { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.ob-head h1 { font-size: 30px; }
.ob input[type="text"] { font-size: 18px; min-height: 56px; }
.ob-next { margin-top: 6px; min-height: 54px; font-size: 17px; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.ob-heard[hidden] { display: none; }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 66px; padding: 10px 14px; text-align: start; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; transition: border-color .18s var(--ease), background-color .18s var(--ease); }
@media (hover: hover) { .choice:hover { border-color: var(--fg); } }
.choice .cic { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--fill); color: var(--fg); display: inline-flex; align-items: center; justify-content: center; }
.choice .cic svg { width: 21px; height: 21px; }
.choice .ct { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.choice .ct b { font-weight: 800; font-size: 16px; }
.choice .ct span { font-size: 14px; color: var(--muted); }
/* the pick is a circle that fills in with ink */
.choice .ccheck { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; color: transparent; transition: background-color .18s var(--ease), border-color .18s var(--ease); }
.choice .ccheck svg { width: 15px; height: 15px; }
.choice.on { border-color: var(--fg); background: var(--surface); }
.choice.on .ccheck { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.feel-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--fill); }
.feel-l { display: flex; align-items: center; gap: 10px; }
.feel-l .cic { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); color: var(--fg); display: inline-flex; align-items: center; justify-content: center; }
.feel-l .cic svg { width: 19px; height: 19px; }
.feel-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.feel-seg button { min-height: 48px; border-radius: 10px; border: 0; background: var(--surface); color: var(--fg); font-weight: 700; cursor: pointer; transition: background-color .18s var(--ease), color .18s var(--ease); }
@media (hover: hover) { .feel-seg button:hover { background: var(--fill-2); } }
.feel-seg button.on { background: var(--primary); color: var(--primary-ink); }
.target-box { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 18px 16px 12px; border-radius: 16px; background: var(--fill); }
.target-big { font-family: var(--font-display); font-weight: 800; font-size: 72px; line-height: 1; color: var(--fg); text-align: center; letter-spacing: -.02em; }
.target-box input[type="range"] { width: 100%; direction: ltr; accent-color: var(--accent); min-height: 36px; }
.target-scale { display: flex; justify-content: space-between; direction: ltr; }
.ob-bul { font-size: 16px; }

/* ------------------------------ previous exam, goal and emphasis (שלב 6) ------------------------------ */
.prev-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.prev-form input[type="text"] { text-align: center; font-size: 20px; font-variant-numeric: tabular-nums; }
.prev-form .field > span { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.form-err { color: var(--bad); min-height: 1em; }
.form-err:empty { display: none; }
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.picks.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.picks.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.picks.three button { padding-inline: 6px; font-size: 14px; }
.picks button { min-height: 48px; padding: 8px 14px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); color: var(--fg); font-weight: 700; font-size: 14.5px; line-height: 1.3; cursor: pointer; text-align: center; transition: background-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease); }
@media (hover: hover) { .picks button:hover { box-shadow: inset 0 0 0 1.5px var(--fg); } }
.picks button.on { background: var(--fg); color: var(--bg); box-shadow: none; }
.goalview .card h3 { font-size: 18px; }
.goal-sum { margin: 0; padding-inline-start: 18px; }
/* a one-time note on the home screen: a sun label marks it new */
.newcard { background: var(--tip-bg); border-color: transparent; box-shadow: inset 0 0 0 1px var(--tip-line); }   /* a sun wash by day, a dark panel with a sun hairline at night (like .tip) */
.newcard-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.newcard .chip.accent { background: var(--mark); color: var(--mark-ink); }

/* ------------------------------ placement test ------------------------------ */
.pl-head { display: flex; flex-direction: column; gap: 8px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 59px + var(--sr-h)); z-index: 12; background: var(--bg); padding: 8px 0 10px; }
.pl-word { font-family: var(--font-display); font-weight: 800; font-size: 38px; text-align: center; padding: 8px 0 4px; line-height: 1.2; }
.pl-skip { align-self: center; }
.pl-mid .donemark { margin-bottom: 2px; }

/* ------------------------------ "your plan is ready" ------------------------------ */
.ready { padding-top: calc(20px + env(safe-area-inset-top, 0px)); }
.ready .ob-head h1 { font-size: 30px; }
.ready-count { display: flex; flex-direction: column; gap: 14px; }
.ready-tl { display: flex; flex-direction: column; gap: 0; border-inline-start: 2px solid var(--line); margin-inline-start: 8px; }
.tl-step { display: flex; align-items: center; gap: 10px; padding: 7px 0; position: relative; padding-inline-start: 16px; }
.tl-step i { position: absolute; inset-inline-start: -8px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 3px var(--route); }
.tl-step.on i { background: var(--fg); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--mark); }
.tl-step b { font-weight: 700; }
.tl-step.on b { color: var(--fg); font-weight: 800; }
.ready-line { text-align: center; font-weight: 800; font-size: 16px; color: var(--fg); background: var(--mark-soft); border-radius: 16px; padding: 11px 14px; }
@media (prefers-reduced-motion: reduce) { .wow-logo .lg-fill { transform: none; } }

/* ------------------------------ a note about one question ------------------------------ */
.qm-end { gap: 8px; flex-wrap: nowrap; }
.qreport { display: inline-flex; align-items: center; gap: 4px; flex: none; min-height: 34px; padding: 3px 10px; border-radius: 10px; border: 0; background: var(--fill); color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; position: relative; }
.qreport::after { content: ""; position: absolute; inset: -6px -3px; }
@media (hover: hover) { .qreport:hover { color: var(--fg); background: var(--fill-2); } }
.qreport svg { width: 15px; height: 15px; }
.qreport.corner { position: absolute; top: 12px; inset-inline-end: 12px; }
@media (max-width: 380px) { .qreport span { display: none; } .qreport { padding: 3px 8px; } }

/* ------------------------------ שלב 5: the level graph ------------------------------ */
.lvc-card h3 { font-size: 19px; font-weight: var(--fw-display); }
.lvc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14px; }
.lvc-key { display: inline-flex; align-items: center; gap: 6px; }
.lvc-key b { font-variant-numeric: tabular-nums; min-width: 2.2em; }
.lvc-when { margin-inline-start: auto; }
.sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; flex: none; }
.sw-v { background: var(--c1); }
.sw-q { background: var(--c2); }
.lvchart { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; direction: rtl; }
.lvchart .grid { stroke: var(--line-2); stroke-width: 1; }
.lvchart .base { stroke: var(--line); stroke-width: 1; }
.lvchart .ax { fill: var(--muted); font-size: 11px; font-family: var(--font-text); font-variant-numeric: tabular-nums; }
.lvchart .ln { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.lvchart .ln-v { stroke: var(--c1); }
.lvchart .ln-q { stroke: var(--c2); }
.lvchart .dot { stroke: var(--card); stroke-width: 2; }
.lvchart .dot-v { fill: var(--c1); }
.lvchart .dot-q { fill: var(--c2); }
.lvchart .cross { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 3; }
.lvchart .sim-mk { fill: var(--card); stroke-width: 2; stroke-linejoin: round; }
.lvchart .sim-v { stroke: var(--c1); }
.lvchart .sim-q { stroke: var(--c2); }
.sw-sim { width: 10px; height: 10px; border: 2px solid var(--muted); border-radius: 1px; transform: rotate(45deg); display: inline-block; flex: none; }
.lvchart .hit { fill: transparent; cursor: crosshair; }
.lvc-summary { margin: 0; }
.lvc-table summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.lvc-table table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.lvc-table th, .lvc-table td { text-align: start; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.lvc-table th { color: var(--muted); font-weight: 700; }

/* ------------------------------ שלב 5: the score estimate ------------------------------ */
.est-card h3 { font-size: 19px; font-weight: var(--fw-display); }
.chip.est-chip { background: var(--mark); color: var(--mark-ink); }
.est-row { display: flex; flex-direction: column; gap: 5px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.est-row b { font-weight: 700; font-size: 15px; }
.est-val { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--fg); white-space: nowrap; }
.est-val .small { font-family: var(--font-text); font-weight: 500; }
.est-track { position: relative; display: block; height: 8px; border-radius: 999px; background: var(--fill-2); }
.est-track i { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--accent); opacity: .85; }
.est-gen { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding-top: 4px; }
.est-gen b { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--fg); }
.est-target { margin: 0; line-height: 1.7; background: var(--fill); border-radius: var(--radius-sm); padding: 10px 14px; }
.est-why { margin: 0; }
.est-how summary { cursor: pointer; color: var(--accent); font-weight: 700; }
.est-how ul { margin-top: 8px; }
.est-mini { gap: 4px; }
.est-mini b { font-weight: 800; }

/* ------------------------------ שלב 5: the mistakes log ------------------------------ */
.mk-note { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 420px; text-align: start; padding: 8px 14px; min-height: 46px; border-radius: 12px; border: 0; background: var(--bad-soft); color: var(--fg); font-size: 14px; font-weight: 700; cursor: pointer; }
@media (hover: hover) { .mk-note:hover { filter: brightness(.97); } }
.mk-note .grow { flex: 1; min-width: 0; }
.mk-note .chev { flex: none; width: 18px; height: 18px; color: var(--muted); }
.mk-ic { flex: none; display: inline-flex; color: var(--bad); }
.mk-ic svg { width: 20px; height: 20px; }
.mk-ic.big svg { width: 34px; height: 34px; }
.li .ic.mk-bad { background: var(--bad-soft); color: var(--bad); }
.li .ic.mk-ok { background: var(--ok-soft); color: var(--ok); }
.li .ic.mk-skip { background: var(--fill-2); color: var(--muted); }
.mkgroup { display: flex; flex-direction: column; gap: 8px; }
.mkgroup > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 2px; }
.mkgroup > summary::-webkit-details-marker { display: none; }
.mkgroup > summary b { flex: 1; min-width: 0; font-weight: 800; font-size: 16px; }
.mkgroup .gchev { flex: none; width: 18px; height: 18px; color: var(--muted); display: inline-flex; transform: rotate(-90deg); transition: transform .15s; }
.mkgroup .gchev svg { width: 18px; height: 18px; }
.mkgroup[open] .gchev { transform: rotate(90deg); }
.mk-links { gap: 6px; }
.mk-result { margin: 0; }
.est-track .est-dot { position: absolute; top: 50%; width: 14px; height: 14px; margin-inline-start: -7px; margin-top: -7px; border-radius: 50%; background: var(--surface); border: 3px solid var(--fg); box-sizing: border-box; }
.est-track .est-tgt { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-inline-start: -1.5px; border-radius: 2px; background: var(--mark); text-decoration: none; }
.est-key { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.est-key span { display: inline-flex; align-items: center; gap: 6px; }
.est-key i { display: inline-block; flex: none; }
.est-key .k-band { width: 16px; height: 8px; border-radius: 999px; background: var(--accent); opacity: .85; }
.est-key .k-dot { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--fg); background: var(--surface); box-sizing: border-box; }
.est-key .k-tgt { width: 3px; height: 14px; border-radius: 2px; background: var(--mark); }
.mkgroup .li .lt b { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* "don't show again" on flashcards, and a toast with an undo button */
.fhide { align-self: center; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 7px 14px; border-radius: 12px; border: 0; background: var(--fill); color: var(--fg); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.fhide svg { width: 16px; height: 16px; flex: none; color: var(--ok); }
@media (hover: hover) { .fhide:hover { background: var(--fill-2); } }
.toast.has-act { display: flex; align-items: center; gap: 10px; padding-inline-end: 8px; text-align: start; }
.toast-act { background: none; border: 0; color: var(--mark); font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; padding: 6px 10px; min-height: 36px; flex: none; }
.toast { width: max-content; }
/* five options or more wrap to a second row instead of hiding off-screen */
.seg.many { display: flex; flex-wrap: wrap; overflow: visible; width: fit-content; border-radius: 12px; }

/* ------------------------------ site search (under the top row) ------------------------------ */
:root { --sr-h: 54px; }
body.exam-mode, body.bare { --sr-h: 0px; }
body.exam-mode .searchrow { display: none; }
.searchrow .ss-in { max-width: 780px; margin: 0 auto; padding: 0 16px 10px; }
body.wide .searchrow .ss-in { max-width: 1080px; }
.ss { position: relative; }
.ss-box { position: relative; display: flex; align-items: center; }
.ss-ic { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); display: inline-flex; color: var(--muted); pointer-events: none; }
.ss-ic svg { width: 19px; height: 19px; }
.searchrow input.ss-input { min-height: 44px; height: 44px; padding-inline: 42px 42px; border-radius: 12px; border: 2px solid transparent; background: var(--fill); font-size: 16px; }
.searchrow input.ss-input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.searchrow input.ss-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.ss-clear { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ss-clear[hidden] { display: none; }
.ss-clear svg { width: 18px; height: 18px; }
.ss-clear:hover { background: var(--fill-2); color: var(--fg); }
.ss-panel { position: absolute; top: calc(100% + 6px); inset-inline: 0; z-index: 40; background: var(--bg); color: var(--fg); border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: min(70vh, 520px); overflow-y: auto; overscroll-behavior: contain; padding: 6px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.ss-panel[hidden] { display: none; }
.ss-head { font-size: 12px; font-weight: 800; color: var(--muted); padding: 8px 10px 4px; }
.ss-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; min-height: 54px; border-radius: 16px; cursor: pointer; }
.ss-item[aria-selected="true"] { background: var(--fill); }
.ss-iic { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.ss-iic svg { width: 18px; height: 18px; }
.ss-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ss-txt b { font-weight: 700; }
.ss-txt span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-kind { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--fill); border-radius: 8px; padding: 3px 8px; }
.ss-empty { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; }
.ss-empty span { font-size: 14px; color: var(--muted); }
.ss-more { display: block; width: 100%; text-align: start; border: 0; border-top: 1px solid var(--line-2); margin-top: 4px; padding: 12px 10px 8px; background: transparent; color: var(--accent); font-weight: 700; cursor: pointer; }

/* ------------------------------ simulations (שלב 7) ------------------------------ */
.sim-grid { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 1024px) { .sim-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; } }
.sim-card { gap: 10px; text-align: start; }
.sim-card.card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; }
.sim-card.card > * { grid-column: 1 / -1; }
.sim-card.card > .sim-ic { grid-column: 1; }
.sim-card.card > .sim-ic + h2 { grid-column: 2; }
.sim-card h2 { font-size: 22px; font-weight: var(--fw-display); }
.sim-card p { margin: 0; line-height: 1.65; }
.sim-card .bul { margin: 0; }
button.sim-card { width: 100%; font: inherit; color: inherit; cursor: pointer; }
.sim-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--cv-exam); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.sim-ic svg { width: 23px; height: 23px; }
.sim-ic.b { background: var(--cv-verbal); }
.sim-ic.c { background: var(--cv-quant); }
.sim-toggle { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 700; cursor: pointer; min-height: 38px; }
.sim-toggle input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 0; }
/* e1: consent to email updates (sign-up, settings, a one-time card on the home screen) */
.mail-ok { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; line-height: 1.5; }
.mail-ok input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 2px 0 0; }
.sim-resume { background: var(--mark-soft); }
.sim-resume .chip { align-self: flex-start; }
.sim-banner .sic { color: var(--cv-exam); }
.sim-head { padding-top: 4px; }
.sim-head .sim-sec { font-size: 16px; }
.sim-mapbox { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; }
.exam-side[hidden] { display: none !important; }
@media (min-width: 1024px) { .exam-layout.no-side { grid-template-columns: minmax(0, 1fr); } }
.cat-note { flex: 1 1 auto; text-align: center; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-score .result-big { font-size: 60px; }
.sim-doms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 420px; margin-top: 4px; }
.sim-doms .kpi { text-align: center; }
.sim-hrow { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.sim-hrow .grow { flex: 1 1 180px; min-width: 0; }
.sim-hrow .sim-g { font-size: 19px; font-weight: 800; color: var(--fg); min-width: 3ch; text-align: end; }
.simchart { margin-block: 4px; max-width: 460px; }
.essay-view { background: var(--fill); border-radius: var(--radius-sm); padding: 12px 14px; line-height: 1.8; max-height: 320px; overflow-y: auto; }
.nite-timer .result-big { font-size: 48px; }
.nite-timer .result-big.low { color: var(--bad); }
.nite-form { gap: 10px; }
.ne-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px auto 64px; align-items: center; gap: 8px; }
.ne-row input { width: 100%; min-height: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.ne-l { font-weight: 700; font-size: 14.5px; }
.nite-form details input { max-width: 120px; min-height: 44px; text-align: center; }

/* numbers in a row of soft tiles (progress, simulations) */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kpi { background: var(--fill); border: 0; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-family: var(--font-display); font-size: 30px; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 500; line-height: 1.35; }

/* task r7: footer link to the privacy policy and terms (home screen) */
.legal-foot { text-align: center; padding-block: 8px 4px; }
.legal-foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.legal-foot a:hover { color: var(--accent); }

/* ---- YouTube videos in lessons (task v1) ---- */
.yt-box { position: relative; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: var(--fill-2); }
.yt-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-card { position: absolute; inset: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; border: 0; cursor: pointer; color: #fff; text-align: center;
  background: var(--cv-plain); --focus: #fff; }
.yt-card:hover .yt-play, .yt-card:focus-visible .yt-play { transform: scale(1.06); }
.yt-play { width: 64px; height: 64px; border-radius: 50%; background: #fff; color: var(--cv-plain); display: inline-flex; align-items: center; justify-content: center; transition: transform .18s var(--ease); }
.yt-play svg { width: 26px; height: 26px; margin-left: 4px; fill: currentColor; }
.yt-meta { display: flex; flex-direction: column; gap: 4px; max-width: 34em; }
.yt-meta b { font-size: 16px; line-height: 1.35; font-weight: 800; }
.yt-meta span { font-size: 13px; color: rgba(255, 255, 255, .8); }
/* c4: rating a question and sharing it, under the explanation */
.qrate { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 2px; }
.qrate .qr-ask { margin-inline-end: 2px; }
.qr-btn, .qr-share { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 38px; border-radius: 10px; border: 0; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.qr-btn { width: 42px; padding: 0; }
.qr-share { padding: 3px 14px; margin-inline-start: auto; }
.qr-btn svg, .qr-share svg { width: 17px; height: 17px; }
@media (hover: hover) { .qr-btn:hover, .qr-share:hover { color: var(--fg); background: var(--fill-2); } }
.qr-btn.up[aria-pressed="true"] { color: var(--ok-ink); background: var(--ok); }
.qr-btn.down[aria-pressed="true"] { color: var(--bad-ink); background: var(--bad); }
.qr-url { width: 100%; font-size: 13px; text-align: left; }
/* c5: why the picked option is wrong, above the full explanation. Its title is red */
.whynot { display: flex; flex-direction: column; gap: 4px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.whynot > b { color: var(--bad); font-size: 17px; font-weight: 800; }
.whynot .wn-body { line-height: 1.6; }
