/* css/fonts.css */
/* self-hosted fonts (SIL Open Font License, see fonts/LICENSE-*.txt) */
@font-face { font-family: 'IBM Plex Sans Hebrew'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/ibm-plex-sans-hebrew-hebrew-400-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: 'IBM Plex Sans Hebrew'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/ibm-plex-sans-hebrew-latin-400-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; }
@font-face { font-family: 'IBM Plex Sans Hebrew'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/ibm-plex-sans-hebrew-hebrew-500-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: 'IBM Plex Sans Hebrew'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/ibm-plex-sans-hebrew-latin-500-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; }
@font-face { font-family: 'IBM Plex Sans Hebrew'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/ibm-plex-sans-hebrew-hebrew-600-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: 'IBM Plex Sans Hebrew'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/ibm-plex-sans-hebrew-latin-600-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; }
@font-face { font-family: 'IBM Plex Sans Hebrew'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/ibm-plex-sans-hebrew-hebrew-700-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: 'IBM Plex Sans Hebrew'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/ibm-plex-sans-hebrew-latin-700-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; }
@font-face { font-family: 'Secular One'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/secular-one-hebrew-400-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: 'Secular One'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/secular-one-latin-400-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)
   Palette: cool exam-paper ground, graphite ink, answer-sheet teal,
   highlighter yellow for key terms. Fonts: Secular One (display),
   IBM Plex Sans Hebrew (text).
   ===================================================================== */

:root {
  --bg: #F3F5F4;
  --card: #FFFFFF;
  --card-2: #EDF1F0;
  --fg: #1E2A2F;
  --muted: #5A6A70;
  --line: #D5DDDB;
  --line-2: #E4EAE8;
  --line-strong: #889592;
  --accent: #1B6E8C;
  --accent-ink: #FFFFFF;
  --accent-soft: #DCEDF3;
  --mark: #F5D247;
  --mark-soft: #FBEFB3;
  --ok: #1C6E48;
  --ok-soft: #DCF0E4;
  --bad: #A5362B;
  --bad-soft: #F7E0DC;
  --warn: #8A5A0B;
  --warn-soft: #FAEBCF;
  --c1: #1B6E8C;
  --c2: #7757A3;
  --c3: #C0693A;
  --c4: #3B8C66;
  --c1-soft: #DCEDF3;
  --c2-soft: #ECE4F5;
  --c3-soft: #F6E4D9;
  --c4-soft: #DDEFE5;
  --shadow: 0 1px 2px rgba(18, 40, 46, .06), 0 6px 18px rgba(18, 40, 46, .07);
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: "Secular One", "IBM Plex Sans Hebrew", "Arial Hebrew", "Segoe UI", sans-serif;
  --font-text: "IBM Plex Sans Hebrew", "Rubik", "Arial Hebrew", "Segoe UI", Tahoma, sans-serif;
  --nav-h: 62px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0F1618;
    --card: #162125;
    --card-2: #1C2A2F;
    --fg: #E3ECEA;
    --muted: #9AACB0;
    --line: #2B3A3F;
    --line-2: #233136;
    --line-strong: #5E7278;
    --accent: #5AB6D5;
    --accent-ink: #06232D;
    --accent-soft: #15343F;
    --mark: #E2C13D;
    --mark-soft: #3B3416;
    --ok: #4DC08B;
    --ok-soft: #16382A;
    --bad: #EE7A6B;
    --bad-soft: #43201B;
    --warn: #E2A94B;
    --warn-soft: #3C2D13;
    --c1: #5AB6D5;
    --c2: #B797E2;
    --c3: #E59C66;
    --c4: #6CC89C;
    --c1-soft: #15343F;
    --c2-soft: #2E2540;
    --c3-soft: #3D2A1C;
    --c4-soft: #173629;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F1618;
  --card: #162125;
  --card-2: #1C2A2F;
  --fg: #E3ECEA;
  --muted: #9AACB0;
  --line: #2B3A3F;
  --line-2: #233136;
  --line-strong: #5E7278;
  --accent: #5AB6D5;
  --accent-ink: #06232D;
  --accent-soft: #15343F;
  --mark: #E2C13D;
  --mark-soft: #3B3416;
  --ok: #4DC08B;
  --ok-soft: #16382A;
  --bad: #EE7A6B;
  --bad-soft: #43201B;
  --warn: #E2A94B;
  --warn-soft: #3C2D13;
  --c1: #5AB6D5;
  --c2: #B797E2;
  --c3: #E59C66;
  --c4: #6CC89C;
  --c1-soft: #15343F;
  --c2-soft: #2E2540;
  --c3-soft: #3D2A1C;
  --c4-soft: #173629;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
}

