/* תיקוני 15.09: הודעות בחלונית ממורכזת, ניהול נושאים בסרגל, חלונית זום */

.note-stage {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 18, 42, 0.55);
  backdrop-filter: blur(3px);
}

.note-card {
  position: relative;
  width: min(420px, 92vw);
  background: #fff;
  border-radius: 20px;
  padding: 26px 22px 20px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(4, 20, 50, 0.32);
}

.note-text {
  margin: 6px 0 16px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #12244a;
  font-weight: 600;
}

.note-x {
  position: absolute;
  inset-inline-start: 12px;
  top: 8px;
  border: 0;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #5a6d8c;
  cursor: pointer;
}

.note-ok {
  min-width: 128px;
}

.zoom-wait-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.tree-topic-head {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tree-topic-head > .tree-topic-btn {
  flex: 1 1 auto;
}

.tree-topic-tools {
  display: inline-flex;
  gap: 2px;
  flex: 0 0 auto;
}

.tree-topic-tools button {
  border: 1px solid #d7e1f2;
  background: #f6f9ff;
  border-radius: 8px;
  width: 26px;
  height: 26px;
  font-size: 0.82rem;
  line-height: 1;
  cursor: pointer;
  color: #123;
}

.tree-topic-tools button[disabled] {
  opacity: 0.35;
  cursor: default;
}

.tree-topic-tools .lm-del {
  border-color: #f2c8c8;
  background: #fff5f5;
}

.tree-topic-add {
  padding: 6px 8px 10px;
}

/* כפתור «דף הבית» בסרגל העליון */
.top-nav .site-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 15px;
  border: 2px solid #003a7d;
  border-radius: 999px;
  background: #fff;
  color: #003a7d;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: none;
}
.top-nav .site-home-btn .site-home-ico {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  display: block;
}
.top-nav .site-home-btn:hover,
.top-nav .site-home-btn:focus-visible {
  background: #003a7d;
  color: #fff;
  transform: translateY(-1px);
}
@media (max-width: 900px) {
  .top-nav .site-home-btn {
    padding: 6px 10px;
    min-height: 36px;
  }
  .top-nav .site-home-btn .site-home-label {
    display: none;
  }
}

/* תדריך: סמל המטרה במקום היהלום */
.site-tour-card::after {
  width: 30px; height: 30px; top: -15px;
  background: url("/favicon.png") center / contain no-repeat;
  transform: translateX(-50%);
  border-radius: 0; box-shadow: none;
}
.site-tour-card.is-above::after { top: auto; bottom: -15px; }

/* לוח שנתי בטלפון: תאים יציבים ללא טקסט חופף */
@media (max-width: 640px) {
  #yearCalStage.sched-stage {
    align-items: start;
    overflow-y: auto;
    padding: max(10px, env(safe-area-inset-top)) 8px max(10px, env(safe-area-inset-bottom));
  }
  #yearCalStage .year-cal-card {
    width: 100%;
    max-height: none;
    padding: 18px 8px 14px;
  }
  #yearCalStage .cal-grid {
    gap: 3px;
    padding: 5px;
    border-radius: 10px;
  }
  #yearCalStage .cal-weekdays {
    gap: 3px;
  }
  #yearCalStage .cal-cell {
    min-width: 0;
    min-height: 68px;
    padding: 4px 2px;
    gap: 2px;
    border-radius: 8px;
    overflow: hidden;
  }
  #yearCalStage .cal-cell.is-lesson {
    min-height: 84px;
  }
  #yearCalStage .cal-greg {
    font-size: 12px;
  }
  #yearCalStage .cal-heb,
  #yearCalStage .cal-hname {
    display: block;
    max-width: 100%;
    overflow: hidden;
    font-size: 8px;
    line-height: 1.15;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  #yearCalStage .cal-lesson-mark {
    gap: 0;
    margin-top: 1px;
  }
  #yearCalStage .cal-lesson-mark img {
    width: 18px;
    height: 18px;
  }
  #yearCalStage .cal-lesson-mark b {
    font-size: 8px;
    line-height: 1.15;
    white-space: nowrap;
  }
  #yearCalStage .cal-legend {
    display: grid;
    gap: 7px;
  }
}

/* חלונית נושאים: כל התוכן נגיש בגלילה גם במסך נמוך */
#yearTopicsStage.sched-stage {
  overflow-y: auto;
  overscroll-behavior: contain;
}
#yearTopicsStage .year-topics-card {
  max-height: min(88dvh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: auto;
  scrollbar-color: #003a7d #e7f4ff;
  -webkit-overflow-scrolling: touch;
}
#yearTopicsStage .year-topics-card::-webkit-scrollbar {
  width: 10px;
}
#yearTopicsStage .year-topics-card::-webkit-scrollbar-track {
  background: #e7f4ff;
  border-radius: 999px;
}
#yearTopicsStage .year-topics-card::-webkit-scrollbar-thumb {
  background: #003a7d;
  border: 2px solid #e7f4ff;
  border-radius: 999px;
}
@media (max-width: 640px) {
  #yearTopicsStage.sched-stage {
    align-items: start;
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }
  #yearTopicsStage .year-topics-card {
    width: 100%;
    max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 22px 16px 24px;
  }
}

/* אודות: ניגודיות בתיבות הכהות וכתב יד עברי בציטוטים */
.about-story .about-goal,
.about-story .about-goal * {
  color: #fff;
}
.about-story .about-say {
  font-family: "Gveret Levin", "Noto Sans Hebrew", sans-serif;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.45;
}

/* ברכת התלמיד: התמונה השקופה שהועלתה, ללא עיגול או רקע נוסף */
.kid-hello-top .kid-hello-mark {
  width: 42px;
  height: 35px;
}
.kid-hello-top .kid-hello-smile-img {
  width: 42px;
  height: 35px;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
}
@media (max-width: 620px) {
  .kid-hello-top .kid-hello-mark,
  .kid-hello-top .kid-hello-smile-img {
    width: 34px;
    height: 29px;
  }
}

/* תיקון טלפון: בטפסים, ההסברים הארוכים בתוך כותרת השדה יורדים לשורה משלהם
   כדי שהשורה הארוכה לא תיראה כאילה יוצאת מהתיבה. הכל מסודר וסימטרי. */
@media (max-width: 640px) {
  .pay-card {
    padding-inline: 20px;
  }
  .pay-card .field-note {
    display: block;
    margin-top: 2px;
    font-size: 0.82em;
    font-weight: 700;
    color: #355a7a;
  }
}

/* קישור מיוחד לא תקין: הודעה קבועה */
.offer-problem-bar{position:fixed;inset-inline:12px;top:76px;z-index:900;max-width:560px;margin-inline:auto;padding:14px 16px;border-radius:16px;background:#fff7e6;border:1px solid #f0b74a;color:#4a3200;box-shadow:0 10px 30px rgba(0,58,125,.18);text-align:center}
.offer-problem-bar p{margin:0 0 6px}
.offer-problem-bar[hidden]{display:none}
