/**
 * تصميم صفحات المنهج والخطط — متوافق مع الألوان العامة للمنصة
 * (#1a3a30، #c9b67a، خلفية #b2a69b، Tajawal)
 */

:root {
  --plat-brand: #1a3a30;
  --plat-brand-mid: #2c5c52;
  --plat-gold: #c9b67a;
  --plat-gold-soft: #e8dcc4;
  --plat-bg: #b2a69b;
  --plat-card: #f7f7f7;
  --plat-text: #2c3e50;
  --plat-muted: #5c6b7a;
  --plat-radius: 18px;
  --plat-shadow: 0 4px 24px rgba(26, 58, 48, 0.12);
  /* ارتفاع النافبار الثابت + الحد الذهبي — المحتوى يبدأ تحته لا تحته */
  --plat-navbar-offset: 5.75rem;
}

.platform-site {
  font-family: "Tajawal", system-ui, sans-serif;
  background: var(--plat-bg);
  color: var(--plat-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ——— شريط علوي ثابت ——— */
.platform-navbar {
  background: linear-gradient(180deg, var(--plat-brand) 0%, #152e28 100%);
  border-bottom: 0;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
  z-index: 1030;
}

.platform-navbar .navbar-brand {
  font-size: 1.15rem;
  color: #fff !important;
}

.platform-navbar .nav-link {
  color: rgba(255, 255, 255, 0.92) !important;
  font-weight: 500;
  padding: 0.45rem 0.65rem !important;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.platform-navbar .nav-link:hover,
.platform-navbar .nav-link:focus {
  background: rgba(201, 182, 122, 0.15);
  color: #fff !important;
}

.platform-navbar .btn-nav-outline {
  border: 1px solid var(--plat-gold);
  color: #fff !important;
  font-size: 0.9rem;
}

.platform-navbar .btn-nav-gold {
  background: var(--plat-gold);
  color: var(--plat-brand) !important;
  font-weight: 700;
  border: none;
}

.platform-navbar .navbar-toggler {
  border-color: var(--plat-gold);
  filter: brightness(0) invert(1);
}

.platform-logo {
  height: 52px;
  width: auto;
  margin-left: 12px;
  border-radius: 12px;
  object-fit: contain;
}

/* المحتوى الرئيسي: بدون هيرو نفس المسافة تحت الناف؛ مع هيرو المسافة من الهيرو وليس تكراراً هنا */
.platform-main-content {
  flex: 1;
  padding-top: calc(var(--plat-navbar-offset) + 0.75rem);
  padding-bottom: 2rem;
}

.platform-site:has(.platform-hero) .platform-main-content {
  padding-top: 1rem;
}

/* ربط ناعم بين الهيرو والخلفية البيج — يزيل القطع الحاد تحت الشريط */
.platform-hero {
  background: linear-gradient(135deg, var(--plat-brand) 0%, var(--plat-brand-mid) 55%, #1a3028 100%);
  color: #fff;
  /* الهيرو خارج <main> — لابد من تعويض الناف الثابت وإلا يغطي النص */
  padding: calc(var(--plat-navbar-offset) + 1rem) 0 3.25rem;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

.platform-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  background: linear-gradient(
    to bottom,
    rgba(178, 166, 155, 0) 0%,
    rgba(178, 166, 155, 0.45) 45%,
    var(--plat-bg) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* رفع أول كتلة محتوى لتتداخل قليلاً مع تدرج الهيرو */
.platform-hero + .platform-main-content > *:first-child {
  margin-top: -2.75rem;
  position: relative;
  z-index: 2;
}

.platform-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
      circle at 20% 30%,
      rgba(201, 182, 122, 0.12) 0%,
      transparent 45%
    ),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
  pointer-events: none;
}

.platform-hero .container {
  position: relative;
  z-index: 1;
}

.platform-hero__eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--plat-gold-soft);
  margin-bottom: 0.35rem;
}

.platform-hero__title {
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  font-weight: 800;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
  margin-bottom: 0.5rem;
}

.platform-hero__lead {
  font-size: 1.05rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.9);
  max-width: 720px;
  margin-bottom: 0;
}

.platform-breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.platform-breadcrumb a {
  color: var(--plat-gold-soft);
  text-decoration: none;
}

.platform-breadcrumb a:hover {
  text-decoration: underline;
  color: #fff;
}

/* ——— حاوية المحتوى ——— */
.platform-sheet {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
}

.platform-sheet--wide {
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
}

/* توسيط البوكسات في صفحات المنصة */
.platform-sheet .row.g-4,
.platform-sheet--wide .row.g-4 {
  justify-content: center;
}

.platform-sheet .platform-card,
.platform-sheet .platform-plan-card,
.platform-sheet .platform-tree-2d,
.platform-sheet .platform-tree-3d,
.platform-sheet .platform-branch-card,
.platform-sheet--wide .platform-card,
.platform-sheet--wide .platform-plan-card,
.platform-sheet--wide .platform-tree-2d,
.platform-sheet--wide .platform-tree-3d,
.platform-sheet--wide .platform-branch-card {
  margin-left: auto;
  margin-right: auto;
}

/* بطاقات المحتوى */
.platform-card {
  background: var(--plat-card);
  border-radius: var(--plat-radius);
  box-shadow: var(--plat-shadow);
  border: 1px solid rgba(201, 182, 122, 0.35);
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.25rem;
}

.platform-card--accent {
  border-right: 5px solid var(--plat-gold);
}

.platform-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--plat-brand);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(201, 182, 122, 0.5);
}