/* ------------------------------ base ------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  direction: rtl;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.25; margin: 0; text-wrap: balance; letter-spacing: .1px; }
h1 { font-size: 30px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 17px; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.lead { font-size: 17.5px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .6px; color: var(--muted); }
.num, .tab-nums { font-variant-numeric: tabular-nums; }
mark, .hlw { background: linear-gradient(transparent 38%, var(--mark-soft) 38%, var(--mark-soft) 92%, transparent 92%); color: inherit; padding: 0 2px; }

/* 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(--card) 30%, transparent) left center / 36px 100% no-repeat local,
    linear-gradient(to left, var(--card) 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(--card-2); font-weight: 600; }

/* ------------------------------ layout ------------------------------ */
.wrap { max-width: 780px; margin: 0 auto; padding-inline: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.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 ------------------------------ */
.card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.panel { background: var(--card-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.note { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 14px; }
.tip { background: var(--mark-soft); border-radius: var(--radius-sm); padding: 10px 14px; }
.warn { background: var(--warn-soft); border-radius: var(--radius-sm); padding: 10px 14px; }
.okbox { background: var(--ok-soft); border-radius: var(--radius-sm); padding: 10px 14px; }
.badbox { background: var(--bad-soft); border-radius: var(--radius-sm); padding: 10px 14px; }
.note b:first-child, .tip b:first-child, .warn b:first-child { margin-inline-end: 4px; }

/* ------------------------------ buttons ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--fg);
  font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, transform .08s;
  text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.sm { min-height: 36px; padding: 5px 12px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }

.seg { display: inline-flex; flex-wrap: nowrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--card-2); 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 14px; min-height: 38px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--card-2); font-size: 13.5px; font-weight: 600; 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-soft); color: var(--fg); }
.chip svg { width: 14px; height: 14px; }
button.chip { position: relative; min-height: 30px; }
button.chip::after { content: ""; position: absolute; inset: -7px -4px; }

/* ------------------------------ forms ------------------------------ */
input[type="text"], input[type="search"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-strong); background: var(--card); color: var(--fg);
}
textarea { min-height: 120px; line-height: 1.7; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14.5px; }

/* ------------------------------ progress ------------------------------ */
.bar { height: 8px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.bar.ok > i { background: var(--ok); }

/* ------------------------- answer options (bubble sheet) ------------------------- */
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start;
  min-height: 52px; padding: 10px 14px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); background: var(--card); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.opt:hover { border-color: var(--accent); }
.opt .bub {
  flex: none; width: 34px; height: 24px; border-radius: 50%; border: 1.6px solid var(--muted);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.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); background: var(--ok-soft); }
.opt.ok .bub { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.bad { border-color: var(--bad); background: var(--bad-soft); }
.opt.bad .bub { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt.dim { opacity: .6; }
.opt[disabled] { cursor: default; }

/* ------------------------------ widgets ------------------------------ */
.w { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.w-title { font-family: var(--font-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: 600; }
.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(--card-2); border-radius: var(--radius-sm); padding: 8px 12px; }
.w-kv > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.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(--card-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.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(--card-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: 16px; }
.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 .sn { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; margin-top: 2px; }
.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 */
/* =========================== 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); border-bottom: 1px solid var(--line-2);
}
.topbar .in { max-width: 780px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 8px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-size: 21px; flex: 1; min-width: 0; }
.brand svg { width: 30px; height: 30px; flex: none; }
.topbar .title { font-family: var(--font-display); font-size: 19px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; color: var(--fg); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.iconbtn:hover { background: var(--card-2); }
.iconbtn svg { width: 22px; height: 22px; }
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(--card); border-top: 1px solid 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 { border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 13px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.nav button svg { width: 24px; height: 24px; }
.nav button[aria-current="page"] { color: var(--accent); }
.nav button[aria-current="page"] .dot { background: var(--accent); }
.nav .dot { width: 18px; height: 3px; border-radius: 3px; background: transparent; margin-top: 1px; }
/* 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; border-top: 0; border-left: 1px solid var(--line); padding-top: 76px; }
  .nav .in { grid-template-columns: 1fr; grid-auto-rows: 78px; height: auto; }
  .shell { padding-right: 92px; }
  main { padding-bottom: 48px; }
}

/* =========================== generic pieces =========================== */
.hgroup { display: flex; flex-direction: column; gap: 4px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 6px; }
.section-title h2 { font-size: 21px; }
.list { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.li {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; padding: 13px 16px; min-height: 60px;
  border: 0; border-bottom: 1px solid var(--line-2); background: transparent; color: var(--fg); cursor: pointer;
}
.li:last-child { border-bottom: 0; }
.li:hover { background: var(--card-2); }
.li .lt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.li .lt b { font-weight: 600; }
.li .lt span { font-size: 13.5px; color: var(--muted); }
.li .chev { flex: none; color: var(--muted); width: 18px; height: 18px; }
.li .ic { flex: none; width: 38px; height: 38px; border-radius: 11px; 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(--c3-soft); color: var(--c3); }
.li .ic.d { background: var(--c4-soft); color: var(--c4); }
.li .done { flex: none; color: var(--ok); }
.li .done svg { width: 20px; height: 20px; }
.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: 999px; padding: 1px 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: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow);
  max-width: calc(100% - 32px); text-align: center;
}
.overlay { position: fixed; inset: 0; z-index: 70; background: rgba(10, 20, 24, .45); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.sheet { width: 100%; max-width: 560px; background: var(--card); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); max-height: 86vh; overflow: auto; }
@media (min-width: 700px) { .overlay { align-items: center; } }

/* =========================== home =========================== */
.hello { display: flex; flex-direction: column; gap: 6px; }
.hello h1 { font-size: 28px; }
.countdown { display: flex; align-items: center; gap: 14px; }
.countdown .big { font-family: var(--font-display); font-size: 40px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.plan-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; padding: 11px 14px; min-height: 64px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--card); cursor: pointer; transition: border-color .15s, background .15s; }
.plan-item:hover { border-color: var(--accent); }
.plan-item .pc { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.plan-item .pc svg { width: 21px; height: 21px; }
.plan-item.done { border-color: var(--line-2); background: transparent; }
.plan-item.done .pc { background: var(--ok-soft); color: var(--ok); }
.plan-item.done .pt b { color: var(--muted); }
.plan-item .pt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.plan-item .pt b { font-weight: 600; }
.plan-item .pt span { font-size: 13.5px; color: var(--muted); }
.plan-item .pn { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.plan-item.done .pn { color: var(--ok); }
.plan-item .chev { flex: none; width: 18px; height: 18px; color: var(--muted); display: inline-flex; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-family: var(--font-display); font-size: 24px; font-weight: 400; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 600; }

/* =========================== 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: 13px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line-2); background: var(--card); cursor: pointer; min-height: 96px; }
.tile:hover { border-color: var(--accent); }
.tile b { font-weight: 600; font-size: 15.5px; line-height: 1.35; }
.tile span { font-size: 13px; color: var(--muted); }
.tile .bar { margin-top: auto; height: 6px; }

/* =========================== flashcards =========================== */
.flash {
  position: relative; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 20px; padding: 26px 20px; box-shadow: var(--shadow); cursor: pointer;
}
.flash .fw { font-family: var(--font-display); font-size: 38px; line-height: 1.25; }
.flash .fw.idiom { font-size: 30px; }
.flash .fnq { font-size: 17px; color: var(--muted); }
.flash .fmeta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.flash .fhint { color: var(--muted); font-size: 14px; }
.flash .fd { font-size: 19px; font-weight: 600; max-width: 34ch; }
.flash .fe { color: var(--muted); max-width: 40ch; }
.flash .fe b { color: var(--fg); font-weight: 700; }
.flash.back { cursor: default; align-items: stretch; text-align: start; }
.flash.back .fw { font-size: 28px; text-align: center; }
.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; gap: 1px; padding: 9px 4px; min-height: 58px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; cursor: pointer; font-size: 14.5px; }
.grades button span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.grades .g0 { border-color: var(--bad); color: var(--bad); }
.grades .g1 { border-color: var(--warn); color: var(--warn); }
.grades .g2 { border-color: var(--ok); color: var(--ok); }
.grades .g3 { border-color: var(--accent); color: var(--accent); }
.grades button:hover { background: var(--card-2); }
.progress-line { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-line .bar { flex: 1; }

/* =========================== 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: 17px; line-height: 1.75; }
.qtext .stem { font-family: var(--font-display); font-size: 25px; text-align: center; padding: 6px 0; }
.qsent { font-size: 17.5px; line-height: 1.9; }
.qsent .blank { display: inline-block; min-width: 72px; border-bottom: 2px solid var(--muted); 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: 4px 4px 0 0; }
.qsent .blank.fill-bad { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); border-radius: 4px 4px 0 0; }
.explain { display: flex; flex-direction: column; gap: 8px; border-radius: 12px; padding: 12px 14px; background: var(--card-2); }
.explain.ok { background: var(--ok-soft); }
.explain.bad { background: var(--card-2); border-inline-start: 4px solid var(--bad); }
.explain .verdict { font-weight: 700; }
.explain .verdict.ok { color: var(--ok); }
.explain .verdict.bad { color: var(--bad); }
.opt-exp { font-size: 14.5px; display: flex; gap: 8px; align-items: flex-start; }
.opt-exp .mk { flex: none; font-weight: 700; width: 18px; text-align: center; }
.opt-exp .mk.ok { color: var(--ok); }
.opt-exp .mk.bad { color: var(--muted); }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.timer.low { color: var(--bad); }
.qgrid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.qgrid button { min-height: 40px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; padding: 0; }
.qgrid button.ans { background: var(--accent-soft); border-color: var(--accent); }
.qgrid button.cur { outline: 2.5px solid var(--fg); outline-offset: 1px; }
.qgrid button.flag { border-color: var(--warn); }
.qgrid button.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.qgrid button.bad { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.qgrid button.skip { background: transparent; border: 1.5px dashed var(--muted); color: var(--muted); }
.result-big { font-family: var(--font-display); font-size: 46px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }

/* =========================== drills keypad =========================== */
.drill-q { font-family: var(--font-display); font-size: 34px; 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: 700; direction: ltr; min-height: 52px; border-radius: 12px; background: var(--card-2); 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: 54px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); font-size: 21px; font-weight: 700; cursor: pointer; }
.keypad button.go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.keypad button:active { transform: translateY(1px); }

/* =========================== dictionary =========================== */
.letters { display: flex; flex-wrap: wrap; gap: 6px; }
.letters button { min-width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; cursor: pointer; }
.letters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dict-row { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.dict-row:last-child { border-bottom: 0; }
.dict-row .dw { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dict-row .dw b { font-size: 17.5px; font-weight: 700; }
.dict-row .dd { color: var(--muted); font-size: 14.5px; }
.dict-row.open { background: var(--card-2); 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: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--line); 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: 27px; }
.lesson .sec h3 { font-size: 19px; }
.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-size: 20px; }
.passage p { line-height: 1.85; }
.passage .pnum { color: var(--muted); font-size: 13px; font-weight: 700; margin-inline-end: 6px; }
.formula-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.formula { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.formula b { font-weight: 700; }
.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: 16.5px; line-height: 1.9; }
.phase { display: flex; gap: 6px; }
.phase span { flex: 1; height: 6px; border-radius: 4px; background: var(--card-2); }
.phase span.on { background: var(--accent); }
.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(--accent); border-radius: 4px 4px 1px 1px; min-height: 2px; }
.daybars .db.today i { background: var(--c3); }
.daybars .db span { font-size: 11px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.stackbar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--card-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: 3px; 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(--card-2); padding: 8px 10px; border-radius: 8px; }

/* =========================== 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; }
.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; border-bottom: 1px solid var(--line-2);
}
.exam-bar .timer { font-size: 20px; }
.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: 22px; height: 22px; 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-soft); color: var(--ok); }
.review summary .mk.bad { background: var(--bad-soft); color: var(--bad); }
.review summary .mk.skip { background: var(--card-2); color: var(--muted); }
.keypad .go { grid-column: span 2; }
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.yn .btn { min-height: 60px; 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(--accent); color: var(--accent-ink); }
.phase-step.past .sn { background: var(--ok-soft); color: var(--ok); }
.phase-step.past .sn svg { width: 15px; height: 15px; }
.phase-step + .phase-step { border-top: 1px dashed 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: 400; font-size: 17px; }
/* reading practice: list of passages */
.plist .li .lvl { font-size: 12.5px; }

/* =====================================================================
   design refresh (ע-2 … ע-25) — home, celebrations, lessons, hubs,
   reading, exam mode, flashcards and the desktop layout
   ===================================================================== */
.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 ------------------------------ */
.hello .week-row { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-top: 4px; }
.weekdots { display: inline-flex; gap: 3px; }
.weekdots .wd { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 26px; font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.2; }
.weekdots .wd i { width: 18px; height: 13px; border-radius: 50%; border: 1.6px solid var(--line-strong); display: block; }
.weekdots .wd.on i { background: var(--accent); border-color: var(--accent); }
.weekdots .wd.today span { color: var(--fg); }
.weekdots .wd.today i { box-shadow: 0 0 0 3px var(--accent-soft); }
.weekdots .wd.future i { border-style: dashed; border-color: var(--line); }

.home-grid { display: flex; flex-direction: column; gap: 14px; }
.home-main, .home-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (min-width: 1024px) {
  .home-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; align-items: start; }
  .home-side { padding-top: 2px; }
}

/* ע-2: the "next step" card in brand color */
.hero { position: relative; overflow: hidden; background: var(--accent); color: var(--accent-ink); border-radius: 20px; padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.hero > * { position: relative; }
.hero .hero-deco { position: absolute; top: -20px; inset-inline-end: -30px; width: 136px; height: 90px; pointer-events: none; }
.hero .hero-deco svg { width: 100%; height: 100%; display: block; }
.hero .hero-deco .lo { opacity: .28; }
.hero .eyebrow { color: inherit; opacity: .88; }
.hero h2 { font-size: 25px; padding-inline-end: 88px; }
.hero .hero-sub { font-size: 15px; opacity: .92; }
.hero .btn.inverse { margin-top: 6px; }
.hero-foot { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.hero-foot .segs { flex: 1; min-width: 60px; }
.segs { display: flex; gap: 5px; }
.segs i { flex: 1; height: 6px; border-radius: 4px; }
.hero .segs i { background: currentColor; opacity: .3; }
.hero .segs i.on { opacity: 1; }
.hero-count { font-size: 13.5px; font-weight: 600; opacity: .92; }
.btn.inverse { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--accent); min-height: 48px; font-size: 16.5px; }
.btn.inverse:hover { border-color: var(--accent-ink); filter: brightness(.97); }
.btn.inverse svg { width: 18px; height: 18px; }

/* ע-9: the first day */
.firstday { display: flex; flex-direction: column; gap: 12px; border: 1.5px dashed var(--accent); box-shadow: none; }
ol.steps3 { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: st; }
ol.steps3 li { counter-increment: st; display: flex; gap: 10px; align-items: flex-start; line-height: 1.6; }
ol.steps3 li::before { content: counter(st); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--mark); color: #1E2A2F; font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.linkbtn { background: none; border: 0; padding: 6px 2px; min-height: 36px; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* 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 14px; min-height: 54px; border-radius: 14px; border: 1.5px dashed var(--line-strong); background: transparent; cursor: pointer; color: var(--fg); }
.slimrow:hover { border-color: var(--accent); background: var(--card); }
.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: 700; }
button.countdown { text-align: start; cursor: pointer; width: 100%; }
button.countdown:hover, .cardlink:hover { border-color: var(--accent); }
.cardlink { text-align: start; cursor: pointer; width: 100%; }
.ic-lg { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.ic-lg svg { width: 24px; height: 24px; }
.gearbtn { flex: none; color: var(--muted); }

/* ------------------------------ ע-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(--card); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; animation: dm-draw .2s .4s ease-out forwards; }
@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 dashed var(--line); }
.finish-foot .fstat { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ok); }
.finish-foot .fstat svg { width: 18px; height: 18px; flex: none; }
.finish-foot .segs { width: 100%; max-width: 260px; }
.finish-foot .segs i { background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); }
.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: 26px 20px 20px; }
.streak-line { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; color: var(--c3); }
.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; }
.li .ic.num { font-family: var(--font-display); font-size: 17px; line-height: 1; }
.li .ic.num.ok { background: var(--ok-soft); color: var(--ok); }
.li .chip.mins { flex: none; }

/* ע-11: quant hub */
.startrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.startcard { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: start; padding: 11px 12px; min-height: 104px; border-radius: var(--radius-sm); border: 1.5px solid var(--line-2); background: var(--card); cursor: pointer; }
.startcard .small { font-size: 13px; line-height: 1.4; }
.startcard:hover { border-color: var(--accent); }
.startcard .sic { width: 34px; height: 34px; border-radius: 10px; background: var(--mark-soft); color: var(--fg); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.startcard .sic svg { width: 19px; height: 19px; }
.startcard b { font-weight: 700; }
.qgroup { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); }
.qgroup > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 62px; cursor: pointer; border-radius: var(--radius); }
.qgroup > summary::-webkit-details-marker { display: none; }
.qgroup > summary:hover { background: var(--card-2); }
.qgroup .ic { flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); 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: 700; }
.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 14px 14px; }
@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(--card-2); color: var(--muted); font-weight: 600; font-size: 13.5px; padding: 6px 13px; min-height: 36px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.lchip[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
.lesson-progress { height: 3px; background: var(--line-2); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.lesson-progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.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; border-inline-start: 2px solid var(--line-2); }
  .toc-list button { display: block; width: 100%; text-align: start; background: none; border: 0; border-inline-start: 2px solid transparent; margin-inline-start: -2px; padding: 7px 12px; color: var(--muted); font-weight: 600; font-size: 14.5px; cursor: pointer; }
  .toc-list button:hover { color: var(--fg); }
  .toc-list button[aria-current="true"] { color: var(--accent); border-inline-start-color: var(--accent); }
}

