/* ================================================================
   BARAHEEN v8 — رأس الصفحة الجديد + لوحة العضو
   ----------------------------------------------------------------
   Chargée après v7.css, avant mobile.css.
   Tout s'appuie sur les tokens du thème (--surface, --border, --gold,
   --text, --muted, --ax-*) : la لوحة suit donc le mode clair ET le mode
   sombre sans une seule couleur codée en dur.
   ================================================================ */

:root { --ring-track: color-mix(in srgb, var(--muted) 22%, transparent); }

/* ================================================================
   1. EN-TÊTE v8
   ================================================================ */

.hdr8 { background: var(--surface); }
[data-theme="light"] .hdr8 { background: #fff; }

.hdr8-top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-block: 11px;
}

/* Le logo et la zone compte ne doivent jamais se comprimer :
   sans flex:none, ils s'écrasent au lieu de laisser la recherche rétrécir. */
.hdr8 .brand { flex: none; }
.hdr8 .brand .t b { font-size: 21px; }
.hdr8 .brand .t i { font-size: 10px; letter-spacing: 3.2px; font-weight: 700; }
.hdr8 .mark-badge { width: 46px; height: 46px; border-radius: 12px; }

.hdr8-search {
  flex: 1 1 auto;
  min-width: 150px;          /* garde-fou : la barre se rétrécit, ne disparaît pas */
  position: relative;
}
.hdr8-search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 60%, var(--surface));
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding-inline: 18px 46px;
}
.hdr8-search input::placeholder { color: var(--muted); }
.hdr8-search input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}
.hdr8-search button {
  position: absolute;
  inset-inline-end: 5px;
  top: 5px;
  width: 32px; height: 32px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
}
.hdr8-search button:hover { color: var(--gold); }

.hdr8-right { display: flex; align-items: center; gap: 10px; flex: none; }

/* Le bouton porte AUSSI la classe .acct-btn, indispensable à v6.js pour
   ouvrir le menu. Mais v6.css impose à cette classe un cercle de 38 px avec
   fond doré : le nom se retrouvait alors éjecté hors du bouton, à l'autre
   bout de la barre. On neutralise donc explicitement ces propriétés au lieu
   de retirer la classe — le comportement JS existant reste intact. */
.hdr8 .acct8-btn,
.hdr8 .acct8-btn.acct-btn {
  width: auto; height: auto;
  border: 0; border-radius: 999px;
  background: transparent;
  padding: 3px 10px 3px 3px;
  display: flex; align-items: center; gap: 9px;
  color: var(--text); cursor: pointer;
  font-family: inherit; font-weight: 400; font-size: inherit;
  max-width: 240px;
}
.hdr8 .acct8-btn:hover { background: color-mix(in srgb, var(--gold) 10%, transparent); }

/* Un courriel long ne doit pas pousser la barre : il se tronque. */
.acct8-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 160px;
}
.acct8-av {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 12%, var(--surface));
  color: var(--gold);
  display: grid; place-items: center;
  font-weight: 900; font-size: 16px;
}
.acct8-name { font-size: 14px; font-weight: 700; }
.acct8-caret { color: var(--muted); font-size: 11px; }

.hdr8-bell {
  position: relative;
  width: 42px; height: 42px; flex: none;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: grid; place-items: center;
}
.hdr8-bell:hover { color: var(--gold); border-color: var(--gold); }
.hdr8-bell .dot {
  position: absolute; top: 1px; inset-inline-end: 1px;
  min-width: 18px; height: 18px; padding-inline: 4px;
  border-radius: 999px;
  background: var(--live); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 18px; text-align: center;
}

.btn.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ---- Deuxième rangée : les rubriques ---- */

.hdr8-nav { border-top: 1px solid var(--border); background: inherit; }
.hdr8-nav .wrap { overflow-x: auto; scrollbar-width: none; }
.hdr8-nav .wrap::-webkit-scrollbar { height: 0; }

.hdr8-nav ul { display: flex; gap: 2px; list-style: none; }
.hdr8-nav li { flex: none; }
.hdr8-nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 11px 12px;
  font-size: 13.5px; font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 2.5px solid transparent;
  transition: .18s;
}
.hdr8-nav a:hover { color: var(--gold); }
.hdr8-nav li.on a { color: var(--gold); border-bottom-color: var(--gold); }
.hdr8-nav .only-mobile { display: none; }

/* ================================================================
   2. GRILLE DE LA LOUHA
   ================================================================ */

.dash { padding-block: 18px 24px; display: flex; flex-direction: column; gap: 16px; }

