/* ==========================================================
   قصتنا في التحسين (.st-)
   سلسلة المنهجية، مراحل الرحلة، التشخيص، الأولويات، حوكمة الخطة.
   ========================================================== */

/* الكلمات الطويلة جدًا (أسماء، روابط) تلتف داخل حدودها ولا تسبب تمريرًا أفقيًا */
.st { overflow-wrap: anywhere; }

.st-toc { display: flex; flex-wrap: wrap; gap: 8px; }
.st-toc .chip { background: #fff; }

/* ---------- سلسلة المنهجية ---------- */
.st-chain { padding: 16px; background: linear-gradient(180deg, var(--brand-50), #fff 80%); border-color: var(--brand-100); }
@media (min-width: 768px) { .st-chain { padding: 22px 24px 24px; } }
.st-chain-label { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: .95rem; font-weight: 700; color: var(--brand-800); }
.st-chain-label .i { color: var(--brand-600); }
.st-chain-list { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 4px; }
.st-chain-item { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.st-node {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 12px; border-radius: 999px; background: #fff;
  border: 1px solid var(--brand-200); color: var(--ink); font-weight: 600; font-size: .9rem; line-height: 1.45; box-shadow: var(--shadow-sm);
  transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease);
}
.st-node-ic { display: inline-flex; color: var(--brand-600); flex: none; }
.st-node:hover { background: var(--brand-50); border-color: var(--brand-400); color: var(--brand-800); }
.st-chain-item:first-child .st-node, .st-chain-item:last-child .st-node { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.st-chain-item:first-child .st-node-ic, .st-chain-item:last-child .st-node-ic { color: #fff; }
.st-arrow { display: inline-flex; color: var(--brand-300); flex: none; }

/* سكة أفقية على الشاشات المتوسطة والواسعة */
@media (min-width: 760px) {
  .st-chain-list { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0; align-items: start; }
  .st-chain-item { position: relative; display: flex; flex-direction: column; align-items: center; }
  .st-node { flex-direction: column; gap: 8px; padding: 0 4px; background: none; border: 0; box-shadow: none; text-align: center; width: 100%; }
  .st-node:hover { background: none; color: var(--brand-800); }
  .st-node-ic {
    display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #fff;
    border: 2px solid var(--brand-200); color: var(--brand-600); transition: border-color .2s, transform .25s var(--ease), box-shadow .2s;
  }
  .st-node:hover .st-node-ic { border-color: var(--brand-500); transform: translateY(-2px); box-shadow: var(--shadow); }
  .st-node-lbl { font-size: .86rem; line-height: 1.5; }
  .st-chain-item:first-child .st-node, .st-chain-item:last-child .st-node { background: none; color: var(--brand-800); }
  .st-chain-item:first-child .st-node-ic, .st-chain-item:last-child .st-node-ic { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
  /* الخط الواصل بين الحلقات (يتجه يسارًا في RTL) */
  .st-chain-item:not(:last-child)::before {
    content: ''; position: absolute; top: 22px; inset-inline-start: calc(50% + 28px); width: calc(100% - 56px);
    border-top: 2px dashed var(--brand-200);
  }
  .st-arrow { position: absolute; top: 15px; inset-inline-start: calc(100% - 8px); width: 16px; height: 16px; color: var(--brand-400); background: #fff; border-radius: 50%; }
}

/* ---------- مراحل الرحلة ---------- */
.st-journey { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); }
.st-jstep { position: relative; display: flex; flex-direction: column; min-width: 0; }
.st-jcard { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.st-jhead { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.st-jicon {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: #fff;
  background: linear-gradient(145deg, var(--brand-500), var(--brand-700)); box-shadow: 0 6px 14px -8px rgba(0, 97, 88, .8);
}
.st-jnum {
  display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding-inline: 8px; border-radius: 999px;
  background: var(--brand-50); border: 1px solid var(--brand-200); color: var(--brand-700); font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.st-jgo {
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  gap: 8px; font-size: .82rem; font-weight: 600; color: var(--brand-700); line-height: 1.5;
}
.st-jgo .i { flex: none; transition: transform .25s var(--ease); }
.st-jcard:hover .st-jgo .i { transform: translateX(-3px); }
.st-jtitle { font-size: 1.06rem; line-height: 1.5; }
.st-jtext { color: var(--ink-2); font-size: .93rem; line-height: 1.75; }
.st-jarrow { display: flex; justify-content: center; padding-block: 6px; color: var(--brand-400); }
.st-jstep:last-child .st-jcard { border-color: var(--brand-200); background: linear-gradient(180deg, var(--brand-50), #fff 70%); }

@media (min-width: 1024px) {
  .st-journey { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 36px; }
  .st-jarrow { position: absolute; top: 50%; inset-inline-start: calc(100% + 8px); padding: 0; transform: translateY(-50%) rotate(90deg); }
  .st-jstep:nth-child(4n) .st-jarrow { display: none; }
}

/* ---------- من أين بدأنا؟ ---------- */
.st-diag { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .st-diag { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
.st-dg { --tone: var(--brand-700); --tone-bg: var(--brand-50); --tone-line: var(--brand-300); border-top: 3px solid var(--tone-line); display: flex; flex-direction: column; }
.st-dg-good { --tone: var(--good); --tone-bg: var(--good-bg); --tone-line: #8fd0a4; }
.st-dg-info { --tone: var(--info); --tone-bg: var(--info-bg); --tone-line: #9dbbe8; }
.st-dg-warn { --tone: var(--warn); --tone-bg: var(--warn-bg); --tone-line: #efb38a; }
.st-dg-brand { --tone: var(--brand-700); --tone-bg: var(--brand-100); --tone-line: var(--brand-400); background: linear-gradient(180deg, var(--brand-50), #fff 65%); }
.st-dg .card-head { align-items: center; }
.st-dg-icon { background: var(--tone-bg); color: var(--tone); border-color: transparent; }
.st-dg-num { font-size: .75rem; font-weight: 700; color: var(--tone); line-height: 1.3; font-variant-numeric: tabular-nums; }
.st-dg-list { list-style: none; display: grid; gap: 10px; }
.st-dg-list li { position: relative; padding-inline-start: 20px; color: var(--ink-2); line-height: 1.75; }
.st-dg-list li::before { content: ''; position: absolute; inset-inline-start: 3px; top: .72em; width: 8px; height: 8px; border-radius: 50%; background: var(--tone); opacity: .75; }
.st-dg-text { color: var(--ink-2); font-size: 1.02rem; line-height: 1.85; }
.st-dg-more { margin-top: auto; padding-top: 14px; font-size: .92rem; }

/* خطوط الأساس */
.st-base { margin-top: 20px; padding: 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
@media (min-width: 768px) { .st-base { padding: 18px 22px 22px; } }
.st-base-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 700; font-size: .95rem; color: var(--ink-2); }
.st-base-title .i { color: var(--role-baseline); flex: none; }
.st-base-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
.st-base-item { display: block; min-width: 0; color: inherit; border-radius: var(--radius-sm); transition: transform .2s var(--ease), box-shadow .2s; }
.st-base-item:hover { color: inherit; transform: translateY(-2px); box-shadow: var(--shadow); }
.st-base-item .rv { height: 100%; background: #fff; }
.st-base-item .rv-note { font-size: .86rem; font-weight: 600; color: var(--ink-2); }

/* ---------- أولوياتنا ---------- */
.st-prs { list-style: none; display: grid; gap: 14px; }
.st-pr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 16px; align-items: start; }
.st-pr-num {
  display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; color: #fff; font-size: 1.4rem; font-weight: 700;
  background: linear-gradient(145deg, var(--brand-500), var(--brand-700)); font-variant-numeric: tabular-nums; box-shadow: 0 8px 18px -10px rgba(0, 97, 88, .9);
}
.st-pr-main { min-width: 0; align-self: center; }
.st-pr-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--brand-600); margin-bottom: 2px; }
.st-pr-title { font-size: clamp(1.02rem, .98rem + .3vw, 1.16rem); line-height: 1.6; }
.st-pr-links { grid-column: 1 / -1; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); padding-top: 14px; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .st-pr-links { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; } }
@media (min-width: 1024px) {
  .st-pr { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.45fr); gap: 20px; align-items: center; }
  .st-pr-links { grid-column: auto; padding-top: 0; border-top: 0; padding-inline-start: 20px; border-inline-start: 1px solid var(--line); }
}
.st-pr-group { min-width: 0; }
.st-pr-label { font-size: .78rem; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.st-pr-inds { list-style: none; display: grid; gap: 6px; }
.st-pr-inds li {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; min-width: 0;
  padding: 6px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line);
}
.st-pr-inds a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; font-size: .92rem; color: var(--ink); }
.st-pr-inds a .i { color: var(--brand-600); flex: none; }
.st-pr-inds a:hover { color: var(--brand-700); }
.st-pr-inds .badge { white-space: normal; }

/* ---------- حوكمة الخطة ---------- */
.st-sub { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; margin-bottom: 12px; color: var(--ink-2); }
.st-sub .i { color: var(--brand-600); }
.st-team-table tbody th { background: transparent; color: var(--ink); font-size: .95rem; font-weight: 700; white-space: normal; position: static; }
.st-member { min-width: 170px; }
.st-member-ic { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); vertical-align: middle; margin-inline-end: 8px; }
.st-member-name { vertical-align: middle; }
.st-team-table td { color: var(--ink-2); }
.st-team-table td:nth-child(2) { min-width: 130px; }
.st-team-table td:nth-child(3) { min-width: 200px; }
.st-team-table td:nth-child(4) { min-width: 210px; }
.st-team-table td:nth-child(5) { min-width: 214px; }
.st-team-progs .chip { font-size: .8rem; padding: 3px 10px; }
.st-team-table .badge { white-space: normal; }
@media (min-width: 720px) { .st-team-table tbody tr:last-child > * { border-bottom: 0; } }

/* بطاقات بدل الجدول على الشاشات الصغيرة */
@media (max-width: 719px) {
  .st-team { border: 0; background: transparent; overflow: visible; border-radius: 0; }
  .st-team-table { min-width: 0; font-size: .95rem; }
  .st-team-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .st-team-table, .st-team-table tbody, .st-team-table tr, .st-team-table th, .st-team-table td { display: block; width: 100%; }
  .st-team-table tr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 4px 16px; }
  .st-team-table tr + tr { margin-top: 12px; }
  .st-team-table tbody tr:hover { background: #fff; }
  .st-team-table tbody th { display: flex; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 1.02rem; }
  .st-member { min-width: 0; }
  .st-member-ic { margin: 0; flex: none; }
  .st-member-name { min-width: 0; }
  .st-team-table td { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
  .st-team-table td:nth-child(n) { min-width: 0; }
  .st-team-table td > * { justify-self: start; max-width: 100%; }
  .st-team-table tr > :last-child { border-bottom: 0; }
  .st-team-table td::before { content: attr(data-label); font-size: .82rem; font-weight: 600; color: var(--ink-3); line-height: 1.6; }
}
@media (max-width: 420px) {
  .st-team-table td { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

/* ---------- ختام ---------- */
.st-next { margin-top: 48px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
@media (min-width: 768px) { .st-next { margin-top: 64px; padding: 26px 28px; } }
.st-next-text { flex: 1 1 300px; min-width: 0; }
.st-next-title { font-size: clamp(1.1rem, 1.02rem + .4vw, 1.3rem); margin-bottom: 4px; }
.st-next-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 480px) { .st-next-actions .btn { flex: 1 1 100%; } }