/* ------------------------------ ע-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; border-bottom: 1px solid 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: 400; font-size: 20px; }
#read-passage, #read-qs { scroll-margin-top: 124px; }
.pchip svg { width: 13px; height: 13px; }
.para-sheet { line-height: 1.85; font-size: 16.5px; }
@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: 38px; padding: 4px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.mapbtn:hover { border-color: var(--accent); }
.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: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line); background: var(--card); display: inline-block; }
.qlegend i.ans { background: var(--accent-soft); border-color: var(--accent); }
.qlegend i.flag { border: 2px solid var(--warn); }
.qlegend i.ok { background: var(--ok-soft); border-color: var(--ok); }
.qlegend i.bad { background: var(--bad-soft); border-color: var(--bad); }
.qlegend i.skip { background: transparent; border-style: dashed; border-color: var(--muted); }
@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: 32px; text-align: center; }
.flash.back .fw.idiom { font-size: 26px; }
.flash.back .fnq { text-align: center; }
.flash.back .fmeta { justify-content: center; }
.fsep { height: 1px; background: var(--line-2); 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 bubbles, like an answer-sheet row */
.lvmeter { display: inline-flex; gap: 3px; direction: rtl; flex: none; }
.lvmeter i { width: 13px; height: 10px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: block; }
.lvmeter i.on { background: var(--accent); border-color: var(--accent); }
.lvrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 28px; gap: 10px; align-items: center; }
.lvrow .lvl-label { display: flex; flex-direction: column; min-width: 0; }
.lvrow .lvl-label b { font-weight: 600; font-size: 15px; }
.lvrow .lvnum { font-family: var(--font-display); font-size: 21px; color: var(--accent); text-align: center; font-variant-numeric: tabular-nums; }
.lvline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.levels-card h3 { font-size: 18px; }
.lvdetails > summary { cursor: pointer; font-weight: 700; 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: 10px; height: 8px; } }

