:root {
  --bg: #F7F5FF;
  --ink: #23214A;
  --ink-soft: #5E5A8C;
  --primary: #7B5CFF;
  --primary-dark: #5B3EE0;
  --mint: #2EC98A;
  --sun: #FFD23F;
  --expo: #FF5C8A;
  --sky: #4CC9F0;
  --card: #FFFFFF;
  --line: #E6E1FA;
  --soft: #ECEAF5;
  --scale: 1;
  --r: 22px;
  --font: 'Google Sans', 'Segoe UI', 'Arial Hebrew', system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: calc(17px * var(--scale)); -webkit-text-size-adjust: 100%; }
/* hidden תמיד מסתיר, גם כשלאלמנט יש display משלו (זה כבר תפס פעמיים) */
[hidden] { display: none !important; }
/* אף מסך לא נגלל הצידה, גם אם משהו קטן חורג */
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.5; overscroll-behavior: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:disabled { cursor: default; }
h1, h2, h3 { font-weight: 600; margin: 0; line-height: 1.25; }
p { margin: 0 0 .6em; }

/* מתמטיקה: תמיד משמאל לימין, מבודד מהעברית */
.math { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.math.big { font-size: 2.1rem; }
.katex { font-size: 1.12em; }
.ex { color: var(--expo); }
.hole .boxed, .hole .fbox { border-color: var(--primary) !important; border-radius: 6px; }
.filled { color: var(--primary); }
.ex .filled { color: var(--expo); text-decoration: underline 2px; text-underline-offset: 3px; }
.mathline { text-align: center; font-size: 1.35rem; margin: .4em 0 .8em; }

/* שלד מסך */
#app { min-height: 100dvh; }
.screen { min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}
.top h1 { font-size: 1.25rem; }
.icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; background: var(--card); box-shadow: 0 1px 0 var(--line); }
span.icon { background: none; box-shadow: none; }
.back { font-size: 1.5rem; }
.body { flex: 1; padding: 8px 16px 24px; }
.body.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.dock {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 16px calc(env(safe-area-inset-bottom) + 14px);
  background: linear-gradient(to top, var(--bg) 75%, transparent);
}

