/* ============================================================
   AcadMind - עיצוב האפליקציה
   מועתק ומותאם מ-style.css של "עפרי מורה פרטי" (הוראת נתי:
   נראות פתיחה = הנראות של אפליקציית עפרי).
   ============================================================ */

:root {
  color-scheme: light only;
  --primary: #4A90D9;
  --primary-dark: #2E6BB5;
  --primary-light: #7FB3E8;
  --warm: #FF8C42;
  --warm-light: #FFB380;
  --success: #52B788;
  --success-light: #95D5B2;
  --gold: #FFD700;
  --bg: #FFF9F0;
  --bg-card: #FFFFFF;
  --text: #2D3142;
  --text-soft: #6B7280;
  --border: #E5E7EB;
  --shadow-sm: 0 1px 3px rgba(45, 49, 66, 0.08);
  --shadow-md: 0 4px 12px rgba(45, 49, 66, 0.10);
  --shadow-lg: 0 12px 32px rgba(45, 49, 66, 0.14);
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  direction: rtl;
  font-family: 'Sora', 'Heebo', -apple-system, sans-serif;
  font-size: 18px;
  background: linear-gradient(180deg, #FFE8F3 0%, #FFF9F0 30%, #FDF4E6 100%) !important;
  background-attachment: fixed !important;
  color: var(--text) !important;
  -webkit-font-smoothing: antialiased;
}
body { background: transparent !important; color: var(--text) !important; min-height: 100vh; display: flex; flex-direction: column; }

/* הכיוון הבהיר/כהה נשלט אך ורק ע"י המתג (data-theme). אין כפיית prefers-color-scheme. */

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-pill);
  padding: 14px 28px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: white; box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-lg); }