/* ------------------------------ ע-10: the first screen ------------------------------ */
.wow { min-height: 100vh; min-height: 100dvh; background: var(--accent); color: var(--accent-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: 84px; height: 84px; }
.wow-logo svg { width: 100%; height: 100%; }
.wow-logo .lg-bg { fill: var(--accent-ink); }
.wow-logo .lg-lo { fill: var(--accent); }
.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-size: 18px; opacity: .9; }
.wow h1 { font-size: 32px; line-height: 1.2; }
.wow-sub { font-size: 16.5px; opacity: .92; max-width: 42ch; }
.wow .btn.inverse { margin-top: 8px; }
.wow .btn.inverse svg { width: 18px; height: 18px; }
.linkbtn.inv { color: inherit; opacity: .9; }
/* 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: 32px; height: 32px; border-radius: 50%; background: #0E7A40; color: #fff; display: inline-flex; align-items: center; justify-content: center; margin-inline-start: 2px; }
.wa-top svg { width: 19px; height: 19px; }
.wa-top:hover, .wa-cta:hover { background: #0B6635; }
.wa-top:focus-visible, .wa-cta:focus-visible { outline: 2px solid 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 16px; min-height: 44px; border-radius: 999px; background: #0E7A40; color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; }
.wa-cta svg { width: 20px; height: 20px; flex: none; }
.wow .wa-cta:focus-visible { outline-color: var(--accent-ink); }
.demos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; margin: 8px 0; }
.demo { background: rgba(255, 255, 255, .12); border-radius: 14px; padding: 12px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
:root[data-theme="dark"] .demo { background: rgba(0, 0, 0, .12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .demo { background: rgba(0, 0, 0, .12); } }
.demo-cap { font-size: 13px; font-weight: 600; opacity: .92; }
.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: 10px; background: var(--accent-ink); color: var(--accent); font-weight: 700; backface-visibility: hidden; font-size: 15px; padding: 0 4px; }
.demo-flip .f1 { font-family: var(--font-display); font-weight: 400; font-size: 19px; animation: df1 4s infinite; }
.demo-flip .f2 { transform: rotateY(180deg); font-size: 13.5px; 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: 700; }
.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: 6px; border-radius: 6px; background: var(--card-2); overflow: hidden; }
.ob-prog i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .25s; }
.ob-head { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.ob-head h1 { font-size: 26px; }
.ob input[type="text"] { font-size: 18px; min-height: 54px; }
.ob-next { margin-top: 6px; min-height: 52px; font-size: 16.5px; }
.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: 64px; padding: 10px 14px; text-align: start; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--card); cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--accent); }
.choice .cic { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); 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: 700; font-size: 16px; }
.choice .ct span { font-size: 13.5px; color: var(--muted); }
.choice .ccheck { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; color: transparent; }
.choice .ccheck svg { width: 16px; height: 16px; }
.choice.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.choice.on .ccheck { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.feel-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line-2); }
.feel-l { display: flex; align-items: center; gap: 10px; }
.feel-l .cic { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); 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: 12px; border: 1.5px solid var(--line-strong); background: var(--card); font-weight: 700; cursor: pointer; }
.feel-seg button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.target-box { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 18px 16px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line-2); }
.target-big { font-family: var(--font-display); font-size: 64px; line-height: 1; color: var(--accent); text-align: center; }
.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: 15.5px; }

/* ------------------------------ 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: 46px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--card); color: var(--fg); font-weight: 600; font-size: 14.5px; line-height: 1.3; cursor: pointer; text-align: center; }
.picks button:hover { border-color: var(--accent); }
.picks button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.goalview .card h3 { font-size: 17px; }
.goal-sum { margin: 0; padding-inline-start: 18px; }
.newcard { border: 1.5px solid var(--accent); }
.newcard .chip { align-self: flex-start; }
.emph-line { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; background: none; border: 0; padding: 0; margin-top: -4px; cursor: pointer; }
.emph-line .small { text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------ 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-size: 34px; text-align: center; padding: 8px 0 4px; line-height: 1.25; }
.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: 28px; }
.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-2); 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(--card); border: 2px solid var(--line-strong); }
.tl-step.on i { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-step b { font-weight: 600; }
.tl-step.on b { color: var(--accent); }
.ready-line { text-align: center; font-weight: 700; font-size: 16px; color: var(--accent); background: var(--accent-soft); border-radius: 12px; padding: 10px 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: 32px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; position: relative; }
.qreport::after { content: ""; position: absolute; inset: -6px -3px; }
.qreport:hover { color: var(--accent); border-color: var(--accent); }
.qreport svg { width: 15px; height: 15px; }
.qreport.corner { position: absolute; top: 10px; inset-inline-end: 10px; }
@media (max-width: 380px) { .qreport span { display: none; } .qreport { padding: 3px 7px; } }

/* ------------------------------ שלב 5: the level graph ------------------------------ */
.lvc-card h3 { font-size: 18px; }
.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(--c3); }
.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; stroke-linejoin: round; stroke-linecap: round; }
.lvchart .ln-v { stroke: var(--c1); }
.lvchart .ln-q { stroke: var(--c3); }
.lvchart .dot { stroke: var(--card); stroke-width: 2; }
.lvchart .dot-v { fill: var(--c1); }
.lvchart .dot-q { fill: var(--c3); }
.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(--c3); }
.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: 600; }
.lvc-table table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13.5px; }
.lvc-table th, .lvc-table td { text-align: start; padding: 4px 6px; border-bottom: 1px solid var(--line-2); }
.lvc-table th { color: var(--muted); font-weight: 600; }

