/* نقشهٔ مسیر (tutor-atlas.js) — جدا از tutor-quest.css تا هر صفحه‌ای که نقشه دارد بی بقیهٔ ظاهرِ معلم بارش کند:
 * معلمِ خصوصی (نقشهٔ کتاب) و دستیاری که «situation_map» دارد (نقشهٔ موقعیت‌ها، includes/assistant_situation_map.php).
 * متنِ قاعده‌ها کلمه‌به‌کلمه همان بخشِ W4 ِ tutor-quest.css است. */
/* W4 — learning atlas (کجای درسم): vertical only, no h-scroll @390 */
.tutor-atlas {
  position: fixed;
  inset: 0;
  z-index: 12050;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(12, 18, 16, 0.45);
  padding: 0;
  overflow-x: hidden;
  max-width: 100vw;
}
.tutor-atlas[hidden] { display: none !important; }
.tutor-atlas-sheet {
  width: min(100vw, 420px);
  max-width: 100%;
  max-height: min(88dvh, 640px);
  background: #15241e;
  color: #e8f5ef;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: hidden;
}
.tutor-atlas-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.9rem 1rem 0.55rem;
  border-bottom: 1px solid rgba(20, 36, 30, 0.08);
  flex: 0 0 auto;
}
.tutor-atlas-head strong {
  display: block;
  font-size: 1.02rem;
  line-height: 1.35;
  word-break: break-word;
}
.tutor-atlas-sub {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  opacity: 0.78;
  line-height: 1.4;
  word-break: break-word;
}
.tutor-atlas-close {
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  min-width: 36px;
  min-height: 36px;
  cursor: pointer;
  color: inherit;
  flex: 0 0 auto;
}
.tutor-atlas-list {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 0.65rem 1.1rem;
  max-width: 100%;
}
/* گامِ ۱۱ (سشنِ ۳) — همان قفسهٔ حبابِ چت، داخلِ این پنل.
   کارت لبه و سایه و پس‌زمینهٔ خودش را این‌جا کنار می‌گذارد (پنل خودش کارت است)
   و فقط بدنه‌اش می‌ماند. `min-height: 0` لازم است، وگرنه بدنهٔ flex از سقفِ
   ۸۸dvh بیرون می‌زند و سرِ پنل — یعنی دکمهٔ بستن — از صفحه خارج می‌شود. */
.tutor-atlas .tutor-atlas-list > .nabgol-book-outline {
  max-width: 100%;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  min-height: 0;
}
/* پالتِ قفسه با پالتِ نقشه هم‌زبان می‌شود؛ دو سبزِ متفاوت در یک پنل، دو معنا
   به‌نظر می‌رسد. فقط متغیرها بازنویسی می‌شوند، هیچ قاعدهٔ ساختاری. */
.tutor-atlas .nabgol-book-outline {
  --bo-ink:        #e8f5ef;
  --bo-ink-soft:   rgba(232, 245, 239, .8);
  --bo-ink-faint:  rgba(232, 245, 239, .62);
  --bo-accent:     #e8b84a;
  --bo-wash:       rgba(232, 184, 74, .12);
  --bo-row:        rgba(232, 245, 239, .05);
  --bo-row-edge:   rgba(232, 184, 74, .18);
  --bo-row-hover:  rgba(232, 184, 74, .14);
}
html[data-theme="light"] .tutor-atlas .nabgol-book-outline {
  --bo-ink:        #14241e;
  --bo-ink-soft:   #40584e;
  --bo-ink-faint:  #4f665c;   /* ≥۴٫۵:۱ روی ردیفِ hover‌شده هم (R18) */
  --bo-accent:     var(--nbgc-0b6a47, #0b6a47);
  --bo-wash:       rgba(var(--nbgr-15-122-82, 15, 122, 82), .09);
  --bo-row:        #ffffff;
  --bo-row-edge:   #d5e2da;
  --bo-row-hover:  rgba(var(--nbgr-15-122-82, 15, 122, 82), .08);
}

.tutor-atlas-node {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0.2rem 0;
  padding: 0.55rem 0.65rem;
  padding-inline-start: calc(0.65rem + (var(--atlas-depth, 0) * 0.85rem));
  border: 1px solid rgba(232, 184, 74, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  text-align: start;
  cursor: pointer;
  min-height: 44px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.tutor-atlas-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  /* Darkened from #9aa7a0 to clear WCAG 1.4.11 (>=3:1) against the node's
     #fff light-theme background; still >=3:1 against the dark node bg. */
  background: #819188;
  flex: 0 0 auto;
}
/* Same WCAG 1.4.11 pass: darkened from #d4a017, keeping the amber hue. */
.tutor-atlas-node.is-learning .tutor-atlas-dot { background: #b28613; }
.tutor-atlas-node.is-checking .tutor-atlas-dot { background: var(--nbgc-2f7dd1, #2f7dd1); }
/* Same WCAG 1.4.11 pass: darkened from #1fa97a, keeping the green hue. */
.tutor-atlas-node.is-mastered .tutor-atlas-dot { background: var(--nbgc-1da074, #1da074); }
.tutor-atlas-title {
  flex: 1 1 8rem;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
}
.tutor-atlas-meta {
  flex: 0 1 auto;
  font-size: 0.75rem;
  opacity: 0.72;
}
.tutor-atlas-empty {
  margin: 1rem;
  opacity: 0.75;
  font-size: 0.9rem;
}
/* Wave-08 planning pick: the top-ranked (weight × weakness × due) suggestion —
   visually distinct from the plain chapter/topic list below it. */
.tutor-atlas-suggest-row {
  padding: 0 0.65rem 0.3rem;
}
.tutor-atlas-suggest {
  border-color: rgba(232, 184, 74, 0.45);
  background: rgba(212, 160, 23, 0.14);
}
.tutor-atlas-suggest .tutor-atlas-title {
  color: #f0d488;
}
html[data-theme="light"] .tutor-atlas-suggest {
  border-color: #d4a017;
  background: #fff8e6;
}
html[data-theme="light"] .tutor-atlas-suggest .tutor-atlas-title {
  color: #6b4e0a;
}
/* گامِ ۱۱ بندِ ۴ (سشنِ ۲) — ردیفِ پنج مقصد. همان پایهٔ .tutor-atlas-node را
   می‌گیرد (کنتراست و اندازهٔ لمسیِ ۴۴px از قبل رعایت شده)؛ فقط رنگِ خنثی به‌جای
   نشانِ وضعیت، چون این دکمه‌ها مقصد نشان می‌دهند نه پیشرفت. */
.tutor-atlas-outcome .tutor-atlas-dot { background: #819188; }
.tutor-atlas-back-row {
  padding: 0.3rem 0.65rem 0.85rem;
  flex: 0 0 auto;
}
.tutor-atlas-back {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.82;
  font-size: 0.85rem;
  min-height: 40px;
  padding: 0.3rem 0.4rem;
  cursor: pointer;
}
@media (max-width: 390px) {
  .tutor-atlas,
  .tutor-atlas-sheet,
  .tutor-atlas-list,
  .tutor-atlas-node {
    overflow-x: hidden;
    max-width: 100%;
  }
  .tutor-atlas-sheet { width: 100vw; border-radius: 14px 14px 0 0; }
}
html[data-theme="light"] .tutor-atlas-sheet {
  background: #f7faf8;
  color: #14241e;
}
html[data-theme="light"] .tutor-atlas-node {
  background: #fff;
  border-color: rgba(20, 36, 30, 0.1);
}