.btn-ghost { background: transparent; color: var(--primary); border: 2px solid var(--primary-light); }
.btn-ghost:hover { background: var(--primary-light); color: white; }
.btn-warm { background: var(--warm); color: white; box-shadow: var(--shadow-md); }
.btn-warm:hover { background: #E67730; box-shadow: var(--shadow-lg); }
.btn-secondary { font-size: 0.9rem !important; padding: 10px 18px !important; opacity: 0.85; }

input[type="text"], input[type="password"], input[type="email"], input[type="tel"] {
  font-family: inherit;
  font-size: 1.1rem;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  width: 100%;
  transition: border 0.12s ease;
  text-align: right;
}
input:focus { outline: none; border-color: var(--primary); }

/* === מסך כניסה (דפוס עפרי) === */
.login-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
}
.login-card {
  background: var(--bg-card);
  padding: 40px 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 100%;
  animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.login-title { font-size: 1.8rem; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.login-subtitle { font-size: 1.05rem; color: var(--text-soft); margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form button { margin-top: 12px; }
.login-error { color: #DC2626; font-size: 0.95rem; margin-top: 8px; min-height: 1.4em; }
.login-join-link { margin-top: 16px; font-size: 0.92rem; color: var(--text-soft); }
.login-join-link a { color: var(--primary); font-weight: 700; }

.brand-logo { text-align: center; margin-bottom: 18px; }
.brand-name {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--primary-dark);
  background: linear-gradient(135deg, var(--primary), var(--warm));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.brand-tagline { font-size: 0.95rem; color: var(--text-soft); font-weight: 600; }

/* === עין סיסמה (דפוס עפרי) === */
.password-wrap { position: relative; width: 100%; }
.password-wrap input { width: 100%; padding-left: 48px; }
.password-eye {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: background 0.15s ease;
}
.password-eye:hover { background: var(--bg); }
.password-eye.on { color: var(--primary); }

/* === כותרת אפליקציה === */
.app-header {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  /* רווח בצד שמאל כדי שכפתור המתג הצף (פינה שמאלית-עליונה) לא יכסה את "התנתקות" */
  padding-inline-end: 60px;
}
.app-header .hello { font-weight: 800; color: var(--primary-dark); font-size: 1.1rem; }
.app-header .grade-pill {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
}

/* === רשימת מקצועות ונושאים === */
.section-title { font-size: 1.3rem; font-weight: 800; color: #E07A1F; margin: 18px 0 12px; }
html[data-theme="dark"] .section-title { color: #FFB380; }
.home-hello { font-size: 1.7rem; font-weight: 800; color: var(--primary-dark); text-align: center; margin: 8px 0 2px; }
.home-sub { color: var(--text-soft); text-align: center; margin-bottom: 18px; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.subject-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 22px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 3px solid transparent;
}
.subject-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.subject-card .subject-emoji { font-size: 2.6rem; margin-bottom: 8px; }
.subject-card .subject-name { font-size: 1.25rem; font-weight: 800; color: var(--primary-dark); }
.subject-card .subject-meta { color: var(--text-soft); font-size: 0.9rem; margin-top: 6px; }

/* כרטיס מקצוע צבעוני גדול - בקו של עפרי: ברק, ריחוף קפיצי, אייקון מרחף */
.subject-card-color {
  min-height: 200px;
  border-radius: 28px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  border: 2px solid rgba(255,255,255,0.35);
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: cardIn 0.4s ease backwards;
}
.subject-card-color::before {
  content: '';
  position: absolute;
  top: -20%; left: -20%;
  width: 60%; height: 60%;
  background: radial-gradient(circle, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
}
.subject-card-color:nth-child(1) { animation-delay: 0.05s; }
.subject-card-color:nth-child(2) { animation-delay: 0.1s; }
.subject-card-color:nth-child(3) { animation-delay: 0.15s; }
.subject-card-color:nth-child(4) { animation-delay: 0.2s; }
.subject-card-color:nth-child(5) { animation-delay: 0.25s; }
.subject-card-color:nth-child(6) { animation-delay: 0.3s; }
.subject-card-color .subject-emoji { font-size: 4.5rem; margin-bottom: 12px; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.22)); animation: emojiBob 2.8s ease-in-out infinite; }
.subject-card-color .subject-name { font-size: 1.5rem; font-weight: 800; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,0.25); letter-spacing: 0.5px; }
.subject-card-color .subject-sub { color: rgba(255,255,255,0.92); font-size: 0.92rem; margin-top: 6px; }
.subject-card-color .subject-start {
  margin-top: 14px; background: rgba(255,255,255,0.25); color: #fff;
  font-weight: 700; padding: 8px 20px; border-radius: 999px; font-size: 0.95rem;
  backdrop-filter: blur(2px);
}
.subject-card-color:hover { transform: translateY(-6px) scale(1.03) rotate(-1deg); box-shadow: 0 16px 32px rgba(0,0,0,0.26); }
.subject-card-color:hover .subject-emoji { animation: emojiBob 2.4s ease-in-out infinite, emojiWiggle 0.5s ease; }
@keyframes emojiBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(3deg); }
}
@keyframes emojiWiggle {
  0% { transform: scale(1) rotate(0); }
  25% { transform: scale(1.2) rotate(-12deg); }
  75% { transform: scale(1.2) rotate(12deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* כרטיסי נושא בסגנון עפרי: נושא N + למידה + תרגול */
.topic-head { text-align: center; }
.topic-grid-v2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.topic-card-v2 {
  border-radius: var(--radius-lg); padding: 22px 18px; color: #fff;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  border: 2px solid rgba(255,255,255,0.35);
  position: relative; overflow: hidden;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: cardIn 0.4s ease backwards;
}
.topic-card-v2::before {
  content: '';
  position: absolute;
  top: -20%; left: -20%;
  width: 60%; height: 60%;
  background: radial-gradient(circle, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
}
.topic-card-v2:nth-child(1) { animation-delay: 0.05s; }
.topic-card-v2:nth-child(2) { animation-delay: 0.1s; }
.topic-card-v2:nth-child(3) { animation-delay: 0.15s; }
.topic-card-v2:nth-child(4) { animation-delay: 0.2s; }
.topic-card-v2:nth-child(5) { animation-delay: 0.25s; }
.topic-card-v2:nth-child(6) { animation-delay: 0.3s; }
.topic-card-v2:hover { transform: translateY(-6px) scale(1.02) rotate(-1deg); box-shadow: 0 14px 30px rgba(0,0,0,0.26); }
.topic-card-v2 .tc-emoji { font-size: 3.6rem; margin-bottom: 10px; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.2)); animation: emojiBob 2.8s ease-in-out infinite; }
.topic-card-v2:hover .tc-emoji { animation: emojiBob 2.4s ease-in-out infinite, emojiWiggle 0.5s ease; }
.topic-card-v2 .tc-num { font-size: 0.85rem; color: rgba(255,255,255,0.8); }
.topic-card-v2 .tc-title { font-size: 1.2rem; font-weight: 800; color: #fff; margin: 2px 0 14px; min-height: 2.4em; display: flex; align-items: center; text-shadow: 0 2px 6px rgba(0,0,0,0.25); letter-spacing: 0.3px; }
.topic-card-v2 .tc-btn {
  width: 100%; border: none; border-radius: 999px; padding: 11px 16px; margin-top: 8px;
  font-weight: 700; font-size: 0.98rem; cursor: pointer; color: #fff; transition: transform 0.12s ease, filter 0.12s ease;
}
.topic-card-v2 .tc-btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.topic-card-v2 .tc-learn { background: linear-gradient(135deg,#34C77B,#1E9E5E); }
.topic-card-v2 .tc-practice { background: linear-gradient(135deg,#F6A93B,#E07E20); }

/* רשימת חלקי התרגול */
.practice-parts { display: flex; flex-direction: column; gap: 12px; }
.practice-part {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-card); border: 2px solid transparent; border-radius: var(--radius-md);
  padding: 16px 20px; cursor: pointer; font-weight: 700; color: var(--text);
  box-shadow: var(--shadow-md); transition: transform 0.12s ease, border-color 0.12s ease;
}
.practice-part:hover { transform: translateY(-2px); border-color: var(--primary-light); }
.practice-part .pp-meta { color: var(--text-soft); font-weight: 600; font-size: 0.92rem; }
.go-practice-btn { display: block; width: 100%; margin-top: 18px; }

/* כרטיסי שכבה עשירים */
.layer-group-title { font-size: 1.05rem; font-weight: 800; color: var(--text); margin: 20px 0 10px; }
.layer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.layer-card-v2 {
  border-radius: var(--radius-lg); padding: 24px 16px; color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.18);
  border: 2px solid rgba(255,255,255,0.35);
  position: relative; overflow: hidden;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: cardIn 0.4s ease backwards;
}
.layer-card-v2::before {
  content: '';
  position: absolute;
  top: -20%; left: -20%;
  width: 60%; height: 60%;
  background: radial-gradient(circle, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
}
.layer-card-v2:hover { transform: translateY(-6px) scale(1.03) rotate(-1deg); box-shadow: 0 16px 30px rgba(0,0,0,0.26); }
.layer-card-v2 .lc-emoji { font-size: 3.4rem; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.2)); animation: emojiBob 2.8s ease-in-out infinite; }
.layer-card-v2:hover .lc-emoji { animation: emojiBob 2.4s ease-in-out infinite, emojiWiggle 0.5s ease; }
/* מצב כהה: צל עמוק יותר ומסגרת עדינה יותר לריבועים הצבעוניים */
html[data-theme="dark"] .subject-card-color,
html[data-theme="dark"] .topic-card-v2,
html[data-theme="dark"] .layer-card-v2 {
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 10px 26px rgba(0,0,0,0.45);
}
.layer-card-v2 .lc-name { font-size: 1.2rem; font-weight: 800; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,0.25); letter-spacing: 0.3px; }
.layer-badge { font-size: 0.78rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.layer-badge.active { background: rgba(255,255,255,0.92); color: #1E7A4F; }
.layer-badge.soon { background: rgba(255,255,255,0.28); color: #fff; }

.topic-list { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.topic-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.topic-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.topic-card .topic-title { font-weight: 700; font-size: 1.05rem; }
.topic-card .topic-meta { color: var(--text-soft); font-size: 0.85rem; margin-top: 4px; }
.topic-card .topic-arrow { color: var(--primary); font-size: 1.4rem; flex-shrink: 0; }

.empty-state {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-soft);
}
.empty-state .emoji { font-size: 3.5rem; margin-bottom: 12px; }

/* === מסך נושא: שיעור ותרגול === */
.lesson-card, .exercise-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 26px;
  margin-bottom: 16px;
}
.lesson-card h3 { color: var(--primary-dark); margin-bottom: 10px; }
.lesson-step { margin-bottom: 20px; }
.lesson-step .step-title { font-weight: 800; font-size: 1.1rem; margin-bottom: 8px; color: var(--text); }
.lesson-step .step-explanation { line-height: 1.7; }
.worked-example {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-top: 12px;
  border-right: 4px solid var(--primary-light);
}
.worked-example .we-q { font-weight: 700; margin-bottom: 8px; }
.worked-example ol { padding-right: 20px; line-height: 1.8; }
.worked-example .we-highlight { margin-top: 8px; font-weight: 700; color: var(--primary-dark); }
/* נגן שלבי שיעור - מסך אחד לכל שלב */
.lesson-player .lesson-step { margin-bottom: 8px; }
.lesson-progress {
  height: 10px; border-radius: 999px; background: var(--bg);
  overflow: hidden; margin-bottom: 18px;
}
.lesson-progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  transition: width 0.4s ease;
}
.step-visual {
  display: flex; justify-content: center; margin: 14px 0;
  background: var(--bg); border-radius: var(--radius); padding: 14px;
  direction: ltr; /* עמוד RTL חותך SVG - הציור עצמו תמיד LTR */
}
.step-visual svg { max-width: 100%; height: auto; }
.step-check {
  margin-top: 16px; padding-top: 14px;
  border-top: 2px dashed var(--primary-light);
}
.step-check-q { font-weight: 700; margin-bottom: 10px; }
.step-reinforce { margin-top: 10px; }
/* שלב חיזוק מסתעף - הסבר מזווית אחרת אחרי טעות שנייה */
.step-remedial {
  margin-top: 12px;
  background: linear-gradient(135deg, #FFF9E6, #FFF3D6);
  border-radius: var(--radius);
  border-right: 4px solid #F59E0B;
  padding: 14px 18px;
}
.step-remedial .step-remedial-title { font-weight: 800; margin-bottom: 8px; color: #B45309; }
html[data-theme="dark"] .step-remedial, body.night .step-remedial {
  background: rgba(245, 158, 11, 0.12);
}
.memory-tip {
  background: linear-gradient(135deg, #FFF3D6, #FFE8B3);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 16px;
  font-weight: 600;
}

.choices { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.choice {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: right;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.choice:hover { border-color: var(--primary-light); }
.choice.selected { border-color: var(--primary); background: #EAF3FC; }
.choice.correct { border-color: var(--success); background: #E8F7EF; }
.choice.incorrect { border-color: #DC2626; background: #FDECEC; }
.choice:focus-visible {
  outline: 3px solid #4A90D9;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(74, 144, 217, 0.2);
}

.exercise-feedback { margin: 12px 0; font-weight: 700; min-height: 1.5em; }
.exercise-feedback.ok, .exercise-feedback.bad {
  padding: 11px 15px; border-radius: 14px; display: block;
  animation: fbPop .25s ease;
}
.exercise-feedback.ok { color: #1E7A4F; background: rgba(82,183,136,.18); }
.exercise-feedback.bad { color: #C0392B; background: rgba(224,112,112,.15); }
@keyframes fbPop { from { transform: scale(.96); opacity: .4; } to { transform: scale(1); opacity: 1; } }
html[data-theme="dark"] .exercise-feedback.ok { background: rgba(82,183,136,.22); color: #7EDCA8; }
html[data-theme="dark"] .exercise-feedback.bad { background: rgba(224,112,112,.20); color: #F0A0A0; }
.hint-box {
  background: #FFF8E6;
  border-radius: var(--radius);
  border-right: 4px solid var(--gold);
  padding: 12px 16px;
  margin: 10px 0;
  line-height: 1.6;
}
.exercise-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.progress-line { color: var(--text-soft); font-size: 0.9rem; margin-bottom: 10px; }

.back-link {
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  padding: 6px 0;
  font-size: 0.95rem;
  margin-bottom: 10px;
  text-align: right;
}
.back-link:hover { color: var(--primary-dark); }

.note-soft { color: var(--text-soft); font-size: 0.88rem; margin-top: 8px; }

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.9) translateY(14px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  /* חגיגות מוחרגות (דפוס עפרי): גם ילד עם reduced-motion רואה שהתשובה הנכונה נקלטה. */
  *:not(.confetti-piece):not(.celebration-card):not(.celebration-emoji):not(.celebration-text),
  *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   חגיגות (קונפטי, ניצוצות, כרטיס חגיגה) - דפוס עפרי
   ============================================================ */
.confetti-container { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 9999; }
.confetti-piece { position: absolute; width: 12px; height: 12px; top: -20px; animation: confettiFall linear forwards; }
@keyframes confettiFall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.sparkle { position: absolute; font-size: 1.5rem; animation: sparklePop 0.8s ease forwards; pointer-events: none; }
@keyframes sparklePop {
  0% { transform: scale(0) rotate(0deg); opacity: 0; }
  50% { transform: scale(1.2) rotate(180deg); opacity: 1; }
  100% { transform: scale(0) rotate(360deg); opacity: 0; }
}
.celebration-overlay {
  position: fixed; inset: 0; background: rgba(74, 144, 217, 0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000; animation: fadeIn 0.3s ease;
}
.celebration-card {
  background: var(--bg-card); padding: 40px; border-radius: var(--radius-lg);
  text-align: center; max-width: 420px; animation: popIn 0.5s ease;
}
.celebration-emoji { font-size: 5rem; animation: bounceSoft 1s ease infinite; margin-bottom: 12px; }
.celebration-title { font-size: 2rem; font-weight: 800; color: var(--primary-dark); margin-bottom: 12px; }
.celebration-text { font-size: 1.1rem; line-height: 1.6; color: var(--text); margin-bottom: 24px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { transform: scale(0.3); opacity: 0; } 50% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes bounceSoft { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* הדמות בבית + אנימציית בחירה (עומק חוויה בסגנון עפרי) */
.home-mascot { text-align: center; margin-top: 6px; }
.home-mascot img {
  width: 110px; height: 110px; border-radius: 50%;
  border: 4px solid #fff; box-shadow: var(--shadow-lg);
  animation: floatSoft 4s ease-in-out infinite; background: #fff;
}
@keyframes floatSoft { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.choice { transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.choice.selected { transform: translateY(-3px) scale(1.02); box-shadow: 0 6px 20px rgba(74, 144, 217, 0.25); }

/* ============================================================
   מצב לילה - נדלק ע"י המתג (data-theme="dark" על <html>).
   גובר על @media prefers-color-scheme בזכות ספציפיות גבוהה יותר.
   ============================================================ */
html[data-theme="dark"] {
  color-scheme: dark;
  --primary: #6BA6E8;
  --primary-dark: #8FC0F2;
  --primary-light: #3A5170;
  --warm: #FF9F5C;
  --warm-light: #C9824A;
  --success: #5DC79A;
  --success-light: #2E5E4A;
  --gold: #FFD86B;
  --bg: #15171F;
  --bg-card: #20232E;
  --text: #E8EAF2;
  --text-soft: #9CA3B4;
  --border: #333748;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.40);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
  background: linear-gradient(180deg, #1A1D28 0%, #15171F 45%, #101218 100%) !important;
  color: var(--text) !important;
}
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="tel"] {
  background: #1A1D28;
  color: var(--text);
  border-color: var(--border);
}
html[data-theme="dark"] .choice.selected { border-color: var(--primary); background: rgba(107, 166, 232, 0.18); }
html[data-theme="dark"] .choice.correct { border-color: var(--success); background: rgba(93, 199, 154, 0.16); }
html[data-theme="dark"] .choice.incorrect { border-color: #F87171; background: rgba(248, 113, 113, 0.16); }
html[data-theme="dark"] .hint-box { background: rgba(255, 216, 107, 0.10); border-right-color: var(--gold); }
html[data-theme="dark"] .memory-tip { background: linear-gradient(135deg, #3A3320, #2E2A18); color: var(--text); }
html[data-theme="dark"] .password-eye:hover { background: rgba(255, 255, 255, 0.06); }

/* מובייל 375 + 768 */
@media (max-width: 768px) {
  #app { padding: 12px; }
  .subject-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
@media (max-width: 480px) {
  html { font-size: 16px; }
  .login-card, .lesson-card, .exercise-card { padding: 20px; }
  .app-header { padding: 12px 14px; padding-inline-end: 54px; }
  .subject-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   בוט מורה צף (סגנון עפרי)
   ============================================================ */
.bot-fab {
  position: fixed; inset-inline-start: 18px; inset-block-end: 18px; z-index: 900;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-family: inherit; font-weight: 700; font-size: 1rem;
  box-shadow: var(--shadow-lg);
  transition: transform .15s ease, box-shadow .15s ease;
}
.bot-fab:hover { transform: translateY(-2px) scale(1.03); }
.bot-fab .bf-emoji { font-size: 1.3rem; }

.bot-panel {
  position: fixed; inset-inline-start: 18px; inset-block-end: 84px; z-index: 901;
  width: min(370px, calc(100vw - 36px)); height: min(540px, calc(100vh - 130px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.bot-panel[hidden] { display: none; }
.bot-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}
.bot-head-t { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.bot-close {
  background: rgba(255,255,255,.2); border: none; color: #fff; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%; font-size: 1rem;
}
.bot-ctx {
  padding: 8px 14px; font-size: .82rem; color: var(--text-soft);
  background: var(--bg); border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bot-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bot-msg {
  max-width: 82%; padding: 10px 14px; border-radius: 16px;
  font-size: .95rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.bot-msg.bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-bottom-right-radius: 4px; }
.bot-msg.me { align-self: flex-end; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-bottom-left-radius: 4px; }
.bot-msg.typing { opacity: .65; font-style: italic; }
.bot-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: var(--bg-card); }
.bot-form input {
  flex: 1; padding: 11px 14px; border: 1px solid var(--border); border-radius: 999px;
  font-family: inherit; font-size: .95rem; background: var(--bg); color: var(--text);
}
.bot-send {
  border: none; cursor: pointer; width: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--warm), var(--warm-light));
  color: #fff; font-size: 1.1rem;
}
.bot-send:disabled, .bot-form input:disabled { opacity: .5; cursor: default; }

/* סטטוס התקדמות פר-נושא (על הכרטיס הצבעוני) */
.tc-status {
  display: inline-block; margin: 4px 0 2px; padding: 3px 12px;
  font-size: .82rem; font-weight: 700; border-radius: 999px;
  background: rgba(255, 255, 255, .22); color: #fff;
}
.tc-status.done { background: #fff; color: #2E9B5B; }
.tc-status.prog { background: rgba(255, 255, 255, .92); color: #2E6BB5; }

/* אווטאר בוטי (הדמות מהלוגו) בכפתור הצף ובכותרת החלון */
.bot-fab .bf-avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  background: #fff; border: 2px solid rgba(255,255,255,.7);
}
.bot-head .bh-avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  background: #fff; border: 2px solid rgba(255,255,255,.6); vertical-align: middle;
}

/* שאלה פתוחה: אזור כתיבה + הערכה עצמית */
textarea {
  font-family: inherit; font-size: 1.05rem; padding: 14px 18px;
  border: 2px solid var(--border); border-radius: var(--radius);
  background: white; color: var(--text); width: 100%; resize: vertical;
  text-align: right; transition: border 0.12s ease;
}
textarea:focus { outline: none; border-color: var(--primary); }
html[data-theme="dark"] textarea { background: #1A1D28; color: var(--text); border-color: var(--border); }
.self-check {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; font-weight: 700;
}

/* ============================================================
   דשבורד הורה
   ============================================================ */
.parent-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.parent-tab {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card); color: var(--text); font-weight: 700;
  border: 2px solid var(--border); border-radius: 999px; padding: 8px 18px 8px 22px;
  box-shadow: var(--shadow-sm); font-size: .95rem;
}
.parent-tab.on { border-color: var(--primary); background: var(--primary); color: #fff; }
.parent-tab .pt-avatar {
  width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.parent-tab.settings-tab { margin-inline-start: auto; }
.parent-save-msg {
  background: #E8F7EF; color: #1E7A4F; font-weight: 700; font-size: .9rem;
  border-radius: var(--radius); padding: 10px 16px; margin-bottom: 12px;
}
html[data-theme="dark"] .parent-save-msg { background: rgba(93,199,154,.15); color: var(--success); }

.parent-hero {
  display: flex; align-items: center; gap: 20px;
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 20px 24px; margin-bottom: 16px; flex-wrap: wrap;
}
.parent-hero .ph-headline { font-size: 1.3rem; font-weight: 800; color: var(--primary-dark); line-height: 1.4; }
.parent-hero .ph-sub { color: var(--text-soft); margin-top: 6px; font-size: .95rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ready-ring { flex-shrink: 0; }
.trend-chip {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: .82rem; font-weight: 700; background: var(--bg); border: 1px solid var(--border);
}
.trend-chip.up { color: #1E7A4F; border-color: #52B788; }
.trend-chip.down { color: #C0392B; border-color: #E07070; }

.parent-section {
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 18px 22px; margin-bottom: 14px;
  border: 2px solid transparent;
}
.parent-section.attention { border-color: #F6A93B; }

/* דשבורד הורה - רחב יותר ופריסת 2 עמודות לפרמטרים (פחות גלילה, ניצול רוחב) */
body:has(.parent-grid) #app { max-width: 1240px; }
.parent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.parent-grid .parent-section { margin-bottom: 0; }
@media (max-width: 820px) { .parent-grid { grid-template-columns: 1fr; } }

/* חץ צף - חזרה למעלה */
.scroll-top-btn {
  position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 60;
  width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 1.4rem; line-height: 1;
  box-shadow: 0 6px 18px rgba(0,0,0,0.28); opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s, transform .2s;
}
.scroll-top-btn.show { opacity: 1; visibility: visible; }
.scroll-top-btn:hover { transform: translateY(-2px); background: var(--primary-dark); }

/* גיל = נראות: מצב "צעיר" (גן/כיתה א') - גדול, עגול ושובב יותר */
html[data-agegroup="young"] .section-title { font-size: 1.55rem; }
html[data-agegroup="young"] .welcome-hero .wh-hi { font-size: 1.6rem; }
html[data-agegroup="young"] .welcome-hero .wh-sub { font-size: 1.08rem; }
html[data-agegroup="young"] .welcome-hero .wh-mascot img { width: 96px; height: 96px; }
html[data-agegroup="young"] .layer-card-v2,
html[data-agegroup="young"] .subject-card { border-radius: 26px; }
html[data-agegroup="young"] .mission-card .mission-q { font-size: 1.32rem; }
html[data-agegroup="young"] .mission-choice { font-size: 1.12rem; padding: 16px 18px; }
html[data-agegroup="young"] .btn-primary { font-size: 1.12rem; padding: 14px 24px; }
html[data-agegroup="young"] .inbox-item .ii-text { font-size: 1.02rem; }

/* בוטי במסך הכניסה - דמות המותג */
.login-mascot { text-align: center; margin-bottom: 6px; }
.login-mascot img {
  width: 116px; height: 116px; border-radius: 50%; object-fit: cover;
  border: 4px solid #fff; box-shadow: 0 8px 24px rgba(224,122,31,.28); background: #fff;
}
.login-subtitle strong { color: var(--primary-dark); }

/* הירו-פתיחה חם בסגנון עפרי */
.welcome-hero {
  display: flex; align-items: center; gap: 16px; margin-bottom: 16px;
  background: linear-gradient(135deg, #FFE0EC 0%, #FFF0F8 55%, #FFF9F0 100%);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 18px 20px;
  border: 1px solid rgba(255,140,66,.15);
}
.welcome-hero .wh-mascot img {
  width: 82px; height: 82px; border-radius: 50%; object-fit: cover;
  border: 3px solid #fff; box-shadow: 0 4px 14px rgba(224,122,31,.28); background: #fff; flex-shrink: 0;
}
.welcome-hero .wh-hi { font-size: 1.35rem; font-weight: 800; color: #E07A1F; line-height: 1.3; }
.welcome-hero .wh-sub { color: var(--text-soft); font-size: .95rem; margin-top: 4px; line-height: 1.45; }
.welcome-hero .wh-sub strong { color: var(--primary-dark); }
html[data-theme="dark"] .welcome-hero { background: linear-gradient(135deg, #2A2233 0%, #241F2B 60%, #1E1B24 100%); border-color: rgba(255,140,66,.2); }
html[data-theme="dark"] .welcome-hero .wh-hi { color: #FFB380; }
@media (max-width: 480px) { .welcome-hero { flex-direction: row; padding: 14px 16px; } .welcome-hero .wh-hi { font-size: 1.15rem; } }

/* תיבת הודעות הילד/ה */
.inbox-card { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 14px 16px; margin-bottom: 14px; border: 2px solid var(--primary-light); }
.inbox-card .ic-head { font-weight: 800; color: var(--primary-dark); margin-bottom: 8px; }
.inbox-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: right; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; cursor: pointer; font-family: inherit; }
.inbox-item.unread { border-color: var(--primary); background: var(--primary-light); }
.inbox-item .ii-icon { font-size: 1.5rem; flex-shrink: 0; }
.inbox-item .ii-text { flex: 1; font-size: .92rem; line-height: 1.4; color: var(--text); }
.inbox-item .ii-badge { background: #E63946; color: #fff; font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; flex-shrink: 0; }

/* נגן מטלה */
.mission-progress { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.mission-progress-fill { height: 100%; background: linear-gradient(90deg, #52B788, #4A90D9); transition: width .3s; }
.mission-qcount { text-align: center; color: var(--text-soft); font-size: .85rem; margin-bottom: 10px; }
.mission-qcount .mission-diff { color: #E07A1F; font-weight: 700; }
.mission-card { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 20px; }
.mission-card .mission-q { font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: 14px; line-height: 1.5; }
.mission-visual { margin: 10px 0; text-align: center; }
.mission-visual svg { max-width: 100%; height: auto; }
.mission-choices { display: flex; flex-direction: column; gap: 8px; }
.mission-choice { text-align: right; padding: 13px 16px; border-radius: 12px; border: 2px solid var(--border); background: var(--bg); color: var(--text); font-family: inherit; font-size: 1rem; cursor: pointer; transition: border-color .15s, background .15s; }
.mission-choice:hover:not(:disabled) { border-color: var(--primary); }
.mission-choice.selected { border-color: var(--primary); background: var(--primary-light); }
.mission-choice.correct { border-color: #52B788; background: rgba(82,183,136,.18); }
.mission-choice.wrong { border-color: #E07070; background: rgba(224,112,112,.15); }
.mission-fill { width: 100%; box-sizing: border-box; padding: 13px 16px; border-radius: 12px; border: 2px solid var(--border); background: var(--bg); color: var(--text); font-size: 1.05rem; font-family: inherit; }
.mission-hints { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.mission-hint { background: var(--primary-light); border-radius: 10px; padding: 8px 12px; font-size: .9rem; color: var(--text); }
.mission-feedback { margin-top: 12px; padding: 11px 14px; border-radius: 12px; font-weight: 700; }
.mission-feedback.ok { background: rgba(82,183,136,.18); color: #1E7A4F; }
.mission-feedback.no { background: rgba(224,112,112,.15); color: #C0392B; }
.mission-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.mission-result { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 26px 22px; text-align: center; }
.mission-result .mr-score { font-size: 3rem; font-weight: 800; color: var(--primary-dark); }
.mission-result .mr-score span { font-size: 1.6rem; color: var(--text-soft); }
.mission-result .mr-sub { color: var(--text-soft); margin-bottom: 16px; }
.mission-result .mr-block { text-align: right; background: var(--bg); border-radius: 12px; padding: 12px 16px; margin: 10px 0; }
.mission-result .mr-block h3 { margin: 0 0 6px; font-size: 1rem; color: var(--primary-dark); }
.mission-result .mr-block ul { margin: 0; padding-inline-start: 20px; }
.mission-result .mr-note { color: var(--text-soft); font-size: .88rem; margin: 14px 0; }

/* בניית מטלה לקראת מבחן */
.mission-builder { border-color: var(--primary-light); }
.mission-builder textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 68px;
  font-family: inherit; font-size: 1rem; padding: 11px 13px; margin-top: 4px;
  border: 2px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text);
}
.mission-builder textarea:focus { outline: none; border-color: var(--primary); }
.mb-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.mb-file-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 700; font-size: .88rem;
  color: var(--primary); border: 1.5px solid var(--primary-light); border-radius: 999px; padding: 6px 14px;
}
.mb-file-btn:hover { background: var(--primary-light); color: #fff; }
.mb-file-name { font-size: .82rem; color: var(--text-soft); }
.mb-meta select { padding: 7px 12px; border-radius: var(--radius); border: 2px solid var(--border); background: var(--bg); color: var(--text); font-family: inherit; }
.mb-count { margin-inline-start: auto; font-size: .8rem; color: var(--text-soft); }
.mb-topics { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.mb-topic { display: flex; align-items: center; gap: 8px; font-size: .92rem; cursor: pointer; padding: 6px 8px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
.mb-topic input { width: auto; flex-shrink: 0; }
.mb-topic-subj { color: var(--text-soft); font-size: .82rem; }
@media (max-width: 480px) { .mb-count { margin-inline-start: 0; } }
.parent-section .ps-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; font-weight: 800; font-size: 1.05rem; color: var(--text); margin-bottom: 12px;
}
.inv-selector { display: flex; gap: 4px; flex-wrap: wrap; }
.inv-pill {
  font-size: .74rem !important; font-weight: 700; padding: 4px 10px !important;
  border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text-soft);
}
.inv-pill.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.inv-peek { background: none; border: none; color: var(--primary); font-weight: 700; padding: 0 4px; font-size: .9rem; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.kpi-card {
  background: var(--bg); border-radius: var(--radius); padding: 12px 10px;
  text-align: center; border: 1px solid var(--border);
}
.kpi-card .kpi-emoji { font-size: 1.4rem; }
.kpi-card .kpi-value { font-size: 1.3rem; font-weight: 800; color: var(--primary-dark); margin: 2px 0; }
.kpi-card .kpi-label { font-size: .78rem; color: var(--text-soft); font-weight: 600; }

.section-note {
  margin-top: 10px; padding: 9px 14px; border-radius: var(--radius);
  font-weight: 700; font-size: .92rem; background: var(--bg); color: var(--text-soft);
}
.section-note.ok { background: #E8F7EF; color: #1E7A4F; }
.section-note.low { background: #FFF8E6; color: #9A7B1E; }
.section-note.mid { background: #FFF3D6; color: #B06A10; }
.section-note.high { background: #FDECEC; color: #C0392B; }
.section-note.crit { background: #C0392B; color: #fff; }
html[data-theme="dark"] .section-note.ok { background: rgba(93,199,154,.14); color: var(--success); }
html[data-theme="dark"] .section-note.low, html[data-theme="dark"] .section-note.mid { background: rgba(255,216,107,.12); color: var(--gold); }
html[data-theme="dark"] .section-note.high { background: rgba(248,113,113,.14); color: #F87171; }

.subj-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.subj-bar-row .sb-name { width: 110px; flex-shrink: 0; font-weight: 700; font-size: .9rem; }
.subj-bar-row .sb-track { flex: 1; height: 14px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; }
.subj-bar-row .sb-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #52B788, #4A90D9); transition: width .4s ease; }
.subj-bar-row .sb-pct { width: 44px; text-align: left; font-weight: 800; font-size: .88rem; color: var(--primary-dark); }

.gap-item {
  background: var(--bg); border-radius: var(--radius); padding: 12px 16px;
  margin-bottom: 8px; border-right: 4px solid #F6A93B;
}
.gap-item.deep { border-right-color: #C0392B; }
.gap-item .gap-title { font-weight: 800; }
.gap-item .gap-subj { color: var(--text-soft); font-weight: 600; font-size: .88rem; }
.gap-item .gap-meta { color: var(--text-soft); font-size: .86rem; margin-top: 4px; }

.alert-row {
  background: var(--bg); border-radius: var(--radius); padding: 10px 14px;
  margin-bottom: 8px; font-size: .92rem; line-height: 1.5;
}
.alert-row.high, .alert-row.crit { border-right: 4px solid #C0392B; }
.alert-row .alert-time { color: var(--text-soft); font-size: .8rem; margin-inline-start: 8px; }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0; }
.set-label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 6px; color: var(--text-soft); }
.channel-row { display: flex; gap: 18px; flex-wrap: wrap; margin: 12px 0 16px; }
.channel-toggle { display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.channel-toggle.disabled { opacity: .55; cursor: default; }
.channel-toggle input { width: 18px; height: 18px; accent-color: var(--primary); }
.gender-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border); }
.gender-row:last-child { border-bottom: none; }
.gender-row .gr-name { font-weight: 800; }
.gender-row .gr-pills { display: flex; gap: 6px; }

/* ============================================================
   פלטת צבעים לפי מגדר הילד (בת/בן) - חוויית הילד בלבד.
   ניטרלי = ברירת המחדל הקיימת. לא משנה תוכן, רק צבעים.
   ============================================================ */
html[data-gender="girl"]:not([data-theme="dark"]) {
  --primary: #C05AA8;
  --primary-dark: #9B3D87;
  --primary-light: #E8A5D6;
  --warm: #B07AE0;
  --warm-light: #D0A5F0;
  background: linear-gradient(180deg, #FFE0F0 0%, #FFF0F8 35%, #F7E8FF 100%) !important;
}
html[data-gender="boy"]:not([data-theme="dark"]) {
  --primary: #2E9BC0;
  --primary-dark: #1E7A9B;
  --primary-light: #7FD0E8;
  --warm: #2EB89B;
  --warm-light: #6ED8C0;
  background: linear-gradient(180deg, #DEF3FF 0%, #EDFAFF 35%, #E0FAF4 100%) !important;
}
html[data-gender="girl"][data-theme="dark"] { --primary: #E88AC8; --primary-dark: #F2A5D8; }
html[data-gender="boy"][data-theme="dark"] { --primary: #6BC8E8; --primary-dark: #8FD8F2; }

/* ============================================================
   חדרי לימוד - רשימה, יצירה, וחדר חי עם צ'אט
   ============================================================ */
.rooms-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.room-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card, white); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 16px; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.room-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.room-card.live { border-color: #52B788; box-shadow: 0 0 0 2px rgba(82,183,136,0.25); }
.room-title { font-weight: 800; font-size: 1.05rem; }
.room-meta { color: var(--text-soft); font-size: 0.85rem; margin-top: 3px; }
.room-form { display: flex; flex-direction: column; gap: 10px; }
.room-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.room-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px;
  font-family: inherit; font-size: 0.95rem; background: var(--card, white); color: var(--text, #1F2430);
}
.room-head-info { margin-bottom: 12px; }
.room-members { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.room-member {
  background: var(--card, white); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 10px; font-size: 0.82rem; font-weight: 700;
}
.room-member.host { border-color: #E0A85B; }
.room-member.bot { border-color: #896EC0; }
.room-chat-wrap { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; background: var(--card, white); }
.room-chat { height: 46vh; min-height: 260px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.room-msg { max-width: 82%; border-radius: 14px; padding: 9px 13px; font-size: 0.95rem; line-height: 1.55; }
.room-msg.child { align-self: flex-start; background: rgba(74,144,217,0.12); }
.room-msg.bot { align-self: flex-end; background: rgba(137,110,192,0.14); border: 1px solid rgba(137,110,192,0.3); }
.room-msg.system { align-self: center; background: none; color: var(--text-soft); font-size: 0.82rem; padding: 2px 8px; }
.room-msg.system.good { color: #2E9B5B; font-weight: 700; }
.rm-sender { font-size: 0.75rem; font-weight: 800; color: var(--text-soft); margin-bottom: 2px; }
.rm-time { font-size: 0.68rem; color: var(--text-soft); margin-top: 4px; text-align: left; }
.room-choices { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.room-choice {
  text-align: right; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card, white); color: var(--text, #1F2430); font-family: inherit; font-size: 0.92rem; cursor: pointer;
}
.room-choice:hover:not(:disabled) { border-color: #896EC0; }
.room-choice:disabled { opacity: 0.55; cursor: default; }
.room-compose { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.room-compose input {
  flex: 1; min-width: 160px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 12px;
  font-family: inherit; font-size: 0.95rem; background: var(--card, white); color: var(--text, #1F2430);
}
@media (max-width: 480px) {
  .room-msg { max-width: 92%; }
  .room-chat { height: 52vh; }
}

/* ===== המשימה של היום + משימות מבחן ===== */
.mission-card {
  background: linear-gradient(135deg, rgba(137,110,192,0.14), rgba(74,144,217,0.10));
  border: 1.5px solid rgba(137,110,192,0.35); border-radius: 18px;
  padding: 16px 18px; margin-bottom: 18px;
}
.mission-card.exam { border-color: rgba(224,168,91,0.6); }
.mc-head { font-size: 1.05rem; margin-bottom: 6px; }
.mc-reason { color: var(--text-soft); font-size: 0.92rem; margin-bottom: 10px; }
.mc-go { padding: 9px 22px; }
.mission-chips, .trial-subjects { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mission-chip {
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px;
  background: var(--card, white); color: var(--text, #1F2430);
  font-family: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer;
}
.mission-chip:hover { border-color: #896EC0; transform: translateY(-1px); }

/* ===== הקראה ודיבור לגיל הרך ===== */
.voice-read {
  border: 1px solid var(--border); background: var(--card, white); border-radius: 50%;
  width: 34px; height: 34px; cursor: pointer; font-size: 1rem; vertical-align: middle;
}
.voice-read:hover { border-color: #896EC0; }
.bot-mic {
  border: 1px solid var(--border); background: var(--card, white); border-radius: 50%;
  min-width: 38px; height: 38px; cursor: pointer; font-size: 1.05rem;
}

/* ===== שיעור ניסיון - פס אורח ===== */
#guest-bar {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(135deg, #B19CD9, #9381E8); color: white;
  padding: 10px 14px; font-weight: 700; box-shadow: 0 -4px 14px rgba(0,0,0,0.15);
}
#guest-bar a { color: white; text-decoration: underline; }
#guest-bar button {
  border: 1px solid rgba(255,255,255,0.5); background: rgba(255,255,255,0.15); color: white;
  border-radius: 10px; padding: 5px 12px; font-family: inherit; font-weight: 700; cursor: pointer;
}
body:has(#guest-bar) #app { padding-bottom: 64px; }

/* ===== "מחר יש מבחן" בדשבורד ההורה ===== */
.exam-prep-row { display: flex; gap: 8px; flex-wrap: wrap; }
.exam-prep-row input {
  flex: 1; min-width: 200px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 12px; font-family: inherit; font-size: 0.95rem;
  background: var(--card, white); color: var(--text, #1F2430);
}