/* ------------------------------ שלב 5: the score estimate ------------------------------ */
.est-card h3 { font-size: 18px; }
.chip.est-chip { background: var(--mark-soft); color: var(--fg); }
.est-row { display: flex; flex-direction: column; gap: 5px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.est-row b { font-weight: 600; font-size: 15px; }
.est-val { font-family: var(--font-display); font-size: 21px; color: var(--accent); white-space: nowrap; }
.est-val .small { font-family: var(--font-text); }
.est-track { position: relative; display: block; height: 10px; border-radius: 999px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line-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: 21px; font-weight: 400; color: var(--accent); }
.est-target { margin: 0; line-height: 1.7; background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 14px; }
.est-why { margin: 0; }
.est-how summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.est-how ul { margin-top: 8px; }
.est-mini { gap: 4px; }
.est-mini b { font-weight: 700; }

/* ------------------------------ שלב 5: the mistakes log ------------------------------ */
.mk-note { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 420px; text-align: start; padding: 8px 12px; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); color: var(--fg); font-size: 14px; font-weight: 600; cursor: pointer; }
.mk-note:hover { border-color: var(--accent); }
.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(--card-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: 700; 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: 12px; height: 12px; margin-inline-start: -6px; margin-top: -6px; border-radius: 50%; background: var(--card); border: 3px solid var(--accent); 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(--fg); 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: 10px; height: 10px; border-radius: 50%; border: 3px solid var(--accent); background: var(--card); box-sizing: border-box; }
.est-key .k-tgt { width: 3px; height: 14px; border-radius: 2px; background: var(--fg); }
.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: 40px; padding: 7px 14px; border-radius: 999px; border: 1.5px solid transparent; background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.fhide svg { width: 16px; height: 16px; flex: none; }
.fhide:hover { border-color: var(--accent); }
.toast.has-act { display: flex; align-items: center; gap: 10px; padding-inline-end: 8px; text-align: start; }
.toast-act { background: none; border: 0; color: inherit; font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 8px; 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; }