.platform-lead-quote {
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--plat-text);
  border-right: 4px solid var(--plat-gold);
  padding-right: 1rem;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 0 var(--plat-radius) var(--plat-radius) 0;
  padding: 1rem 1.25rem;
}

/* صفحة الفروع: بطاقة فرع */
.platform-branch-card {
  background: #fff;
  border-radius: var(--plat-radius);
  border: 1px solid rgba(26, 58, 48, 0.12);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
  padding: 1.5rem 1.35rem;
  margin-bottom: 1.5rem;
  scroll-margin-top: 100px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.platform-branch-card:hover {
  box-shadow: 0 8px 28px rgba(26, 58, 48, 0.12);
  border-color: rgba(201, 182, 122, 0.65);
}

.platform-branch-card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--plat-brand), var(--plat-brand-mid));
  color: var(--plat-gold);
  font-weight: 800;
  font-size: 1rem;
  margin-left: 0.75rem;
  flex-shrink: 0;
}

.platform-branch-card h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--plat-brand);
  margin: 0;
}

/* صفحة المسارات: كل المحتوى داخل بوكس وسطي */
.platform-branches-box {
  background: var(--plat-bg);
  border: 0;
  border-radius: calc(var(--plat-radius) + 2px);
  box-shadow: var(--plat-shadow);
  padding: 1rem;
}

.platform-branches-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.platform-branches-content {
  min-width: 0;
}

/* فهرس جانبي */
.platform-toc {
  position: sticky;
  top: 100px;
  background: var(--plat-card);
  border-radius: var(--plat-radius);
  border: 1px solid rgba(201, 182, 122, 0.45);
  padding: 1rem 1rem;
  font-size: 0.92rem;
}

.platform-toc strong {
  display: block;
  color: var(--plat-brand);
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
}

.platform-toc a {
  display: block;
  color: var(--plat-muted);
  text-decoration: none;
  padding: 0.35rem 0;
  border-right: 3px solid transparent;
  padding-right: 0.5rem;
  transition: color 0.15s, border-color 0.15s;
}

.platform-toc a:hover {
  color: var(--plat-brand);
  border-right-color: var(--plat-gold);
}

.platform-toc--center {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.platform-toc--center a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-right: 0;
  border-bottom: 1px dashed rgba(26, 58, 48, 0.14);
  padding-right: 0;
}