/* v8.2 — la لوحة n'est plus bornée à 1240 px : elle prend la largeur
   disponible jusqu'à 1720 px, sur l'accueil ET dans l'en-tête, sinon les
   deux ne seraient plus alignés. En dessous de 1300 px on revient au
   comportement normal du thème. */
body.dash-on .wrap { max-width: min(1720px, 96vw); }

@media (max-width: 1300px) {
  body.dash-on .wrap { max-width: 100%; }
}

.dash-grid {
  display: grid;
  grid-template-columns: 324px minmax(0, 1fr);  /* 1re colonne = à droite en RTL */
  gap: 16px;
  align-items: start;
}

.dash-aside,
.dash-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.dash-row { display: grid; gap: 16px; align-items: start; }
.dash-row-2c { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---- Carte générique de la لوحة ---- */

.d-card { padding: 16px; min-width: 0; border-radius: 14px; }
.d-h { font-size: 15px; font-weight: 800; color: var(--strong); }
.d-h-gold { color: var(--gold); }
.d-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.d-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-block-end: 12px;
}
.d-more { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.d-more:hover { color: var(--gold); }
.d-empty { color: var(--muted); font-size: 13.5px; text-align: center; padding-block: 14px; }

.d-btn-full { display: flex; width: 100%; justify-content: center; margin-block-start: 12px; }

.form-msg { font-size: 12px; min-height: 1em; margin-block-start: 4px; }
.form-msg.is-ok  { color: #1a7f52; }
.form-msg.is-err { color: var(--live); }

/* ================================================================
   3. HERO — برهان اليوم
   ================================================================ */

.d-hero {
  position: relative;
  overflow: hidden;
  padding: 0;
  min-height: clamp(272px, 26vw, 360px);   /* pleine largeur : la hauteur suit */
  display: flex;
  align-items: flex-end;
  background: var(--navy-deep);
  border-color: var(--navy);
}
.d-hero-bg {
  position: absolute; inset: 0;
  background-image: var(--hero-img, none);
  background-size: cover;
  background-position: center;
}
.d-hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(275deg, #0B122000 6%, #0B1220B8 46%, #0B1220F2 100%);
}
.d-hero-badge {
  position: absolute; top: 14px; inset-inline-start: 14px; z-index: 2;
  background: #ffffffF0; color: var(--navy-deep);
  font-size: 12px; font-weight: 800;
  padding: 5px 14px; border-radius: 999px;
}
.d-hero-in { position: relative; z-index: 2; padding: 30px 34px; max-width: min(760px, 58%); }
.d-hero-in h1 { font-size: clamp(24px, 2.2vw, 34px); font-weight: 900; line-height: 1.4; }
.d-hero-in h1 a { color: #fff; }
.d-hero-lead { margin-block-start: 10px; font-size: 14px; color: #C9D3E6; line-height: 1.75; }

.d-hero-meta { display: flex; gap: 20px; margin-block-start: 14px; font-size: 12.5px; color: #B6C2D8; }
.d-hero-meta span { display: inline-flex; align-items: center; gap: 6px; }

.d-hero-cta { display: flex; gap: 10px; margin-block-start: 18px; flex-wrap: wrap; }
.d-hero-cta .btn { flex: none; }
.d-mark.is-read { background: #1a7f52; color: #fff; box-shadow: none; }
.d-hero-empty { min-height: 0; padding: 30px; color: #C9D3E6; justify-content: center; }

/* ================================================================
   4. PROGRESSION
   ================================================================ */

.dash-progress { background: var(--navy); border-color: var(--navy); text-align: center; --ring-track: #FFFFFF20; }
.dash-progress .d-h { color: #E7EDF7; }

.d-pr-ring { position: relative; width: 120px; margin: 14px auto 4px; }
.d-pr-num { position: absolute; inset: 0; display: grid; place-content: center; line-height: 1.15; }
.d-pr-num b { font-size: 30px; font-weight: 900; color: #fff; }
.d-pr-num span { font-size: 11.5px; color: #9DAAC2; }
.d-pr-pct { font-size: 12px; font-weight: 800; color: var(--gold); }

.d-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  margin-block-start: 16px; background: #FFFFFF16;
  border-radius: 12px; overflow: hidden; list-style: none;
}
.d-stats li {
  background: var(--navy);
  padding: 12px 10px;
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 1px 8px; text-align: start;
}
.d-stats b { grid-column: 1; font-size: 20px; font-weight: 900; color: #fff; line-height: 1.3; }
.d-stats span { grid-column: 1; font-size: 10.5px; color: #94A2BB; }
.d-stats i {
  grid-column: 2; grid-row: 1 / span 2;
  width: 34px; height: 34px; border-radius: 50%;
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  color: var(--gold);
  display: grid; place-items: center;
}

/* ================================================================
   5. RAIL DROIT
   ================================================================ */

.d-quick-list { list-style: none; margin-block-start: 6px; }
.d-quick-list a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 9px;
  font-size: 13.5px; color: var(--text);
}
.d-quick-list a:hover { background: color-mix(in srgb, var(--gold) 10%, transparent); color: var(--gold); }
.d-quick-list .i { color: var(--muted); flex: none; }
.d-quick-list a:hover .i { color: var(--gold); }

.d-goal-row { display: flex; align-items: center; gap: 12px; margin-block: 10px 4px; }
.d-goal-tx { flex: 1 1 auto; min-width: 0; }
.d-goal-tx b { display: block; font-size: 13.5px; font-weight: 800; color: var(--strong); }
.d-goal-tx span { font-size: 11.5px; color: var(--muted); }
.d-goal-ring { position: relative; width: 64px; height: 64px; flex: none; }
.d-goal-ring em {
  position: absolute; inset: 0;
  display: grid; place-content: center;
  font-style: normal; font-size: 13px; font-weight: 900; color: var(--gold);
}

.d-acclinks { display: flex; flex-direction: column; gap: 2px; }
.d-acclinks a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 8px; border-radius: 9px;
  font-size: 13.5px; color: var(--text);
}
.d-acclinks a:hover { background: color-mix(in srgb, var(--gold) 9%, transparent); color: var(--gold); }
.d-acclinks .i { color: var(--muted); }

.d-shub p { font-size: 13px; color: var(--muted); margin-block: 8px 0; }

.d-rev-list { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-block-start: 10px; }
.d-rev-list li { border-inline-start: 2px solid var(--gold); padding-inline-start: 10px; }
.d-rev-list p { font-size: 12.5px; color: var(--text); line-height: 1.75; }
.d-rev-list span {
  display: inline-flex; align-items: center; gap: 5px;
  margin-block-start: 4px; font-size: 11.5px; font-weight: 800; color: var(--muted);
}

/* ================================================================
   6. MUHAWIR
   ================================================================ */

.d-pillars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }

.d-pillar {
  --ax: var(--gold);
  display: flex; align-items: center; gap: 11px;
  padding: 14px; min-width: 0;
  border-radius: 14px;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.d-pillar:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--ax) 45%, var(--border));
  box-shadow: 0 12px 28px #00000024;
}
.d-pl-ic {
  width: 46px; height: 46px; flex: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ax) 14%, transparent);
  color: var(--ax);
  display: grid; place-items: center;
}
.d-pl-tx { display: flex; flex-direction: column; min-width: 0; }
.d-pl-tx b { font-size: 13px; font-weight: 800; line-height: 1.45; color: var(--strong); }
.d-pl-tx em { font-style: normal; font-size: 11.5px; color: var(--muted); }

/* ================================================================
   7. ALTHR QIRA'A
   ================================================================ */

.d-mr-list { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-block-start: 12px; }
.d-mr-list li { display: flex; align-items: flex-start; gap: 9px; }
.d-mr-n { width: 20px; flex: none; text-align: center; font-size: 13px; font-weight: 900; color: var(--gold); }
.d-mr-b { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.d-mr-b a {
  font-size: 12.5px; font-weight: 800; line-height: 1.55; color: var(--strong);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.d-mr-b a:hover { color: var(--gold); }
.d-mr-b em {
  font-style: normal; font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.d-mr-v { flex: none; font-size: 11.5px; font-weight: 900; color: var(--gold); }

/* ================================================================
   8. CARROUSELS
   ================================================================ */

.d-rail { position: relative; }
.d-rail-track {
  display: flex; gap: 12px;
  overflow-x: auto; scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-block-end: 4px;
}
.d-rail-track::-webkit-scrollbar { height: 0; }

.d-rail-b {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  display: grid; place-items: center;
  font-size: 16px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 10px #00000026;
}
.d-rail-prev { inset-inline-end: -8px; }
.d-rail-next { inset-inline-start: -8px; }
.d-rail-b:hover { color: var(--gold); border-color: var(--gold); }

.d-tile {
  --ax: var(--gold);
  position: relative;
  flex: 0 0 168px; height: 188px;
  border-radius: 12px; overflow: hidden;
  background-color: color-mix(in srgb, var(--ax) 55%, var(--navy));
  background-size: cover; background-position: center;
  scroll-snap-align: start;
  display: flex; align-items: flex-end;
}
.d-tile-sh {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, #0B1220E8 6%, #0B122026 64%);
}
.d-tile-tx { position: relative; z-index: 2; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.d-tile-tx b { font-size: 13px; font-weight: 800; color: #fff; line-height: 1.45; }
.d-tile-tx em { font-style: normal; font-size: 11.5px; font-weight: 800; color: var(--gold2); }

.d-vid {
  position: relative;
  flex: 0 0 138px; height: 100px;
  border-radius: 12px; overflow: hidden;
  background-color: var(--navy);
  background-size: cover; background-position: center;
  scroll-snap-align: start;
}
.d-vid::after { content: ""; position: absolute; inset: 0; background: #0B12205C; }
.d-vid-p { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; color: #FFFFFFEE; }
.d-vid-t {
  position: absolute; bottom: 0; inset-inline: 0; z-index: 2;
  padding: 16px 8px 6px;
  background: linear-gradient(0deg, #0B1220E0, transparent);
  font-size: 11px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ================================================================
   9. TAQWIM
   ================================================================ */

.d-cal-nav { text-align: center; font-size: 13px; font-weight: 800; color: var(--strong); margin-block-end: 10px; }
.d-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.d-dow { font-size: 10.5px; font-weight: 800; color: var(--muted); text-align: center; padding-block-end: 4px; }

.d-cell {
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  border-radius: 8px;
  font-size: 11.5px; font-weight: 700;
  color: var(--text);
  background: color-mix(in srgb, var(--muted) 10%, transparent);
}
a.d-cell:hover { background: color-mix(in srgb, var(--gold) 22%, transparent); color: var(--gold); }
.d-void { background: transparent; }
.d-cell.is-future { color: color-mix(in srgb, var(--muted) 70%, transparent); background: color-mix(in srgb, var(--muted) 5%, transparent); }
.d-cell.is-read { background: #1a7f5226; color: #1a7f52; }
.d-cell.is-today {
  background: var(--gold); color: #231B02; font-weight: 900;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 26%, transparent);
}

/* ================================================================
   10. NASHAT
   ================================================================ */

.d-act-list { list-style: none; display: flex; flex-direction: column; gap: 9px; margin-block-start: 12px; }
.d-act-list li { display: flex; align-items: center; gap: 9px; }
.d-act-i {
  width: 28px; height: 28px; flex: none;
  border-radius: 9px; display: grid; place-items: center;
}
.d-act-i.ax-sharia  { background: color-mix(in srgb, var(--ax-sharia) 16%, transparent);  color: var(--ax-sharia); }
.d-act-i.ax-logic   { background: color-mix(in srgb, var(--ax-logic) 16%, transparent);   color: var(--ax-logic); }
.d-act-i.ax-science { background: color-mix(in srgb, var(--ax-science) 16%, transparent); color: var(--ax-science); }
.d-act-i.ax-psy     { background: color-mix(in srgb, var(--ax-psy) 16%, transparent);     color: var(--ax-psy); }
.d-act-l { flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: var(--text); }
.d-act-n { flex: none; font-size: 14px; font-weight: 900; color: var(--strong); }

/* ================================================================
   11. AQWAL AL-ULAMA
   ================================================================ */

.d-sch-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.d-sch { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; min-width: 0; }
.d-sch-av {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 2.5px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 12%, var(--surface));
  background-size: cover; background-position: center;
  color: var(--gold);
  display: grid; place-items: center;
}
.d-sch b { font-size: 12px; font-weight: 800; color: var(--strong); }
.d-sch em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.d-sch:hover b { color: var(--gold); }

/* ================================================================
   12. KITAB
   ================================================================ */

.d-book { display: grid; grid-template-columns: minmax(0, 1fr) 226px; gap: 24px; align-items: center; padding: 24px; }
.d-book-tx h2 { font-size: 23px; font-weight: 900; color: var(--strong); text-align: center; }
.d-book-tx h2 .gold { color: var(--gold); }
.d-book-desc { font-size: 13.5px; color: var(--muted); text-align: center; margin-block: 8px 18px; }

.d-book-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  border: 1.5px dashed var(--gold);
  border-radius: 14px; padding: 18px;
  background: color-mix(in srgb, var(--gold) 6%, transparent);
}
.d-book-col { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.d-book-col h4 { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 800; color: var(--gold); }
.d-book-col p { font-size: 12px; color: var(--muted); }
.d-book-col .btn { margin-block-start: 6px; }
.d-book-dl { margin-block-start: 14px; display: flex; justify-content: center; }

.d-book-cover { display: grid; place-items: center; }

/* ================================================================
   13. NASHRA / ISTIFTA'
   ================================================================ */

.d-news p { font-size: 12.5px; color: var(--muted); margin-block: 6px 12px; }
.d-news-form { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.d-news-ic {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  color: var(--gold); display: grid; place-items: center;
}
.d-news-form input {
  flex: 1 1 180px; min-width: 150px; height: 44px;
  border: 1px solid var(--border); border-radius: 11px;
  background: color-mix(in srgb, var(--bg) 55%, var(--surface));
  color: var(--text); font-family: inherit; font-size: 13.5px;
  padding-inline: 14px;
}
.d-news-form input:focus { outline: none; border-color: var(--gold); }
.d-news-form .form-msg { flex: 1 0 100%; }

.d-survey { display: flex; align-items: center; gap: 14px; }
.d-survey > div { flex: 1 1 auto; min-width: 0; }
.d-survey p { font-size: 12.5px; color: var(--muted); margin-block-start: 3px; }
.d-survey-ic {
  width: 48px; height: 48px; flex: none; border-radius: 50%;
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  color: var(--gold); display: grid; place-items: center;
}
.d-survey .btn { flex: none; }

/* ================================================================
   14. MUSAHIMUN
   ================================================================ */

.d-contrib-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.d-contrib-c {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 12px; text-align: center; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.d-contrib-c:hover { border-color: var(--gold); }
.d-contrib-av {
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--navy); background-size: cover; background-position: center;
  color: var(--gold); display: grid; place-items: center;
  font-size: 20px; font-weight: 900; margin-block-end: 4px;
}
.d-contrib-c b { font-size: 12.5px; font-weight: 800; color: var(--strong); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.d-contrib-c em { font-style: normal; font-size: 11px; color: var(--muted); }

/* ================================================================
   15. SHARIT AL-KHADAMAT
   ================================================================ */

.d-services { background: var(--navy); color: #E9EEF7; margin-block-start: 10px; }
.d-services-in { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding-block: 22px; }
.d-serv {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 6px 16px; min-width: 0;
  border-inline-start: 1px solid #FFFFFF1A;
}
.d-serv:first-child { border-inline-start: 0; }
.d-serv-i { color: var(--gold); flex: none; margin-block-start: 2px; }
.d-serv-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.d-serv-t b { font-size: 13px; font-weight: 800; color: #fff; }
.d-serv-t em { font-style: normal; font-size: 11px; color: #94A2BB; line-height: 1.65; }
.d-serv:hover .d-serv-t b { color: var(--gold); }

/* ================================================================
   16. ADAPTATIF
   ================================================================ */

@media (max-width: 1180px) {
  .d-pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .d-services-in { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; }
}

/* Très grands écrans : la vidéothèque et les محاور respirent au lieu
   de s'étirer démesurément. */
@media (min-width: 1560px) {
  .d-tile { flex: 0 0 186px; height: 208px; }
  .vplayer-compact .vp-list { max-height: 300px; }
}

@media (max-width: 1080px) {
  .dash-row-2c { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 980px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-main { order: 1; }
  .dash-aside { order: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .d-hero-in { max-width: 100%; }
  .d-book { grid-template-columns: minmax(0, 1fr); }
  .d-book-cover { order: -1; }
}

@media (max-width: 860px) {
  /* En-tête : la recherche passe sur sa propre ligne plutôt que d'écraser
     le logo et la zone compte (régression classique du flex sans garde). */
  .hdr8-top { flex-wrap: wrap; gap: 12px; }
  .hdr8-search { order: 3; flex: 1 0 100%; }
  .hdr8-right { margin-inline-start: auto; }
  .acct8-name { display: none; }

  .hdr8-nav { display: none; }
  .hdr8-nav.open { display: block; }
  .hdr8-nav.open ul { flex-direction: column; padding-block: 6px; }
  .hdr8-nav.open a { padding: 12px 4px; border-bottom: 1px solid var(--border); }
  .hdr8-nav.open li.on a { border-bottom-color: var(--gold); }
  .hdr8-nav .only-mobile { display: block; }
}

@media (max-width: 720px) {
  .dash-aside { grid-template-columns: minmax(0, 1fr); }
  .dash-row-2c { grid-template-columns: minmax(0, 1fr); }
  .d-pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-book-cols { grid-template-columns: minmax(0, 1fr); }
  .d-sch-row,
  .d-contrib-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-services-in { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
  .d-serv { border-inline-start: 0; }
  .d-hero-in { padding: 20px; }
  .d-hero-in h1 { font-size: 21px; }
}

@media (max-width: 420px) {
  .d-pillars { grid-template-columns: minmax(0, 1fr); }
  .d-hero-cta .btn { flex: 1 1 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .d-rail-track { scroll-behavior: auto; }
  .d-pillar { transition: none; }
}


/* ================================================================
   17. LECTEUR VIDÉO INTÉGRÉ — v8.1
   ----------------------------------------------------------------
   Aucune iframe n'est posée au chargement : uniquement l'affiche.
   Le lecteur n'apparaît qu'au clic, en autoplay, sur place.
   ================================================================ */

.vplayer { display: grid; gap: 12px; }
.vplayer { grid-template-columns: minmax(0, 1fr) 268px; grid-template-areas: "stage list" "now list"; }
.vp-stage { grid-area: stage; }
.vp-now   { grid-area: now; }
.vp-list  { grid-area: list; }

.vplayer-compact { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "now" "list"; }

.vp-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: var(--navy-deep);
}
.vp-stage iframe,
.vp-stage video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; display: block;
  background: #000;
}

.vp-poster {
  position: absolute; inset: 0;
  background: var(--navy) center/cover no-repeat;
  display: grid; place-items: center;
  cursor: pointer;
}
.vp-poster::after { content: ""; position: absolute; inset: 0; background: #0B12204D; }
.vp-play {
  position: relative; z-index: 2;
  width: 76px; height: 76px;
  border-radius: 50%; border: 0;
  background: color-mix(in srgb, var(--gold) 92%, transparent);
  color: #231B02;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 30px #0B122070;
  transition: transform .16s;
}
.vp-poster:hover .vp-play { transform: scale(1.07); }

.vp-now { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vp-now b { font-size: 14.5px; font-weight: 800; color: var(--strong); line-height: 1.5; }
.vp-now em { font-style: normal; font-size: 12px; color: var(--muted); }

.vp-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 380px; overflow-y: auto;
  scrollbar-width: thin;
  padding-inline-end: 4px;
}
.vplayer-compact .vp-list { max-height: 232px; }

.vp-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-width: 0;
  padding: 6px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--text);
  font-family: inherit; text-align: start; cursor: pointer;
  transition: .15s;
}
.vp-item:hover { background: color-mix(in srgb, var(--gold) 9%, transparent); }
.vp-item.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }

.vp-th {
  width: 68px; height: 44px; flex: none;
  border-radius: 7px; overflow: hidden;
  background: var(--navy) center/cover no-repeat;
  color: #FFFFFFD9;
  display: grid; place-items: center;
}
.vp-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vp-tx b {
  font-size: 12.5px; font-weight: 700; line-height: 1.45; color: var(--strong);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.vp-tx em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.vp-item.on .vp-tx b { color: var(--gold); }

/* ---- Page /webtv ---- */

.webtv-page { padding-block: 26px 44px; }
.webtv-lead { color: var(--muted); max-width: 70ch; margin-block: -4px 6px; font-size: 14px; }
.webtv-count { margin-inline-start: auto; color: var(--muted); font-size: 13px; }
.webtv-page .vplayer { margin-block-start: 18px; }
.webtv-page .vp-list { max-height: min(58vh, 520px); }

/* ================================================================
   18. « تمّت القراءة » sous l'article — v8.1
   ================================================================ */

.read-mark {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-block-start: 30px; padding: 18px 20px;
  border: 1px solid var(--border); border-radius: 14px;
  background: color-mix(in srgb, var(--gold) 7%, var(--surface));
}
.read-mark .btn { flex: none; }
.read-mark-note { font-size: 13px; color: var(--muted); }
.read-mark-note b { color: var(--gold); font-weight: 900; }
.read-mark-guest { justify-content: space-between; }
.read-mark-guest p { font-size: 13.5px; color: var(--text); margin: 0; flex: 1 1 220px; min-width: 0; }

@media (max-width: 1024px) {
  .vplayer { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "now" "list"; }
  .vp-list { max-height: 260px; }
}

@media (max-width: 520px) {
  .read-mark { flex-direction: column; align-items: stretch; }
  .read-mark .btn { justify-content: center; }
  .vp-play { width: 60px; height: 60px; }
}


/* ================================================================
   19. NEWSLETTER EN PIED DE PAGE — v8.3
   Sortie du rail latéral : elle y comprimait tout le reste pour deux
   champs. En bande pleine largeur, le formulaire respire.
   ================================================================ */

.dash-bottom { padding-block: 0 22px; }

.d-news-bottom {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 22px 26px;
}
.d-news-bottom .d-news-head { flex: 1 1 280px; min-width: 240px; }
.d-news-bottom .d-h { font-size: 17px; }
.d-news-bottom p { margin-block: 4px 0; }
.d-news-bottom .d-news-form { flex: 2 1 380px; min-width: 280px; margin: 0; }

@media (max-width: 720px) {
  .d-news-bottom { padding: 18px; }
  .d-news-bottom .d-news-form { flex: 1 1 100%; }
}


/* ================================================================
   20. LIVRE D'OR — correctifs de mise en page (v8.4)
   ----------------------------------------------------------------
   Correctifs portés ici, jamais dans v7.css : le module d'origine
   reste intact et le retour arrière se fait en désactivant v8.
   ================================================================ */

/* Avec `auto-fill`, un avis unique restait une carte de 280 px perdue dans
   une rangée de 1240 px. `auto-fit` + plafond + centrage : la grille reste
   lisible de un à douze avis. */
.gb-grid {
  grid-template-columns: repeat(auto-fit, minmax(290px, 400px));
  justify-content: center;
}

.gbook .arts-head { align-items: center; gap: 14px; flex-wrap: wrap; }
.gbook .arts-head .gb-open { flex: none; }

/* Le texte long ne doit pas étirer la carte au-delà de ses voisines. */
.gb-card { min-width: 0; }
.gb-text { overflow-wrap: anywhere; }

/* Formulaire : les six champs de réseaux tenaient sur deux colonnes même
   à l'étroit dans une colonne d'article. */
@media (max-width: 900px) {
  .gb-form .f-nets { grid-template-columns: 1fr; }
}

/* ================================================================
   21. BLOC DE L'العضو DANS LA COLONNE — v8.4
   Les cartes de la لوحة sont réutilisées telles quelles dans
   .side-stack : il faut seulement neutraliser les marges propres
   à la grille de la لوحة.
   ================================================================ */

.side-stack .d-card { margin: 0; }
.side-stack .dash-goal,
.side-stack .d-activity,
.side-stack .d-reviews { width: 100%; }

/* ================================================================
   22. PAGES VIDÉO — deux lecteurs empilés
   ================================================================ */

.webtv-sec { margin-block-start: 30px; }
.webtv-sec:first-of-type { margin-block-start: 18px; }

.v6-head-sm h3 { font-size: 19px; font-weight: 900; color: var(--strong); margin: 0; }
.v6-head-sm h3 b { color: var(--gold); }
.v6-head-sm { display: flex; align-items: baseline; gap: 10px; margin-block-end: 10px; }

.refs-videos { margin-block: 22px 30px; }


/* ================================================================
   23. LIENS SOUS LE LECTEUR + SOUMISSION DE VIDÉOS — v8.5
   ================================================================ */

.vp-links { display: flex; gap: 14px; flex-wrap: wrap; margin-block-start: 6px; }
.vp-links a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.vp-links a:hover { color: var(--gold); }
.vp-links .vp-yt:hover { color: #C4302B; }
.vp-links a[hidden] { display: none; }

/* Le lecteur de l'extension et le nôtre se suivent : un peu d'air entre eux. */
.webtv-page .bwtv { margin-block-end: 8px; }

.vsub { margin-block-start: 8px; }
.vsub .arts-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.vsub .arts-head h3 { font-size: 19px; font-weight: 900; color: var(--strong); margin: 0; }
.vsub .eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: 1px; color: var(--gold); }

/* Même mécanique que le livre d'or : 0fr → 1fr anime une hauteur inconnue. */
.vsub-wrap {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .3s ease;
}
.vsub-wrap.open { grid-template-rows: 1fr; }
.vsub-wrap > form { overflow: hidden; min-height: 0; }
.vsub-wrap.open > form { margin-block-start: 18px; }

.vsub select {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 14px;
}
.vsub select:focus { outline: none; border-color: var(--gold); }


/* ================================================================
   24. CORRECTIFS DE CONTRASTE — v8.6
   ----------------------------------------------------------------
   `.acct-head a` et `.arts-head a` colorent tous leurs liens en doré
   (spécificité 0,1,1). Un bouton `.btn-gold` (0,1,0) placé dans ces
   en-têtes perdait donc sa couleur de texte et s'affichait doré sur
   doré — le libellé « مقالة جديدة + » devenait illisible.
   On ne touche pas aux feuilles d'origine : on restitue ici la
   couleur du bouton, à spécificité égale et sans !important.
   ================================================================ */

.acct-head a.btn-gold,
.arts-head a.btn-gold,
.v6-head a.btn-gold,
.d-top a.btn-gold {
  color: #231B02;
  font-weight: 800;
}
.acct-head a.btn-gold:hover,
.arts-head a.btn-gold:hover,
.v6-head a.btn-gold:hover,
.d-top a.btn-gold:hover { color: #231B02; }

/* Le bouton clair du même en-tête souffrait du même écrasement. */
.acct-head a.btn-navy,
.arts-head a.btn-navy { color: #fff; }


/* ================================================================
   25. ACADÉMIE DANS LA COLONNE — v8.7.2
   La carte de l'extension apporte ses propres styles ; on ne fait
   ici que l'espacer et l'empêcher de déborder d'un rail étroit.
   ================================================================ */

.acad-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.acad-side > * { margin: 0; }
.side-stack .acad-side,
.side-stack .baraheen-academie { max-width: 100%; }
.side-stack .baraheen-academie-fiche { padding: 16px; }
.side-stack .baraheen-academie-certcard { padding: 16px; }


/* ================================================================
   26. QOUAIM AT-TACHGHIL — v8.8
   Une قائمة par bloc, avec son propre lecteur. Empilées, elles ont
   besoin d'une séparation nette pour qu'on ne confonde pas la liste
   de l'une avec le lecteur de l'autre.
   ================================================================ */

.webtv-playlist {
  margin-block-start: 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.webtv-playlist:first-of-type { margin-block-start: 12px; }

.webtv-playlist__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-block-end: 4px;
}
.webtv-playlist__head h4 {
  margin: 0; font-size: 16px; font-weight: 800; color: var(--strong);
  min-width: 0; overflow-wrap: anywhere;
}
.webtv-playlist__desc {
  margin: 0 0 12px; font-size: 13px; color: var(--muted); max-width: 70ch;
}
.webtv-playlist .vplayer { margin-block-start: 12px; }

/* Sur une page qui empile plusieurs lecteurs, chacun garde une liste
   courte : sinon la page devient une colonne de vignettes sans fin. */
.webtv-playlist .vp-list { max-height: 300px; }

@media (max-width: 720px) {
  .webtv-playlist { padding: 14px; }
  .webtv-playlist .vp-list { max-height: 240px; }
}


/* ================================================================
   26. PIED D'ARTICLE — trois actions (v8.9)
   ----------------------------------------------------------------
   « نشاطك الأخير » comptait quatre gestes, mais l'article n'en
   proposait qu'un (تمّت القراءة). Les trois autres restaient à
   zéro faute d'un endroit où les poser.
   ================================================================ */

.read-mark-row { display: flex; gap: 10px; flex-wrap: wrap; }
.read-mark-row .btn { flex: none; }
.read-mark-row .btn-line.is-on {
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  border-color: var(--gold); color: var(--gold-d, var(--gold));
}

@media (max-width: 560px) {
  .read-mark-row { width: 100%; }
  .read-mark-row .btn { flex: 1 1 auto; justify-content: center; }
}

/* ================================================================
   27. PAGE «نشاطي» — statistiques complètes (v8.9)
   ================================================================ */

.acct-activity { max-width: 760px; margin-inline: auto; padding-block: 10px 30px; }
.acct-activity h1 { font-size: 22px; font-weight: 900; margin: 0; }
.acct-activity-lead { color: var(--muted); font-size: 14.5px; margin-block: 4px 18px; }
.acct-activity-lead b { color: var(--gold); font-weight: 900; }

.acct-activity-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  list-style: none; margin: 0 0 26px; padding: 0;
}
.acct-activity-stats li {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px; text-align: center;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.acct-activity-stats b { font-size: 22px; font-weight: 900; color: var(--strong); }
.acct-activity-stats span { font-size: 12px; color: var(--muted); }

.acct-activity-sec { margin-block-start: 26px; }
.acct-activity-sec h2 { font-size: 15px; font-weight: 800; margin: 0 0 10px; color: var(--strong); }

.acct-activity-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.acct-activity-log li {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 10px; background: var(--soft, color-mix(in srgb, var(--gold) 5%, transparent));
  font-size: 13px;
}
.acct-activity-log__t { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.acct-activity-log__v { font-weight: 700; }
.acct-activity-log a { color: var(--gold-d, var(--gold)); }

@media (max-width: 560px) {
  .acct-activity-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ================================================================
   28. ACCÈS À L'ACADÉMIE DEPUIS LA COLONNE — v8.11
   La carte des étoiles montrait la progression sans dire où la
   poursuivre. Le bouton comble ce trou.
   ================================================================ */

.acad-side__cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-block-start: 2px;
}
.acad-side__cta .i { flex: none; }
.acad-side__hint {
  margin: 6px 0 0; font-size: 12px; color: var(--muted); text-align: center;
}

/* L'entrée « أكاديمية البراهين » du raccourci mérite d'être repérable :
   c'est un parcours, pas une rubrique de lecture de plus. */
.d-quick-list a[href*="academie"] { font-weight: 800; }
.d-quick-list a[href*="academie"] .i { color: var(--gold); }