/* ------------------------------ 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: 12px; 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: 40px 42px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-size: 16px; }
.searchrow input.ss-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px 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(--card-2); color: var(--fg); }
.ss-panel { position: absolute; top: calc(100% + 6px); inset-inline: 0; z-index: 40; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow), 0 12px 32px rgba(10, 20, 24, .16);
  max-height: min(70vh, 520px); overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.ss-panel[hidden] { display: none; }
.ss-head { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 8px 10px 4px; }
.ss-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; min-height: 52px; border-radius: 10px; cursor: pointer; }
.ss-item[aria-selected="true"] { background: var(--accent-soft); }
.ss-iic { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--card-2); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.ss-iic svg { width: 19px; height: 19px; }
.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: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-kind { flex: none; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--card-2); border-radius: 999px; padding: 3px 9px; }
.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: 600; 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 h2 { font-size: 21px; }
.sim-card p { margin: 0; line-height: 1.7; }
.sim-card .bul { margin: 0; }
button.sim-card { width: 100%; font: inherit; color: inherit; cursor: pointer; }
.sim-ic { width: 44px; height: 44px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.sim-ic svg { width: 24px; height: 24px; }
.sim-ic.b { background: var(--mark-soft); color: var(--fg); }
.sim-ic.c { background: var(--card-2); color: var(--fg); }
.sim-toggle { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; cursor: pointer; min-height: 36px; }
.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 { border: 1.5px solid var(--accent); }
.sim-resume .chip { align-self: flex-start; }
.sim-banner .sic { color: var(--accent); }
.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: 54px; }
.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-2); }
.sim-hrow .grow { flex: 1 1 180px; min-width: 0; }
.sim-hrow .sim-g { font-size: 18px; color: var(--accent); min-width: 3ch; text-align: end; }
.simchart { margin-block: 4px; max-width: 460px; }
.essay-view { background: var(--card-2); border-radius: var(--radius-sm); padding: 12px 14px; line-height: 1.8; max-height: 320px; overflow-y: auto; }
.nite-timer .result-big { font-size: 44px; }
.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: 42px; text-align: center; font-variant-numeric: tabular-nums; }
.ne-l { font-weight: 600; font-size: 14.5px; }
.nite-form details input { max-width: 120px; min-height: 42px; text-align: center; }
.plan-item.opt { border-style: dashed; }
.plan-item .opt-chip { margin-inline-start: 8px; font-size: 12px; padding: 1px 8px; vertical-align: 2px; }

/* 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: var(--radius-sm); overflow: hidden; background: var(--card-2); border: 1px solid var(--line-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: var(--fg); text-align: center;
  background: radial-gradient(circle at 50% 40%, var(--accent-soft), transparent 70%), var(--card-2); }
.yt-card:hover .yt-play, .yt-card:focus-visible .yt-play { transform: scale(1.06); }
.yt-play { width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; transition: transform .15s; box-shadow: var(--shadow); }
.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: 15.5px; line-height: 1.35; }
.yt-meta span { font-size: 13px; color: var(--muted); }
/* 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: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.qr-btn { width: 40px; padding: 0; }
.qr-share { padding: 3px 12px; margin-inline-start: auto; }
.qr-btn svg, .qr-share svg { width: 17px; height: 17px; }
.qr-btn:hover, .qr-share:hover { color: var(--accent); border-color: var(--accent); }
.qr-btn.up[aria-pressed="true"] { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.qr-btn.down[aria-pressed="true"] { color: var(--bad); border-color: var(--bad); background: var(--card-2); }
.qr-url { width: 100%; font-size: 13px; text-align: left; }
/* c5: why the picked option is wrong, above the full explanation */
.whynot { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); border-inline-start: 4px solid var(--bad); }
.whynot > b { color: var(--bad); font-size: 14px; }
.whynot .wn-body { line-height: 1.6; }