.platform-toc--center a:last-child {
  border-bottom: 0;
}

.toc-num {
  min-width: 1.65rem;
  height: 1.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--plat-brand);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.branches-flow {
  max-width: 1040px;
  margin: 0 auto;
}

.branch-flow-row {
  margin-bottom: 1.6rem;
}

.platform-branch-card--center {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.branch-connector {
  width: 2px;
  height: 38px;
  margin: 0 auto 1rem;
  background: linear-gradient(180deg, var(--plat-brand) 0%, var(--plat-gold) 100%);
  opacity: 0.8;
}

/* صفحة المسارات: تحريك الكتلة كلها قليلاً لليسار على الكمبيوتر */
@media (min-width: 992px) {
  .platform-branches-shift-left {
    transform: translateX(-70px);
  }
}

/* أزرار */
.btn-platform-primary {
  background: linear-gradient(180deg, var(--plat-gold) 0%, #b8a066 100%);
  color: var(--plat-brand) !important;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.35rem;
  box-shadow: 0 2px 10px rgba(201, 182, 122, 0.45);
}

.btn-platform-primary:hover {
  filter: brightness(1.05);
  color: var(--plat-brand) !important;
}

.btn-platform-dark {
  background: var(--plat-brand);
  color: #fff !important;
  font-weight: 600;
  border: 1px solid var(--plat-gold);
  border-radius: 999px;
  padding: 0.45rem 1.2rem;
}

.btn-platform-dark:hover {
  background: #234d42;
  color: #fff !important;
}

.btn-platform-ghost {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #fff !important;
  border-radius: 999px;
  font-weight: 600;
}

.btn-platform-ghost:hover {
  border-color: var(--plat-gold);
  color: var(--plat-gold-soft) !important;
}

/* خطط الاشتراك */
.platform-plans-hero {
  margin-bottom: 1.5rem;
}

.platform-plan-card {
  background: var(--plat-card);
  border-radius: var(--plat-radius);
  border: 1px solid rgba(201, 182, 122, 0.4);
  box-shadow: var(--plat-shadow);
  padding: 1.5rem 1.35rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.platform-plan-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(26, 58, 48, 0.14);
}

.platform-plan-card .plan-track {
  font-size: 0.8rem;
  color: var(--plat-muted);
}

.platform-plan-card .plan-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--plat-brand);
}

/* فوتر */
.platform-footer {
  background: linear-gradient(135deg, var(--plat-brand) 0%, var(--plat-brand-mid) 100%);
  color: #e0e0e0;
  padding: 2.5rem 0 1.5rem;
  margin-top: auto;
  border-top: 3px solid var(--plat-gold);
}

.platform-footer a {
  color: var(--plat-gold);
  text-decoration: none;
}

.platform-footer a:hover {
  text-decoration: underline;
  color: #fff;
}

.platform-footer .social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.platform-footer .social-links a {
  font-size: 1.25rem;
  margin-left: 0.5rem;
}

.platform-footer__link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 1rem;
}

.platform-footer__link-grid a {
  display: block;
  color: var(--plat-gold);
  text-decoration: none;
}

.platform-footer__link-grid a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ——— شجرة تفاعلية 2D (صفحة المسارات) ——— */
.platform-tree-2d {
  background: var(--plat-bg);
  border-radius: var(--plat-radius);
  border: 0;
  box-shadow: var(--plat-shadow);
  padding: 1rem 0.75rem 1.25rem;
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.platform-tree-2d__title {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--plat-brand);
  margin-bottom: 0.35rem;
}