/* כפתורים */
.main {
  min-height: 56px; width: 100%; border-radius: 18px;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 1.12rem;
  box-shadow: 0 4px 0 var(--primary-dark);
  transition: transform .12s, box-shadow .12s, background .2s;
}
.main:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--primary-dark); }
.main:disabled { background: #C9C2EC; box-shadow: 0 4px 0 #B3AADF; }
.ghost {
  min-height: 52px; width: 100%; border-radius: 18px; background: var(--card); color: var(--primary);
  font-weight: 600; border: 2px solid var(--line);
}
.ghost:active { transform: translateY(2px); }
.tools { display: flex; gap: 10px; }
.tool {
  flex: 1; min-height: 46px; border-radius: 14px; background: var(--card); border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 1.1rem;
}
.tool span { font-size: .9rem; color: var(--ink-soft); font-weight: 600; }
.tool:disabled { opacity: .45; }

/* במסכי פרק ומבחן: הכפתורים למטה לא מסתירים כלום. אם התוכן לא נכנס, הוא נגלל בתוך האזור שלו */
.screen.lesson { height: 100dvh; min-height: 0; }
.screen.lesson .body { overflow-y: auto; min-height: 0; overscroll-behavior: contain; scrollbar-width: none; }
.screen.lesson .body::-webkit-scrollbar { display: none; }
/* ביטוי בשאלה תמיד בשורה אחת. אם הוא ארוך, fitMath מקטין אותו */
.question .katex-html { white-space: nowrap; }
.screen.lesson .dock { position: static; background: var(--bg); padding-top: 8px; }
.screen.lesson .top { position: static; }
.skip { min-height: 44px; color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
@media (max-height: 740px) {
  .key { min-height: 44px; font-size: 1.3rem; }
  .keypad { gap: 6px; }
  .question { min-height: 72px; padding: 4px 0; }
  .coach .mascot { width: 70px; }
  .main, .cta { min-height: 52px; }
}

/* נקודות התקדמות */
.dots { display: flex; gap: 6px; flex: 1; justify-content: center; }
.dots span { height: 10px; flex: 1; max-width: 34px; border-radius: 99px; background: var(--soft); transition: background .3s; }
.dots .done { background: var(--mint); }
.dots .now { background: var(--primary); }

/* כרטיס הסבר */
.card {
  background: var(--card); border-radius: var(--r); padding: 20px 18px; margin-top: 6px;
  box-shadow: 0 2px 0 var(--line), 0 10px 30px -18px rgba(60, 40, 160, .35);
  animation: rise .3s ease-out;
}
.card h2 { font-size: 1.45rem; margin: 6px 0 12px; }
.chip { display: inline-block; font-size: .8rem; font-weight: 600; padding: 3px 12px; border-radius: 99px; background: #EEE9FF; color: var(--primary); }
.k-trap .chip { background: #FFF3C4; color: #8A6A00; }
.k-rule .chip { background: #DDF8EC; color: #138A5C; }
.k-where .chip { background: #DDF4FC; color: #1A7EA0; }
.k-rule .mathline { background: #F4F1FF; border: 2px dashed var(--primary); border-radius: 16px; padding: 10px; }
.unfold { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 10px; }
.unfold li { background: #FAF8FF; border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.unfold .math.big { font-size: 1.55rem; }
.note { font-size: .92rem; color: var(--ink-soft); text-align: center; }

/* תרגיל */
.coach { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.coach .mascot { width: 88px; flex: none; }
.bubble {
  position: relative; background: var(--card); border-radius: 18px; padding: 10px 14px; font-weight: 600;
  box-shadow: 0 2px 0 var(--line); min-height: 44px; display: flex; align-items: center;
}
.prompt { font-weight: 600; color: var(--ink-soft); text-align: center; }
.question { display: flex; justify-content: center; align-items: center; min-height: 92px; padding: 8px 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
/* באנדרואיד הופיע פס גלילה אפור בצד הביטוי */
.question::-webkit-scrollbar { display: none; }
.question:empty { display: none; }
.cmp { display: flex; align-items: center; gap: 14px; }
.cmp-q { font-size: 1.6rem; color: var(--primary); font-weight: 600; width: 44px; height: 44px; border-radius: 12px; border: 2px dashed var(--primary); display: grid; place-items: center; }
.answers { margin-top: 6px; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opts.row { flex-direction: row; }
.opts.row .opt { flex: 1; }
.opt {
  min-height: 60px; border-radius: 18px; background: var(--card); border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--line); padding: 8px 12px; font-size: 1.15rem;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background .25s, border-color .25s, transform .12s, opacity .25s;
}
.opt .math { font-size: 1.35rem; }
.opt:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.opt.text { font-weight: 600; }
.opt.sym { font-size: 1.8rem; font-weight: 600; }
.opt.step { justify-content: space-between; }
.stepn { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.opt.right { background: #DDF8EC; border-color: var(--mint); box-shadow: 0 3px 0 var(--mint); opacity: 1; }
.opt.tried { background: var(--soft); border-color: var(--soft); box-shadow: none; color: #9A97B5; }
.opt.tried .ex { color: #C4A3B2; }
.opt:disabled:not(.right):not(.tried) { opacity: .7; }

/* תרגיל רב-שלבי */
.parentq { display: flex; align-items: center; justify-content: center; gap: 8px; background: #F4F1FF; border-radius: 14px; padding: 6px 12px; margin-bottom: 4px; }
.parentq span { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }

/* סמני את כל מה שנכון */
.opt.pick { justify-content: flex-start; }
.opt.pick .math { flex: 1; text-align: center; }
.opt .box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); flex: none; display: grid; place-items: center; }
.opt.sel { border-color: var(--primary); background: #F4F1FF; }
.opt.sel .box { background: var(--primary); border-color: var(--primary); }
.opt.sel .box::after { content: '✓'; color: #fff; font-size: .9rem; font-weight: 600; }

/* סידור */
.order-labels { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; color: var(--ink-soft); padding: 0 4px; }
.order-line { min-height: 70px; border: 2px dashed var(--line); border-radius: 18px; padding: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-start; margin: 6px 0 12px; }
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.opt.chipbtn { min-height: 52px; padding: 6px 14px; flex-direction: row; gap: 6px; }
.opt.chipbtn.placed { background: #F4F1FF; border-color: var(--primary); }

/* בני בעצמך */
.builder { display: flex; flex-direction: column; gap: 12px; }
.build-tabs button { font-size: .9rem; }
.build-expr { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 96px; direction: ltr; }
.pw { display: inline-flex; align-items: flex-start; }
.slot { border-radius: 12px; border: 2px dashed var(--line); background: var(--card); font-weight: 600; min-width: 44px; min-height: 44px; }
.slot.base { font-size: 1.6rem; min-width: 52px; min-height: 56px; margin-top: 18px; }
.slot.exp { font-size: 1.1rem; color: var(--expo); margin-inline-start: 2px; }
.slot.empty { color: #B9B4D8; }
.slot.on { border-style: solid; border-color: var(--primary); box-shadow: 0 0 0 3px #E2DAFF; }
.par { font-size: 2.4rem; line-height: 1; margin-top: 14px; color: var(--ink); }
.op { font-size: 1.8rem; font-weight: 600; }
.frac { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.frac .slot.base { margin-top: 10px; }
.frac .bar { width: 100%; height: 3px; background: var(--ink); border-radius: 2px; }

/* משפחות חזקות */
.families h3 { margin-bottom: 6px; }
.family { margin: 12px 0; }
.fam-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fam { background: var(--bg); border-radius: 10px; padding: 4px 10px; }

.help:empty { display: none; }
.helpbox { background: #FFFBEA; border: 2px solid #FFE58A; border-radius: 18px; padding: 12px 14px; margin: 6px 0 12px; display: flex; flex-direction: column; gap: 8px; }
.helpbox b { color: #7A5D00; }
.hstep { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.solution li { background: #fff; }

/* מקלדת מספרים */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; direction: ltr; }
.key {
  min-height: 52px; border-radius: 14px; background: var(--card); font-size: 1.45rem; font-weight: 600;
  box-shadow: 0 3px 0 var(--line); border: 2px solid var(--line);
}
.key:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.key.soft { background: var(--soft); }

/* חלונות */
.overlay { position: fixed; inset: 0; background: rgba(35, 33, 74, .35); display: grid; place-items: center; padding: 16px; z-index: 20; animation: fade .2s; }
.modal { background: var(--card); border-radius: 26px; padding: 20px; max-width: 380px; width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.modal .mascot { width: 90px; margin: 0 auto; }
.modal p { font-weight: 600; font-size: 1.1rem; }
.sheet-wrap { place-items: end center; padding: 0; }
.sheet { background: var(--card); width: 100%; max-width: 560px; border-radius: 26px 26px 0 0; padding: 8px 16px calc(env(safe-area-inset-bottom) + 16px); animation: up .25s ease-out; max-height: 85dvh; overflow: auto; }
.grab { display: block; width: 60px; height: 24px; margin: 0 auto 6px; position: relative; }
.grab::after { content: ''; position: absolute; inset: 9px 8px; border-radius: 9px; background: var(--line); }
.tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.tab { flex: 1; min-height: 44px; border-radius: 12px; background: var(--soft); font-weight: 600; }
.tab.on { background: var(--primary); color: #fff; }
.calc-screen { background: var(--bg); border-radius: 14px; padding: 12px 14px; font-size: 1.8rem; font-weight: 600; text-align: right; min-height: 64px; overflow-x: auto; white-space: nowrap; margin-bottom: 10px; }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ckey { min-height: 52px; border-radius: 14px; background: var(--bg); font-size: 1.35rem; font-weight: 600; }
.ckey.op { background: #EEE9FF; color: var(--primary); }
.ckey.eq { background: var(--primary); color: #fff; grid-row: span 2; }
.ckey.soft { background: var(--soft); }
.ckey.wide { grid-column: span 3; }
.times { display: grid; grid-template-columns: repeat(11, 1fr); gap: 2px; font-size: .82rem; text-align: center; }
.times span { padding: 6px 0; border-radius: 6px; background: var(--bg); font-variant-numeric: tabular-nums; }
.times .th { background: #EEE9FF; color: var(--primary); font-weight: 600; }
.times .hl { background: #FFF3C4; }

/* דמות */
.mascot img { width: 100%; height: auto; display: block; user-select: none; -webkit-user-drag: none; }
.mascot.m-happy.anim img { animation: hop .45s ease-out; transform-origin: 50% 100%; }
.mascot.m-party img { animation: hop .5s ease-out 3; transform-origin: 50% 100%; }
.mascot.m-cheer.anim img { animation: nod .4s ease-in-out; transform-origin: 50% 100%; }
.mascot.m-idle img { animation: breathe 3.2s ease-in-out infinite; transform-origin: 50% 100%; }

/* בית */
.home { background: radial-gradient(120% 60% at 50% 0%, #F1ECFF 0%, var(--bg) 60%); }
/* בבית הכותרת נגללת עם הדף. כשהייתה צמודה ושקופה, "חזקות" עלתה על הכרטיס בגלילה */
.home .top { position: static; background: transparent; backdrop-filter: none; }
.home-top h1 { font-size: 1.6rem; color: var(--primary); }
.home .icon { box-shadow: 0 4px 14px -6px rgba(90, 60, 200, .35); border-radius: 16px; }

/* שורת הפתיחה: טבעת, בועה, וחזקי שמציץ מעל הכרטיס */
.hero2 { position: relative; margin: 2px 0 6px; container-type: inline-size; }
.hero-row { display: flex; align-items: flex-end; justify-content: flex-end; gap: 6px; position: relative; z-index: 2; margin-top: -6px; }
/* רוחב חזקי יחסי לרוחב המסך, והחפיפה עם הכרטיס יחסית לגובה שלו: רק הכפות נחות על הקצה */
.peek { --pw: min(42cqw, 230px); flex: none; width: var(--pw); margin-bottom: calc(var(--pw) * -0.07); margin-inline-end: 4cqw; filter: drop-shadow(0 6px 10px rgba(90, 60, 200, .18)); pointer-events: none; user-select: none; }
.peek.hop { animation: hop .5s ease-out 3; transform-origin: 50% 100%; }
.say {
  position: relative; align-self: center; flex: 0 1 auto; max-width: 52%; margin-bottom: 18px; background: var(--card); border-radius: 20px; padding: 10px 12px;
  font-weight: 600; font-size: .92rem; line-height: 1.3; min-width: 0; box-shadow: 0 6px 18px -10px rgba(90, 60, 200, .35);
}
/* זנב הבועה פונה אל חזקי (שמאלה ולמטה) */
.say::after { content: ''; position: absolute; left: 14px; bottom: -9px; width: 20px; height: 20px; background: var(--card); border-radius: 0 0 0 4px; transform: skewX(30deg) rotate(-8deg); clip-path: polygon(0 0, 100% 0, 0 100%); }
.ring { position: relative; width: clamp(76px, 25cqw, 92px); height: clamp(76px, 25cqw, 92px); flex: none; align-self: center; margin-bottom: 14px; }
.ring svg { width: 100%; height: 100%; overflow: visible; }
.ring-bg { fill: none; stroke: #E9E4FA; stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--primary); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .6s; }
.ring-dot { fill: var(--primary); stroke: #fff; stroke-width: 3; }
.ring-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.ring-txt b { font-size: 1.55rem; }
.ring-txt span { font-size: .85rem; color: var(--ink-soft); }

/* הכרטיס הצהוב */
.cta-card {
  position: relative; z-index: 1; overflow: hidden; text-align: center;
  background:
    radial-gradient(60% 50% at 10% 100%, rgba(255, 190, 60, .45), transparent 70%),
    radial-gradient(50% 45% at 95% 95%, rgba(255, 175, 50, .4), transparent 70%),
    linear-gradient(180deg, #FFF0A8 0%, #FFE27A 100%);
  border: 1.5px solid #F7D45E; border-radius: 28px; padding: 30px 18px 14px;
  box-shadow: 0 10px 24px -14px rgba(200, 140, 0, .55);
}
.cta-card::before, .cta-card::after { content: '✦'; position: absolute; top: 92px; font-size: 1.3rem; } /* בגובה הכותרת, מתחת לשורת "היום" */
.cta-card::before { right: 22px; color: #FF8A3D; }
.cta-card::after { left: 22px; color: #fff; }
.cta-title { font-size: 2rem; margin: 0 0 4px; position: relative; display: inline-block; padding: 0 28px; }
/* קווי "פיצוץ" קטנים משני צדי הכותרת */
.cta-title::before, .cta-title::after { content: ''; position: absolute; top: 4px; width: 18px; height: 22px; border-top: 4px solid #F5A623; border-bottom: 4px solid #F5A623; border-radius: 3px; }
.cta-title::before { right: 0; transform: skewY(-35deg); border-bottom: 0; }
.cta-title::after { left: 0; transform: skewY(35deg); border-bottom: 0; }
.cta-sub { color: #4A4673; font-size: 1rem; margin: 0 0 14px; }
.cta-sub small { display: block; color: #7A7499; font-size: .85rem; }
.cta {
  width: 100%; min-height: 60px; border-radius: 999px; color: #fff; font-weight: 600; font-size: 1.2rem;
  background: linear-gradient(180deg, #8B6CFF, #6B4BF2); box-shadow: 0 5px 0 #4F31C9, 0 12px 20px -10px rgba(80, 50, 200, .7);
  display: flex; align-items: center; justify-content: center; position: relative; padding: 0 64px;
  transition: transform .12s, box-shadow .12s;
}
.cta:active { transform: translateY(3px); box-shadow: 0 2px 0 #4F31C9; }
.cta-arrow { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--primary); display: grid; place-items: center; }
.cta-arrow .chev { width: 22px; height: 22px; color: var(--primary); }
.cta-link { margin-top: 8px; min-height: 44px; padding: 0 16px; color: #4A4673; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* המסלול */
.section-title.path-title { color: var(--primary); font-size: 1.15rem; margin: 22px 4px 10px; }
.section-title { font-size: 1rem; color: var(--ink-soft); margin: 18px 0 10px; }
.path { display: flex; flex-direction: column; gap: 12px; }
.unit { background: var(--card); border-radius: 24px; padding: 8px; box-shadow: 0 6px 20px -14px rgba(90, 60, 200, .4); }
.unit-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 8px; min-height: 64px; text-align: right; border-radius: 18px; }
.unit-head:disabled { cursor: default; }
.u-text { flex: 1; display: flex; flex-direction: column; }
.u-text b { font-size: 1.12rem; }
.u-text small { color: var(--ink-soft); }
.u-emoji { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; background: #F1ECFF; flex: none; }
.unit.done .u-emoji { background: #FFF3C4; }
.unit.locked { opacity: .55; box-shadow: none; background: rgba(255, 255, 255, .5); }
.chev { width: 20px; height: 20px; flex: none; color: #8E89AE; display: inline-grid; }
.chev svg { width: 100%; height: 100%; }
.unit-head[aria-expanded="true"] > .chev { transform: rotate(-90deg); }
.chapters[hidden] { display: none; }
.chapters { display: flex; flex-direction: column; gap: 8px; padding: 2px 6px 8px; }
.chap, .review-row {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 6px 10px; border-radius: 16px;
  background: #F8F6FE; text-align: right; font-weight: 600;
}
.chap.next { background: #F1ECFF; box-shadow: inset 0 0 0 2px #CFC3FF; }
.chap.done .c-title { color: #138A5C; }
.c-title { flex: 1; }
.rec { display: inline-block; margin-inline-start: 8px; font-size: .75rem; font-weight: 600; color: #8A6A00; background: #FFF1C9; border-radius: 99px; padding: 1px 8px; vertical-align: middle; }
.c-done { color: var(--mint); font-weight: 600; width: 20px; text-align: center; }
.c-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; font-weight: 600; font-size: 1.05rem; font-family: var(--font); white-space: nowrap; }
.t-mint { background: #DDF8EC; color: #1BA672; }
.t-grape { background: #EEE9FF; color: #6B4BF2; }
.t-sun { background: #FFF1C9; color: #E0A100; }
.t-sky { background: #DCF2FC; color: #1C8FC0; }
.t-coral { background: #FFE3EB; color: #E8436F; }
.review-row { background: var(--card); margin-top: 14px; min-height: 64px; border-radius: 22px; padding: 10px 14px; box-shadow: 0 6px 20px -14px rgba(90, 60, 200, .4); color: var(--primary); }
.review-row .c-title { text-align: center; }
.ghost.quiet { color: var(--ink-soft); border-color: transparent; background: transparent; }
.center-col { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding-top: 12px; }
.center-col .mascot { width: 130px; }
.center-col h2 { font-size: 1.6rem; color: var(--primary); }
.center-col .learned { width: 100%; text-align: right; }

/* סיום פרק */
.big-title { font-size: 2rem; color: var(--primary); }
.done .mascot { width: 150px; }
.sticker { font-size: 4.5rem; line-height: 1; margin: 8px 0; filter: drop-shadow(0 6px 8px rgba(60,40,160,.2)); }
.today { font-weight: 600; background: var(--card); border-radius: 99px; padding: 6px 16px; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }

/* מה אני יודעת */
.week { display: flex; justify-content: space-between; background: var(--card); border-radius: 18px; padding: 12px 10px; }
.wday { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 36px; }
.wday .dot { width: 30px; height: 30px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; color: transparent; }
.wday.on .dot { background: var(--mint); }
.wday.future { opacity: .45; }
.wday.today small { font-weight: 600; color: var(--primary); }
.learned { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.learned li { background: var(--card); border-radius: 14px; padding: 12px 14px; display: flex; justify-content: space-between; font-weight: 600; }
.stars { color: #E8B400; letter-spacing: 2px; }
.stickers { display: flex; flex-wrap: wrap; gap: 8px; font-size: 2rem; }

/* הגדרות */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 8px; }
.seg { display: flex; background: var(--soft); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 44px; border-radius: 11px; font-weight: 600; color: var(--ink-soft); }
.seg button.on { background: var(--card); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.row2 { display: flex; gap: 10px; }

/* תנועה */
.pop { animation: pop .3s ease-out; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes hop { 0% { transform: none; } 35% { transform: translateY(-18px) scaleY(1.05); } 70% { transform: translateY(0) scaleY(.94); } 100% { transform: none; } }
@keyframes nod { 0%, 100% { transform: none; } 50% { transform: rotate(-5deg); } }
@keyframes breathe { 0%, 100% { transform: none; } 50% { transform: scaleY(1.025); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- עזרה בשיעורי בית ---------- */
.hw-card {
  position: relative; overflow: hidden; width: 100%; margin-top: 14px; min-height: 150px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px;
  text-align: right; color: #fff; border-radius: 26px; padding: 24px 16px 18px 45%;
  background: radial-gradient(70% 80% at 100% 0%, rgba(255, 255, 255, .14), transparent 60%), linear-gradient(135deg, #8B6CFF 0%, #6B4BF2 60%, #5B3EE0 100%);
  box-shadow: 0 12px 24px -14px rgba(80, 50, 200, .8);
}
.hw-card:active { transform: translateY(2px); }
/* חזקי בעננים: רק בחצי השמאלי, נוגע בתחתית ובקצה, לא מתחת לטקסט */
.hw-art { position: absolute; left: 0; bottom: -2px; width: 56%; max-width: none; pointer-events: none; z-index: 0;
  /* העננים נחתכו בצד ימין של האיור: מעלימים את החיתוך בהדרגה */
  -webkit-mask-image: linear-gradient(to right, #000 78%, transparent); mask-image: linear-gradient(to right, #000 78%, transparent); }
.hw-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; line-height: 1.3; text-shadow: 0 1px 6px rgba(60, 30, 160, .45); }
.hw-text b { font-size: 1.05rem; white-space: nowrap; }
.hw-text span { font-size: .84rem; opacity: .95; text-wrap: balance; }
.hw-go {
  position: relative; z-index: 1; margin-top: 10px; display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--primary); font-weight: 600; font-size: .95rem; border-radius: 99px; padding: 8px 10px 8px 16px;
  box-shadow: 0 4px 12px -4px rgba(40, 20, 120, .5);
}
.hw-go .chev { width: 18px; height: 18px; color: var(--primary); }
.hw-title { font-size: 1.1rem; color: var(--primary); }
.hw-display {
  min-height: 96px; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--card); border-radius: 22px; border: 2px dashed #CFC3FF; padding: 10px; margin: 6px 0 10px;
}
.caret { color: var(--primary); animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.hw-examples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.hw-ex { background: #F1ECFF; border-radius: 14px; padding: 6px 12px; min-height: 44px; }
.hw-keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; direction: ltr; }
.hk { min-height: 50px; border-radius: 14px; background: var(--card); font-size: 1.35rem; font-weight: 600; box-shadow: 0 3px 0 var(--line); border: 2px solid var(--line); }
.hk:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.hk.op { background: #EEE9FF; color: var(--primary); }
.hk.br { background: #F8F6FE; }
.hk.letter { font-style: italic; font-family: 'KaTeX_Math', serif; color: #3D3A6B; }
.hk.soft { background: var(--soft); }
.hk.pow { grid-column: span 3; background: var(--expo); color: #fff; border-color: var(--expo); box-shadow: 0 3px 0 #D93C6B; font-size: 1.05rem; }
.hk.pow b { font-size: 1.2rem; margin-inline-start: 4px; }
.hk.pow.out { background: #fff; color: var(--expo); }
.hw-practice { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
@media (max-height: 740px) { .hk { min-height: 44px; font-size: 1.2rem; } .hw-display { min-height: 76px; } }
.calc { font-size: .95rem; color: var(--ink-soft); }
/* החלק שהשתנה בצעד הזה */
.hl { background: #FFF1C9; border-radius: 6px; box-shadow: 0 0 0 3px #FFF1C9; }
/* התרגיל אחרי השלב, בסוף כל צעד, מופרד בקו דק מההסבר */
.solution li .note + .step-result, .solution li .calc + .step-result { border-top: 1px dashed #E6E1FA; padding-top: 6px; margin-top: 2px; width: 100%; text-align: center; }

/* שורת "היום" בראש הכרטיס הצהוב */
.today-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -6px 2px 12px; padding: 0 18px; }
.today-label { font-size: 1.2rem; font-weight: 600; color: #A23BE6; }
.tdots { display: flex; align-items: center; gap: 8px; }
.tdot { width: 26px; height: 26px; border-radius: 50%; background: #FFF6CF; box-shadow: inset 0 2px 3px rgba(200, 150, 0, .18); transition: background .3s, transform .3s; }
.tdot.on { background: radial-gradient(circle at 35% 30%, #E28BFF, #B04BEA 70%); box-shadow: 0 3px 8px -2px rgba(160, 60, 220, .6); }
.tplus { font-weight: 600; color: #A23BE6; font-size: .95rem; }
.cta-card .cta-title { font-size: 1.6rem; }
/* הכפתור לפרק הבא, בתוך הכרטיס הצהוב מתחת ל"היום" */
.next-btn {
  width: 100%; min-height: 60px; border-radius: 999px; color: #fff; display: flex; align-items: center; gap: 10px; padding: 8px 20px 8px 8px; text-align: right;
  background: linear-gradient(180deg, #8B6CFF, #6B4BF2); box-shadow: 0 5px 0 #4F31C9, 0 12px 20px -10px rgba(80, 50, 200, .7);
}
.next-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #4F31C9; }
.next-text { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.next-text b { font-size: 1.15rem; }
.next-text small { font-size: .85rem; opacity: .9; }
.next-btn .cta-arrow { position: static; transform: none; flex: none; }
/* בלי כותרת בכרטיס, הכוכבים הקישוטיים מיותרים */
.cta-card::before, .cta-card::after { display: none; }
.cta-card { padding: 18px 14px 14px; }
.cta-card .today-row { margin: 0 0 10px; padding: 0 6px; }
/* ארגז הכלים: כרטיס נפרד בסוף המסלול, בצהוב עדין */
.unit.toolbox { background: #FFF8DC; margin-top: 10px; box-shadow: 0 6px 20px -14px rgba(200, 150, 0, .5); }
.unit.toolbox .u-emoji { background: #FFEFB0; }
.unit.toolbox .chap { background: #FFFDF2; }
