/* ===================== صفحة الإقليم: الخريطة التفاعلية للجماعات ===================== */
.rg-carte{
  background:var(--blanc);border:1px solid var(--bordure);border-radius:calc(var(--rayon) + 4px);
  box-shadow:var(--ombre-douce);padding:30px 32px 34px;
}
.rg-entete{margin-bottom:18px}
.rg-eyebrow{
  display:inline-block;font-size:.78rem;font-weight:800;color:var(--orange);
  background:var(--orange-clair);border-radius:99px;padding:3px 12px;margin-bottom:10px;
}
.rg-entete h2{font-size:1.7rem;color:var(--bleu-fonce);font-weight:800;line-height:1.5}
.rg-entete p{color:var(--gris);margin-top:4px}

/* أزرار المؤشر */
.rg-onglets{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:22px}
.rg-onglets button{
  border:1px solid var(--bordure);background:var(--gris-clair);color:var(--gris-fonce);
  padding:9px 20px;border-radius:999px;font-family:inherit;font-weight:700;font-size:.9rem;cursor:pointer;
  transition:background .2s,color .2s,border-color .2s,box-shadow .2s;
}
.rg-onglets button:hover{border-color:var(--bleu);color:var(--bleu)}
.rg-onglets button[aria-pressed="true"]{
  background:linear-gradient(135deg,#f6a04d,var(--orange) 55%,#d96a10);border-color:var(--orange);color:#fff;
  box-shadow:0 8px 18px rgba(232,121,26,.32);
}

.rg-grille{display:grid;grid-template-columns:360px 1fr;gap:26px;align-items:start}

/* لوحة الأرقام */
.rg-panneau{
  position:sticky;top:96px;overflow:hidden;
  background:linear-gradient(180deg,#f6f9fe,#eef4fc);border:1px solid #dfe8f5;border-radius:var(--rayon);
  padding:26px 22px 20px;
}
.rg-panneau::before{
  content:"";position:absolute;top:0;right:0;left:0;height:5px;
  background:linear-gradient(90deg,var(--bleu),var(--orange));
}
.rg-panneau h3{font-size:1.35rem;color:var(--bleu-fonce);font-weight:800;line-height:1.4}
.rg-fr{color:var(--gris);font-size:.85rem;margin:2px 0 14px;direction:ltr;text-align:right}
.rg-cercle{
  display:inline-block;background:var(--bleu-clair);color:var(--bleu-fonce);font-size:.75rem;font-weight:800;
  border-radius:99px;padding:2px 12px;margin:0 0 12px;
}
.rg-metriques{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.rg-met{background:#fff;border:1px solid #e3eaf5;border-radius:14px;padding:12px 14px}
.rg-met span{display:block;font-size:.76rem;color:var(--gris);font-weight:700}
.rg-met strong{display:block;font-size:1.25rem;color:var(--bleu-fonce);font-weight:800;line-height:1.35;font-variant-numeric:tabular-nums}
.rg-met strong em{font-style:normal;font-size:.72rem;color:var(--gris);font-weight:700}
.rg-met.orange strong{color:#b85a0c}
.rg-urbain{margin-top:16px}
.rg-urbain-barre{height:11px;border-radius:99px;background:var(--orange);overflow:hidden}
.rg-urbain-barre i{display:block;height:100%;background:var(--bleu);border-radius:0 99px 99px 0}
.rg-urbain-lib{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:8px;font-size:.78rem;color:var(--gris)}
.rg-urbain-lib b{display:inline-block;width:10px;height:10px;border-radius:50%;background:var(--bleu);margin-inline-end:5px}
.rg-urbain-lib b.rural{background:var(--orange)}
.rg-invite{margin-top:16px;font-size:.85rem;color:var(--gris);line-height:1.8}
.rg-retour{
  border:0;background:transparent;color:var(--bleu);font-family:inherit;font-weight:800;font-size:.85rem;
  cursor:pointer;padding:0;margin-bottom:12px;
}
.rg-retour:hover{color:var(--bleu-fonce)}
.rg-rang-badge{
  display:inline-flex;align-items:center;gap:6px;font-size:.78rem;font-weight:800;color:#a0530f;
  background:var(--orange-clair);border-radius:99px;padding:3px 12px;margin-inline-start:6px;
}
.rg-note{
  margin-top:14px;font-size:.8rem;line-height:1.85;color:#6b4a14;background:#fff8e8;border:1px solid #f4e2b8;
  border-radius:12px;padding:10px 12px;
}
.rg-centre{margin-top:12px;font-size:.84rem;color:var(--gris-fonce)}
.rg-centre b{color:var(--bleu-fonce)}

/* الخريطة */
.rg-zone{min-width:0}
.rg-boite{
  position:relative;border-radius:var(--rayon);overflow:hidden;border:1px solid #dfe8f5;
  background:radial-gradient(120% 90% at 50% 0%,#f4f8fe,#e7eff9);
}
.rg-boite svg{display:block;width:100%;height:auto;max-height:82vh;margin-inline:auto;touch-action:pan-y;user-select:none;-webkit-user-select:none}
.rg-boite svg.zoome{touch-action:none;cursor:grab}
.rg-boite svg.zoome.glisse{cursor:grabbing}
.rg-c{
  stroke:#fff;stroke-width:1.2px;vector-effect:non-scaling-stroke;cursor:pointer;outline:none;
  transition:fill .35s ease,stroke .15s ease;
}
/* بما أن الفئات العليا برتقالية، يكون إبراز الجماعة (المرور/الاختيار) بالأزرق الداكن ليظل واضحا */
.rg-c:hover,.rg-c:focus-visible{stroke:#0a2a57;stroke-width:2.4px}
.rg-c.actif{stroke:#0a2a57;stroke-width:3.4px}
.rg-pt{cursor:pointer;outline:none}
.rg-pt circle{stroke:#fff;stroke-width:2px;vector-effect:non-scaling-stroke;transition:fill .35s ease}
.rg-pt:hover circle,.rg-pt:focus-visible circle,.rg-pt.actif circle{stroke:#0a2a57;stroke-width:3px}
.rg-lbl{
  font-family:var(--police);font-weight:800;fill:#0b2a55;text-anchor:middle;pointer-events:none;
  paint-order:stroke;stroke:rgba(255,255,255,.9);stroke-linejoin:round;
}
.rg-lbl.sombre{fill:#fff;stroke:rgba(10,42,87,.65)}
.rg-zoom{position:absolute;top:12px;left:12px;display:flex;flex-direction:column;gap:6px}
.rg-zoom button{
  width:38px;height:38px;border-radius:10px;border:1px solid #d3dded;background:rgba(255,255,255,.95);
  color:var(--bleu-fonce);font-size:1.25rem;font-weight:800;line-height:1;cursor:pointer;font-family:inherit;
  box-shadow:0 4px 12px rgba(13,61,122,.12);transition:background .2s,color .2s;
}
.rg-zoom button:hover{background:var(--bleu);color:#fff;border-color:var(--bleu)}
.rg-tip{
  position:absolute;z-index:5;pointer-events:none;background:var(--marine);color:#fff;border-radius:10px;
  padding:8px 12px;font-size:.8rem;line-height:1.7;box-shadow:0 10px 24px rgba(0,0,0,.25);white-space:nowrap;
}
.rg-tip strong{display:block;font-size:.88rem}
.rg-astuce{
  position:absolute;right:50%;bottom:14px;transform:translateX(50%);background:rgba(10,42,87,.88);color:#fff;
  font-size:.78rem;border-radius:99px;padding:6px 16px;pointer-events:none;white-space:nowrap;
}
.rg-noscript{padding:30px;text-align:center;color:var(--gris)}

/* المفتاح */
.rg-legende{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin-top:14px}
.rg-leg-titre{font-size:.8rem;font-weight:800;color:var(--gris-fonce);width:100%}
.rg-leg-sens{font-weight:700;color:var(--gris);font-size:.74rem;margin-inline-start:8px}
.rg-leg-sens::before{content:"";display:inline-block;width:36px;height:8px;border-radius:99px;margin-inline-end:8px;vertical-align:middle;background:linear-gradient(90deg,#1b5fb5,#9cc2ef,#efe6d8,#f7ad6b,#d9620c)}
.rg-leg-item{display:inline-flex;align-items:center;gap:7px;font-size:.78rem;color:var(--gris);font-variant-numeric:tabular-nums}
.rg-leg-item i{width:20px;height:12px;border-radius:4px;border:1px solid rgba(0,0,0,.08)}
.rg-source-courte{margin-top:10px;font-size:.74rem;color:var(--gris)}

/* لائحة الجماعات */
.rg-liste{
  list-style:none;display:grid;grid-template-columns:repeat(2,1fr);gap:8px 26px;max-width:980px;margin:0 auto;
}
.rg-ligne{
  width:100%;display:grid;grid-template-columns:30px minmax(110px,160px) 1fr auto;align-items:center;gap:12px;
  background:var(--blanc);border:1px solid var(--bordure);border-radius:14px;padding:10px 14px;cursor:pointer;
  font-family:inherit;text-align:right;transition:border-color .2s,box-shadow .2s,transform .2s;
}
.rg-ligne:hover{border-color:var(--bleu);box-shadow:var(--ombre-douce);transform:translateY(-1px)}
li.actif .rg-ligne{border-color:var(--orange);box-shadow:0 6px 18px rgba(232,121,26,.18)}
.rg-rang{
  width:26px;height:26px;border-radius:8px;background:var(--bleu-clair);color:var(--bleu-fonce);
  display:grid;place-items:center;font-size:.74rem;font-weight:800;
}
.rg-liste li:first-child .rg-rang{background:var(--orange);color:#fff}
.rg-nom{font-weight:800;color:var(--gris-fonce);font-size:.92rem}
.rg-barre{height:8px;border-radius:99px;background:var(--bleu-clair);overflow:hidden}
.rg-barre i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,var(--bleu),var(--orange));transition:width .4s ease}
.rg-val{font-weight:800;color:var(--bleu);font-size:.88rem;font-variant-numeric:tabular-nums;min-width:62px;text-align:left}

/* المصادر */
.rg-sources{max-width:900px;margin:0 auto;background:var(--gris-clair);border:1px solid var(--bordure);border-radius:var(--rayon);padding:24px 28px}
.rg-sources h2{font-size:1.15rem;color:var(--bleu-fonce);margin-bottom:12px}
.rg-sources ul{list-style:none;display:flex;flex-direction:column;gap:10px}
.rg-sources li{font-size:.86rem;line-height:1.95;color:var(--gris)}
.rg-sources li strong{color:var(--gris-fonce)}
.rg-sources a{color:var(--bleu);font-weight:700;text-decoration:underline;text-underline-offset:3px}

@media (max-width:980px){
  .rg-grille{grid-template-columns:1fr}
  .rg-zone{order:-1}
  .rg-panneau{position:static}
  .rg-liste{grid-template-columns:1fr}
}
@media (max-width:640px){
  .rg-carte{padding:20px 14px 24px}
  .rg-entete h2{font-size:1.35rem}
  .rg-onglets{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;margin-inline:-4px;padding-inline:4px}
  .rg-onglets button{white-space:nowrap;padding:8px 16px}
  .rg-metriques{grid-template-columns:1fr 1fr}
  .rg-ligne{grid-template-columns:26px 1fr auto;gap:10px}
  .rg-ligne .rg-barre{display:none}
  .rg-sources{padding:18px 16px}
}
@media (prefers-reduced-motion:reduce){.rg-c,.rg-pt circle,.rg-barre i{transition:none}}