.platform-tree-2d__sub {
  text-align: center;
  font-size: 0.88rem;
  color: var(--plat-muted);
  margin-bottom: 0.75rem;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

.platform-tree-2d svg {
  display: block;
  width: 100%;
  max-width: 820px;
  height: auto;
  margin: 0 auto;
}

.platform-tree-2d .tree-node {
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.platform-tree-2d .tree-node:hover,
.platform-tree-2d .tree-node:focus {
  filter: drop-shadow(0 4px 10px rgba(26, 58, 48, 0.25));
}

.platform-tree-2d .tree-node:hover circle:first-of-type,
.platform-tree-2d .tree-node:focus circle:first-of-type {
  fill: #fffdf5;
  stroke: var(--plat-gold);
  stroke-width: 3;
}

.platform-tree-2d .tree-node text {
  font-family: "Tajawal", system-ui, sans-serif;
  pointer-events: none;
}

.platform-tree-3d-map {
  perspective: 1000px;
}

.platform-tree-3d-map svg {
  transform: rotateX(8deg);
  transform-origin: center 62%;
}

.platform-tree-3d-map .tree-node a {
  cursor: pointer;
}

.platform-tree-3d-map .tree-node a:hover ellipse,
.platform-tree-3d-map .tree-node a:focus ellipse {
  stroke: var(--plat-gold);
  stroke-width: 3;
  filter: drop-shadow(0 6px 10px rgba(26, 58, 48, 0.24));
}

/* ——— شجرة 3D (صفحة الشجرة التعليمية) ——— */
.platform-tree-3d {
  background: linear-gradient(180deg, #fdfcf8 0%, #f3efe7 100%);
  border: 1px solid rgba(201, 182, 122, 0.55);
  border-radius: var(--plat-radius);
  box-shadow: var(--plat-shadow);
  padding: 1.1rem 1rem 1rem;
}

.platform-tree-3d__scene {
  position: relative;
  min-height: 280px;
  perspective: 900px;
  transform-style: preserve-3d;
  animation: treeSceneSpin 16s ease-in-out infinite;
}

.platform-tree-3d__ground {
  position: absolute;
  inset: auto 50% 0;
  transform: translateX(-50%);
  width: min(420px, 92%);
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(46, 125, 50, 0.25) 0%, rgba(46, 125, 50, 0.08) 55%, rgba(46, 125, 50, 0) 100%);
}

.platform-tree-3d__trunk {
  position: absolute;
  left: 50%;
  bottom: 26px;
  width: 74px;
  height: 170px;
  transform: translateX(-50%) rotateX(12deg);
  border-radius: 36px;
  background: linear-gradient(100deg, #3f2b1f 0%, #6b4b34 48%, #2e1f16 100%);
  box-shadow: 0 10px 24px rgba(44, 28, 18, 0.28);
  animation: trunkSway 7s ease-in-out infinite;
}

.platform-tree-3d__crown {
  position: absolute;
  left: 50%;
  top: 10px;
  width: min(560px, 96%);
  height: 205px;
  transform: translateX(-50%) rotateX(10deg);
  border-radius: 50% 50% 48% 52% / 55% 52% 48% 45%;
  background: radial-gradient(circle at 35% 35%, #5bbf6a 0%, #2f8a43 48%, #1f5c2c 100%);
  box-shadow: inset -20px -20px 50px rgba(17, 59, 24, 0.35), 0 16px 34px rgba(27, 71, 33, 0.24);
  animation: crownFloat 5s ease-in-out infinite;
}

.platform-tree-3d__crown .leaf {
  position: absolute;
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #1a3a30;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.17);
  animation: leafPulse 4.5s ease-in-out infinite;
}

.platform-tree-3d .leaf--1 { animation-delay: 0s; }
.platform-tree-3d .leaf--2 { animation-delay: .35s; }
.platform-tree-3d .leaf--3 { animation-delay: .7s; }
.platform-tree-3d .leaf--4 { animation-delay: 1.05s; }
.platform-tree-3d .leaf--5 { animation-delay: 1.4s; }
.platform-tree-3d .leaf--6 { animation-delay: 1.75s; }

.platform-tree-3d .leaf--1 { top: 26px; right: 75px; }
.platform-tree-3d .leaf--2 { top: 10px; left: 50%; transform: translateX(-50%); }
.platform-tree-3d .leaf--3 { top: 32px; left: 78px; }
.platform-tree-3d .leaf--4 { bottom: 26px; left: 92px; }
.platform-tree-3d .leaf--5 { bottom: 8px; left: 50%; transform: translateX(-50%); }
.platform-tree-3d .leaf--6 { bottom: 24px; right: 88px; }

.platform-tree-3d__caption {
  margin: 0.65rem 0 0;
  text-align: center;
  color: var(--plat-muted);
  font-size: 0.9rem;
}

@keyframes treeSceneSpin {
  0%, 100% { transform: rotateY(-6deg) rotateX(0deg); }
  50% { transform: rotateY(6deg) rotateX(1deg); }
}

@keyframes trunkSway {
  0%, 100% { transform: translateX(-50%) rotateX(12deg) rotateZ(-1deg); }
  50% { transform: translateX(-50%) rotateX(12deg) rotateZ(1.2deg); }
}

@keyframes crownFloat {
  0%, 100% { transform: translateX(-50%) rotateX(10deg) translateY(0); }
  50% { transform: translateX(-50%) rotateX(10deg) translateY(-6px); }
}

@keyframes leafPulse {
  0%, 100% { opacity: 0.95; filter: brightness(1); }
  50% { opacity: 1; filter: brightness(1.08); }
}

/* قائمة أهداف */
.platform-check-list li {
  margin-bottom: 0.65rem;
  padding-right: 0.25rem;
}

/* استجابة */
@media (max-width: 991px) {
  .platform-branches-box {
    padding: 0.8rem;
  }

  .platform-toc {
    position: static;
    margin-bottom: 1.5rem;
  }

  .platform-tree-3d__scene {
    min-height: 250px;
  }

  .platform-tree-3d__trunk {
    width: 64px;
    height: 148px;
  }

  .platform-tree-3d__crown {
    height: 178px;
  }

  .platform-tree-3d__crown .leaf {
    font-size: 0.73rem;
    padding: 0.28rem 0.56rem;
  }

  .platform-tree-3d-map svg {
    transform: none;
  }
}

/* محسّن للأجهزة المحمولة */
@media (max-width: 768px) {
  .platform-site {
    font-size: 0.9rem;
  }
  
  .platform-navbar {
    padding: 0.5rem 0;
  }
  
  .platform-navbar .navbar-brand {
    font-size: 1rem;
  }
  
  .platform-navbar .nav-link {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.85rem;
  }
  
  .btn-platform-primary,
  .btn-platform-dark,
  .btn-platform-ghost {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
  }
  
  .platform-card {
    margin-bottom: 1rem;
    padding: 1rem;
  }
  
  .platform-branches-box {
    padding: 0.6rem;
  }
  
  .platform-branches-shift-left {
    transform: translateX(-50px);
  }
  
  .platform-branches-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  
  .platform-toc {
    position: static;
    margin-bottom: 1rem;
  }
  
  .platform-tree-3d__scene {
    min-height: 200px;
  }
  
  .platform-tree-3d__trunk {
    width: 48px;
    height: 120px;
  }
  
  .platform-tree-3d__crown {
    height: 140px;
  }
  
  .platform-tree-3d__crown .leaf {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
  }
}

/* محسّن للشاشات الصغيرة جداً */
@media (max-width: 480px) {
  /* Portrait mode optimizations */
  @media (orientation: portrait) {
    .platform-site {
      font-size: 0.8rem;
      padding: 0.5rem 0;
    }
    
    .platform-navbar {
      padding: 0.25rem 0;
    }
    
    .platform-navbar .navbar-brand {
      font-size: 0.85rem;
    }
    
    .platform-branches-box {
      padding: 0.4rem;
    }
    
    .platform-card {
      margin-bottom: 0.6rem;
      padding: 0.6rem;
    }
  }
  
  /* Landscape mode optimizations */
  @media (orientation: landscape) {
    .platform-site {
      font-size: 0.9rem;
      padding: 0.3rem 0;
    }
    
    .platform-navbar {
      padding: 0.2rem 0;
    }
    
    .platform-navbar .navbar-brand {
      font-size: 0.95rem;
    }
    
    .platform-branches-box {
      padding: 0.6rem;
    }
    
    .platform-card {
      margin-bottom: 1rem;
      padding: 1rem;
    }
  }
  
  .platform-site {
    font-size: 0.85rem;
  }
  
  .platform-navbar {
    padding: 0.3rem 0;
  }
  
  .platform-navbar .navbar-brand {
    font-size: 0.9rem;
  }
  
  .platform-navbar .nav-link {
    padding: 0.25rem 0.35rem !important;
    font-size: 0.8rem;
  }
  
  .btn-platform-primary,
  .btn-platform-dark,
  .btn-platform-ghost {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .platform-card {
    margin-bottom: 0.8rem;
    padding: 0.8rem;
  }
  
  .platform-branches-box {
    padding: 0.5rem;
  }
  
  .platform-branches-shift-left {
    transform: translateX(-30px);
  }
  
  .platform-branches-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  
  .platform-toc {
    position: static;
    margin-bottom: 0.8rem;
  }
  
  .platform-tree-3d__scene {
    min-height: 150px;
  }
  
  .platform-tree-3d__trunk {
    width: 40px;
    height: 100px;
  }
  
  .platform-tree-3d__crown {
    height: 120px;
  }
  
  .platform-tree-3d__crown .leaf {
    font-size: 0.6rem;
    padding: 0.15rem 0.3rem;
  }
}

@media (min-width: 992px) {
  .platform-branches-grid {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .platform-branches-toc {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0 !important;
  }

  .platform-branches-content {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .platform-tree-3d__scene,
  .platform-tree-3d__trunk,
  .platform-tree-3d__crown,
  .platform-tree-3d__crown .leaf {
    animation: none !important;
  }
}

/* ——— مساحة الطالب (ملخص الملف مع جداول بوابية) ——— */
.platform-student-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
}

.platform-student-avatar-wrap {
  flex-shrink: 0;
}

.platform-student-avatar-img {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--plat-gold);
  box-shadow: var(--plat-shadow);
  background: #fff;
}

.platform-student-avatar-ph {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 3px dashed rgba(201, 182, 122, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--plat-muted);
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.6);
}

.platform-student-dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 0.85rem 1.25rem;
}

.platform-student-dl-grid div {
  min-width: 0;
}

.platform-student-dl-grid dt {
  font-size: 0.78rem;
  color: var(--plat-muted);
  margin-bottom: 0.15rem;
  font-weight: 600;
}

.platform-student-dl-grid dd {
  margin: 0;
  font-weight: 700;
  color: var(--plat-brand);
  word-break: break-word;
  font-size: 0.95rem;
}

.platform-mini-stat {
  background: rgba(255, 255, 255, 0.65);
  border-radius: calc(var(--plat-radius) - 4px);
  border: 1px solid rgba(201, 182, 122, 0.35);
  padding: 0.65rem 0.85rem;
  text-align: center;
  height: 100%;
}

.platform-mini-stat .k {
  display: block;
  font-size: 0.75rem;
  color: var(--plat-muted);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.platform-mini-stat .v {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--plat-brand);
  line-height: 1.25;
}

.platform-table-soft {
  --bs-table-bg: transparent;
  font-size: 0.92rem;
}

.platform-table-soft thead th {
  color: var(--plat-brand);
  font-weight: 700;
  border-bottom-color: rgba(201, 182, 122, 0.5);
  white-space: nowrap;
}

.platform-table-soft tbody td {
  vertical-align: middle;
}

.platform-empty-hint {
  font-size: 0.92rem;
  color: var(--plat-muted);
  margin: 0;
  line-height: 1.6;
}

.platform-quick-links .btn {
  margin: 0.2rem;
}
