/* ==========================================================================
   MarocPsy : Portail Juridique & Pratique des Travailleurs Sociaux au Maroc
   Routes : /travailleur-social et /travailleur-social/{slug}
   Identité visuelle : Indigo-Bleu #2b59c3, Teal #194685, Ink #12233f, Surfaces douces.
   ========================================================================== */

/* ---------- 0. CONTENEUR GLOBAL ---------- */
.sw-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px 56px;
  box-sizing: border-box;
}

/* ---------- 1. FIL D'ARIANE ---------- */
.sw-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--mp-ink-soft, #43536b);
  margin-bottom: 16px;
}
.sw-breadcrumb a {
  color: var(--mp-primary, #2b59c3);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}
.sw-breadcrumb a:hover {
  color: #1f449c;
  text-decoration: underline;
}
.sw-breadcrumb-sep {
  font-size: 0.72rem;
  color: #94a3b8;
}
html[dir="rtl"] .sw-breadcrumb-sep i {
  transform: scaleX(-1);
}
.sw-breadcrumb-current {
  color: var(--mp-ink, #12233f);
  font-weight: 600;
}
.sw-breadcrumb-short,
.sw-mobile-directory {
  display: none;
}
.sw-detail-header-top > *,
.sw-subsite-bar > * {
  min-width: 0;
}

/* ---------- 2. HERO DU PORTAIL & SÉLECTEUR DE LANGUE ---------- */
.sw-hero {
  background: linear-gradient(145deg, #ffffff 0%, #f4f8ff 100%);
  border: 1px solid #d5e2f6;
  border-radius: 20px;
  padding: 28px 30px;
  margin-bottom: 28px;
  box-shadow: 0 8px 28px rgba(18, 35, 63, 0.05);
}
.sw-hero-top,
.sw-detail-header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.sw-hero-badges,
.sw-detail-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.sw-kicker-pill,
.sw-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  background: #ebf2ff;
  color: var(--mp-primary, #2b59c3);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #c7dcf9;
}
.sw-type-pill:hover {
  background: #dce8ff;
}
.sw-edition-pill,
.sw-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f0fdf4;
  color: #047857;
  border: 1px solid #bbf7d0;
  font-size: 0.8rem;
  font-weight: 700;
}
.sw-lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #f1f5f9;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
}
.sw-lang-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mp-ink-soft, #43536b);
  text-decoration: none;
  transition: all 0.15s ease;
}
.sw-lang-pill:hover {
  color: var(--mp-primary, #2b59c3);
}
.sw-lang-pill.is-active {
  background: var(--mp-primary, #2b59c3);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(43, 89, 195, 0.25);
}

.sw-hero h1,
.sw-detail-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--mp-ink, #12233f);
  line-height: 1.28;
  margin: 0 0 12px;
}
.sw-hero-lead,
.sw-detail-lead {
  font-size: 1.03rem;
  color: var(--mp-ink-soft, #43536b);
  line-height: 1.65;
  margin: 0 0 22px;
  max-width: 960px;
}

/* Chiffres clés dans le Hero */
.sw-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.sw-stat-card {
  background: #ffffff;
  border: 1px solid #dce6f5;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(18, 35, 63, 0.03);
}
.sw-stat-num {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--mp-primary, #2b59c3);
  line-height: 1.1;
}
.sw-stat-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--mp-ink-soft, #43536b);
}

/* Recherche & Pastilles de rubriques */
.sw-search-panel {
  background: #ffffff;
  border: 1px solid #d5e2f6;
  border-radius: 16px;
  padding: 16px 18px;
}
.sw-search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.sw-search-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.sw-search-icon {
  position: absolute;
  inset-inline-start: 14px;
  color: #64748b;
  font-size: 0.95rem;
  pointer-events: none;
}
.sw-search-input-wrap input[type="search"] {
  width: 100%;
  padding: 11px 38px 11px 40px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 0.95rem;
  color: var(--mp-ink, #12233f);
  background: #f8fafc;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
html[dir="rtl"] .sw-search-input-wrap input[type="search"] {
  padding: 11px 40px 11px 38px;
}
.sw-search-input-wrap input[type="search"]:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--mp-primary, #2b59c3);
  box-shadow: 0 0 0 3px rgba(43, 89, 195, 0.12);
}
.sw-search-clear {
  position: absolute;
  inset-inline-end: 12px;
  color: #64748b;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 4px;
}
.sw-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sw-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #d7e0ee;
  color: var(--mp-ink, #12233f);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.18s ease;
}
.sw-cat-pill:hover {
  border-color: var(--mp-primary, #2b59c3);
  color: var(--mp-primary, #2b59c3);
  background: #f0f6ff;
}
.sw-cat-pill.is-active {
  background: var(--mp-primary, #2b59c3);
  border-color: var(--mp-primary, #2b59c3);
  color: #ffffff;
}
.sw-cat-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(18, 35, 63, 0.08);
  color: inherit;
}
.sw-cat-pill.is-active .sw-cat-count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* ---------- 3. BANNIÈRE DES 4 OUTILS INTERACTIFS ---------- */
.sw-tools-banner {
  margin-bottom: 32px;
}
.sw-section-header {
  margin-bottom: 16px;
}
.sw-section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mp-primary, #2b59c3);
  margin-bottom: 4px;
}
.sw-section-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--mp-ink, #12233f);
  margin: 0;
}
.sw-tools-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.sw-tool-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #ffffff 0%, #f5f9ff 100%);
  border: 1px solid #c7dcf9;
  border-radius: 16px;
  padding: 18px;
  text-decoration: none;
  color: var(--mp-ink, #12233f);
  box-shadow: 0 4px 14px rgba(43, 89, 195, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.sw-tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--mp-primary, #2b59c3);
  box-shadow: 0 10px 24px rgba(43, 89, 195, 0.12);
}
.sw-tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.sw-tool-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--mp-primary, #2b59c3);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}
.sw-tool-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e0ecff;
  color: #1d4ed8;
}
.sw-tool-card h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--mp-ink, #12233f);
  margin: 0 0 8px;
  line-height: 1.35;
}
.sw-tool-card p {
  font-size: 0.85rem;
  color: var(--mp-ink-soft, #43536b);
  line-height: 1.5;
  margin: 0 0 14px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sw-tool-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--mp-primary, #2b59c3);
}

/* ---------- 4. GRILLE PRINCIPALE + SIDEBAR ---------- */
.sw-main-layout,
.sw-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
  align-items: start;
}
.sw-main-layout > *,
.sw-detail-layout > * {
  min-width: 0;
}

/* Blocs de rubriques sur le Hub */
.sw-category-block {
  margin-bottom: 34px;
}
.sw-category-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.sw-category-title-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.sw-category-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ebf2ff;
  color: var(--mp-primary, #2b59c3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.sw-category-title-row h2 {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--mp-ink, #12233f);
  margin: 0 0 4px;
}
.sw-category-title-row p {
  font-size: 0.9rem;
  color: var(--mp-ink-soft, #43536b);
  margin: 0;
  line-height: 1.5;
}

.sw-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.sw-page-card {
  background: #ffffff;
  border: 1px solid #d7e0ee;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(18, 35, 63, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.sw-page-card:hover {
  transform: translateY(-2px);
  border-color: #9ec0f7;
  box-shadow: 0 8px 22px rgba(18, 35, 63, 0.08);
}
.sw-page-card-tool {
  border-color: #b9d5fb;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.sw-page-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.sw-page-num-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f0f6ff;
  color: var(--mp-primary, #2b59c3);
}
.sw-page-time {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
}
.sw-page-card-title {
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.38;
  margin: 0 0 8px;
}
.sw-page-card-title a {
  color: var(--mp-ink, #12233f);
  text-decoration: none;
}
.sw-page-card-title a:hover {
  color: var(--mp-primary, #2b59c3);
}
.sw-page-card-summary {
  font-size: 0.9rem;
  color: var(--mp-ink-soft, #43536b);
  line-height: 1.55;
  margin: 0 0 12px;
  flex: 1;
}
.sw-page-card-toc {
  list-style: none;
  padding: 10px 12px;
  margin: 0 0 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.82rem;
}
.sw-page-card-toc li + li {
  margin-top: 6px;
}
.sw-page-card-toc a {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #334155;
  text-decoration: none;
  line-height: 1.35;
}
.sw-page-card-toc a:hover {
  color: var(--mp-primary, #2b59c3);
}
.sw-page-card-toc i {
  font-size: 0.7rem;
  color: var(--mp-primary, #2b59c3);
  flex-shrink: 0;
}
html[dir="rtl"] .sw-page-card-toc i {
  transform: scaleX(-1);
}
.sw-page-card-footer {
  padding-top: 10px;
  border-top: 1px solid #edf2f7;
}
.sw-page-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--mp-primary, #2b59c3);
  text-decoration: none;
}
.sw-page-card-link:hover {
  text-decoration: underline;
}

/* Repères réglementaires essentiels */
.sw-benchmarks-section {
  background: #ffffff;
  border: 1px solid #d5e2f6;
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: 0 4px 16px rgba(18, 35, 63, 0.04);
}
.sw-benchmarks-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.sw-benchmarks-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #ebf2ff;
  color: var(--mp-primary, #2b59c3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.sw-benchmarks-header h2 {
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--mp-ink, #12233f);
  margin: 0;
}
.sw-benchmarks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.sw-benchmark-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.sw-benchmark-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #ffffff;
  color: var(--mp-primary, #2b59c3);
  border: 1px solid #dbe6f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.92rem;
}
.sw-benchmark-body strong {
  display: block;
  font-size: 0.88rem;
  color: var(--mp-ink, #12233f);
  margin-bottom: 3px;
}
.sw-benchmark-body p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--mp-ink-soft, #43536b);
  line-height: 1.5;
}
.sw-benchmark-body a {
  color: var(--mp-primary, #2b59c3);
  font-weight: 700;
}

/* ---------- 5. PAGE DE DÉTAIL D'UN DOSSIER (show.php) ---------- */
.sw-subsite-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #d7e0ee;
  border-radius: 14px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(18, 35, 63, 0.03);
}
.sw-subsite-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sw-subsite-home {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--mp-primary, #2b59c3);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  background: #f0f6ff;
}
.sw-subsite-home:hover {
  background: #e0ecff;
}
.sw-subsite-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sw-subsite-cat-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mp-ink-soft, #43536b);
  text-decoration: none;
  transition: all 0.15s ease;
}
.sw-subsite-cat-link:hover {
  background: #f1f5f9;
  color: var(--mp-ink, #12233f);
}
.sw-subsite-cat-link.is-active {
  background: #ebf2ff;
  color: var(--mp-primary, #2b59c3);
  font-weight: 700;
}
.sw-print-btn,
.sw-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--mp-ink, #12233f);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sw-print-btn:hover,
.sw-share-btn:hover {
  border-color: var(--mp-primary, #2b59c3);
  color: var(--mp-primary, #2b59c3);
  background: #f8fafc;
}

.sw-detail-header {
  background: linear-gradient(145deg, #ffffff 0%, #f4f8ff 100%);
  border: 1px solid #d5e2f6;
  border-radius: 20px;
  padding: 26px 28px;
  margin-bottom: 24px;
  box-shadow: 0 6px 22px rgba(18, 35, 63, 0.04);
}
.sw-detail-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}
.sw-detail-meta-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.sw-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mp-ink-soft, #43536b);
}
.sw-meta-item i {
  color: var(--mp-primary, #2b59c3);
}

/* Sommaire interne (TOC) */
.sw-toc {
  background: #f8fbff;
  border: 1px solid #cde0fb;
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 24px;
}
.sw-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.sw-toc-header h2 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--mp-ink, #12233f);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.sw-toc-header h2 i {
  color: var(--mp-primary, #2b59c3);
}
.sw-toc-count {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e0ecff;
  color: var(--mp-primary, #2b59c3);
}
.sw-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px 16px;
}
.sw-toc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: var(--mp-ink, #12233f);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.15s ease;
}
.sw-toc-link:hover {
  border-color: var(--mp-primary, #2b59c3);
  color: var(--mp-primary, #2b59c3);
  background: #f0f6ff;
}
.sw-toc-num {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #ebf2ff;
  color: var(--mp-primary, #2b59c3);
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---------- 6. PROSE JURIDIQUE, TABLEAUX & BOÎTES D'ALERTE ---------- */
.sw-prose {
  min-width: 0;
  overflow-wrap: anywhere;
  background: #ffffff;
  border: 1px solid #d7e0ee;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 4px 18px rgba(18, 35, 63, 0.04);
  color: var(--mp-ink, #12233f);
  font-size: 0.98rem;
  line-height: 1.7;
}
.sw-prose p {
  margin: 0 0 14px;
}
.sw-prose ul,
.sw-prose ol {
  margin: 0 0 16px;
  padding-inline-start: 22px;
}
.sw-prose li {
  margin-bottom: 8px;
}
.sw-prose a {
  color: var(--mp-primary, #2b59c3);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sw-prose a:hover {
  color: #1f449c;
}
.sw-prose .ar {
  font-family: 'Noto Sans Arabic', 'Plus Jakarta Sans', sans-serif;
}

.sw-section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--mp-ink, #12233f);
  margin: 30px 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e9f0fb;
  scroll-margin-top: 90px;
}
.sw-prose > .sw-section-heading:first-child {
  margin-top: 0;
}
.sw-section-num {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--mp-primary, #2b59c3);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sw-subheading {
  font-size: 1.06rem;
  font-weight: 700;
  color: #194685;
  margin: 20px 0 10px;
}

/* Encadrés juridiques (.box issus du contenu) */
.sw-prose .box {
  background: linear-gradient(135deg, #f4f8ff 0%, #eef5ff 100%);
  border: 1px solid #c7dcf9;
  border-inline-start: 4px solid var(--mp-primary, #2b59c3);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 18px 0;
}
.sw-prose .box h3.sw-subheading {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #dbe7f9;
  color: var(--mp-ink, #12233f);
}
.sw-prose .box h3.sw-subheading:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Tableaux réglementaires responsives */
.sw-prose .table-wrap,
.sw-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0;
  border: 1px solid #d5e1f2;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(18, 35, 63, 0.04);
}
.sw-prose table,
.sw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.6;
  min-width: 640px;
}
#swTable18Categories {
  min-width: 1040px;
  table-layout: fixed;
}
#swTable18Categories th:first-child { width: 10%; }
#swTable18Categories th:nth-child(2) { width: 16%; }
#swTable18Categories th:nth-child(3) { width: 15%; }
#swTable18Categories th:nth-child(4) { width: 15%; }
#swTable18Categories th:nth-child(5) { width: 21%; }
#swTable18Categories th:nth-child(6) { width: 23%; }
.sw-prose th,
.sw-prose td,
.sw-table th,
.sw-table td {
  padding: 13px 15px;
  border-bottom: 1px solid #e2e8f0;
  border-inline-end: 1px solid #edf2f7;
  text-align: start;
  vertical-align: top;
}
.sw-prose th:last-child,
.sw-prose td:last-child,
.sw-table th:last-child,
.sw-table td:last-child {
  border-inline-end: none;
}
.sw-prose thead th,
.sw-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #f0f6ff 0%, #e4effe 100%);
  color: var(--mp-ink, #12233f);
  font-weight: 800;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
  border-bottom: 2px solid #b9d5fb;
}
.sw-prose tbody td:first-child,
.sw-table tbody td:first-child {
  font-weight: 700;
  color: var(--mp-ink, #12233f);
  background: rgba(240, 246, 255, 0.35);
}
.sw-prose tbody tr:nth-child(even),
.sw-table tbody tr:nth-child(even) {
  background: #fafcff;
}
.sw-prose tbody tr:hover,
.sw-table tbody tr:hover {
  background: #f1f7ff;
}

/* ---------- 7. WIDGETS INTERACTIFS (SIMULATEUR, CHECKLIST, MODÈLES, FILTRES) ---------- */
.sw-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 18px;
  background: #f8fbff;
  border: 1px solid #cde0fb;
  border-radius: 14px;
  margin-bottom: 18px;
}
.sw-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1 1 240px;
}
.sw-filter-field-grow {
  flex: 1;
}
.sw-filter-field label,
.sw-sim-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--mp-ink, #12233f);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sw-filter-field label i {
  color: var(--mp-primary, #2b59c3);
}
.sw-select,
.sw-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--mp-ink, #12233f);
  font-size: 0.92rem;
  font-family: inherit;
}
.sw-select-lg {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.96rem;
  font-weight: 600;
}
.sw-select:focus,
.sw-input:focus {
  outline: none;
  border-color: var(--mp-primary, #2b59c3);
  box-shadow: 0 0 0 3px rgba(43, 89, 195, 0.12);
}

.sw-interactive-card {
  background: #f8fbff;
  border: 1px solid #cde0fb;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 24px;
}
.sw-interactive-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.sw-interactive-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--mp-primary, #2b59c3);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.sw-interactive-icon-emerald {
  background: #059669;
}
.sw-interactive-header h2 {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--mp-ink, #12233f);
  margin: 0 0 4px;
}
.sw-interactive-header p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--mp-ink-soft, #43536b);
}
.sw-sim-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.sw-sim-result {
  background: #ffffff;
  border: 1px solid #9ec0f7;
  border-inline-start: 4px solid var(--mp-primary, #2b59c3);
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 0.95rem;
  line-height: 1.65;
}

/* Checklist ICHHAD */
.sw-checklist-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #dbe6f6;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.sw-checklist-progress-wrap {
  flex: 1;
  min-width: 200px;
}
.sw-checklist-progress-wrap strong {
  display: block;
  font-size: 0.88rem;
  color: var(--mp-ink, #12233f);
  margin-bottom: 6px;
}
.sw-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.sw-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2b59c3 0%, #059669 100%);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.sw-checklist-items {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sw-checklist-item {
  background: #ffffff;
  border: 1px solid #d7e0ee;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 !important;
  transition: all 0.15s ease;
}
.sw-checklist-item.is-checked {
  background: #f0fdf4;
  border-color: #86efac;
}
.sw-checklist-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 0.92rem;
}
.sw-chk-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.sw-chk-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #94a3b8;
  background: #ffffff;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.15s ease;
}
.sw-chk-input:checked + .sw-chk-box {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
}

/* Modèles de documents */
.sw-lang-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #f59e0b;
  border-inline-start: 4px solid #d97706;
  border-radius: 14px;
  color: #78350f;
}
.sw-lang-disclaimer-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #ffffff;
  color: #d97706;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.15);
}
.sw-lang-disclaimer-body strong {
  display: block;
  font-size: 0.96rem;
  color: #78350f;
  margin-bottom: 4px;
}
.sw-lang-disclaimer-body p {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #92400e;
}
.sw-lang-disclaimer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.sw-lang-disclaimer-links a {
  text-decoration: none !important;
}

.sw-templates-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.sw-template-card {
  background: #f8fafc;
  border: 1px solid #d5e1f2;
  border-radius: 16px;
  overflow: hidden;
}
.sw-template-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: #f0f6ff;
  border-bottom: 1px solid #cde0fb;
}
.sw-template-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sw-template-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--mp-primary, #2b59c3);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sw-template-header h2 {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--mp-ink, #12233f);
  margin: 0;
}
.sw-template-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sw-copy-status {
  font-size: 0.82rem;
  font-weight: 700;
  color: #047857;
}
.sw-template-pre {
  margin: 0;
  padding: 20px;
  background: #ffffff;
  color: #1e293b;
  font-family: 'Plus Jakarta Sans', 'Noto Sans Arabic', monospace;
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ---------- 8. PAGINATION PRÉCÉDENT / SUIVANT & RUBRIQUES LIÉES ---------- */
.sw-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}
.sw-pager-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  background: #ffffff;
  border: 1px solid #d7e0ee;
  border-radius: 14px;
  text-decoration: none;
  color: var(--mp-ink, #12233f);
  transition: all 0.18s ease;
}
.sw-pager-card:hover {
  border-color: var(--mp-primary, #2b59c3);
  background: #f8fbff;
  transform: translateY(-2px);
}
.sw-pager-next {
  text-align: end;
}
.sw-pager-dir {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mp-primary, #2b59c3);
  text-transform: uppercase;
}
.sw-pager-next .sw-pager-dir {
  justify-content: flex-end;
}
.sw-pager-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--mp-ink, #12233f);
}
.sw-pager-badge {
  font-size: 0.78rem;
  color: #64748b;
}

.sw-related-section,
.sw-related-catalog {
  margin-top: 30px;
  background: #ffffff;
  border: 1px solid #d7e0ee;
  border-radius: 16px;
  padding: 22px;
}
.sw-related-section h2,
.sw-related-catalog h2 {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--mp-ink, #12233f);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sw-related-section h2 i,
.sw-related-catalog h2 i {
  color: var(--mp-primary, #2b59c3);
}
.sw-related-grid,
.sw-related-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.sw-related-card,
.sw-related-spec-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: var(--mp-ink, #12233f);
  transition: all 0.15s ease;
}
.sw-related-card:hover,
.sw-related-spec-card:hover {
  border-color: var(--mp-primary, #2b59c3);
  background: #f0f6ff;
}
.sw-related-badge,
.sw-related-spec-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--mp-primary, #2b59c3);
}
.sw-related-card strong,
.sw-related-spec-card strong {
  font-size: 0.94rem;
  line-height: 1.38;
}
.sw-related-spec-card p {
  font-size: 0.82rem;
  color: var(--mp-ink-soft, #43536b);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sw-related-cta,
.sw-related-spec-more {
  margin-top: auto;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--mp-primary, #2b59c3);
}

/* ---------- 9. SIDEBAR DU MINI-SITE ---------- */
.sw-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 86px;
}
.sw-sidebar-card {
  background: #ffffff;
  border: 1px solid #d7e0ee;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(18, 35, 63, 0.04);
}
.sw-sidebar-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.sw-sidebar-nav-header h3 {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--mp-ink, #12233f);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.sw-sidebar-nav-header h3 i {
  color: var(--mp-primary, #2b59c3);
}
.sw-sidebar-hub-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--mp-primary, #2b59c3);
  text-decoration: none;
}
.sw-sidebar-count {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ebf2ff;
  color: var(--mp-primary, #2b59c3);
}
.sw-sidebar-group + .sw-sidebar-group {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
}
.sw-sidebar-group-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  margin-bottom: 8px;
}
.sw-sidebar-group.is-current-group .sw-sidebar-group-title {
  color: var(--mp-primary, #2b59c3);
}
.sw-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sw-sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--mp-ink, #12233f);
  text-decoration: none;
  transition: all 0.14s ease;
}
.sw-sidebar-link:hover {
  background: #f0f6ff;
  color: var(--mp-primary, #2b59c3);
}
.sw-sidebar-link.is-active {
  background: var(--mp-primary, #2b59c3);
  color: #ffffff;
  font-weight: 700;
}
.sw-sidebar-link-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.73rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sw-sidebar-link.is-active .sw-sidebar-link-num {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
.sw-sidebar-link-text {
  flex: 1;
  line-height: 1.3;
}
.sw-sidebar-tool-dot {
  color: var(--mp-primary, #2b59c3);
  font-size: 0.75rem;
}

.sw-sidebar-official {
  background: linear-gradient(145deg, #f8fbff 0%, #eef5ff 100%);
  border-color: #c7dcf9;
}
.sw-sidebar-official-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e0ecff;
  color: #1d4ed8;
  margin-bottom: 10px;
}
.sw-sidebar-card h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--mp-ink, #12233f);
  margin: 0 0 6px;
}
.sw-sidebar-card p {
  font-size: 0.85rem;
  color: var(--mp-ink-soft, #43536b);
  line-height: 1.5;
  margin: 0 0 14px;
}
.sw-sidebar-quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.sw-sidebar-quiz-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ebf2ff;
  color: var(--mp-primary, #2b59c3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sw-sidebar-quiz-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f0fdf4;
  color: #047857;
}

/* Boutons */
.sw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}
.sw-btn-block {
  width: 100%;
  box-sizing: border-box;
}
.sw-btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
}
.sw-btn-primary {
  background: var(--mp-primary, #2b59c3);
  color: #ffffff;
}
.sw-btn-primary:hover {
  background: #1f449c;
  color: #ffffff;
}
.sw-btn-secondary {
  background: #ebf2ff;
  color: var(--mp-primary, #2b59c3);
  border-color: #c7dcf9;
}
.sw-btn-secondary:hover {
  background: #dce8ff;
}
.sw-btn-outline {
  background: #ffffff;
  color: var(--mp-ink, #12233f);
  border-color: #cbd5e1;
}
.sw-btn-outline:hover {
  border-color: var(--mp-primary, #2b59c3);
  color: var(--mp-primary, #2b59c3);
}

/* État de filtre & vide */
.sw-filter-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: #f0f6ff;
  border: 1px solid #c7dcf9;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.sw-filter-tag {
  font-weight: 700;
  color: var(--mp-primary, #2b59c3);
}
.sw-reset-link {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--mp-primary, #2b59c3);
  text-decoration: none;
}
.sw-empty-state {
  text-align: center;
  padding: 42px 24px;
  background: #ffffff;
  border: 1px solid #d7e0ee;
  border-radius: 16px;
  margin-bottom: 28px;
}
.sw-empty-state i {
  font-size: 2rem;
  color: #94a3b8;
  margin-bottom: 10px;
}

/* ---------- 10. RESPONSIVE, MOBILE & TABLEAUX EN CARTES ---------- */
@media (max-width: 1024px) {
  .sw-main-layout,
  .sw-detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sw-sidebar {
    position: static;
  }
  .sw-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sw-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sw-mobile-directory { display: block; }
  .sw-subsite-top-actions { position: relative; }
  .sw-mobile-directory summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #d7e0ee;
    border-radius: 9px;
    color: #2b59c3;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
  }
  .sw-mobile-directory summary::-webkit-details-marker { display: none; }
  .sw-mobile-directory[open] summary { background: #eef5ff; }
  .sw-mobile-directory[open] summary .fa-chevron-down { transform: rotate(180deg); }
  .sw-mobile-directory-links {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 8px);
    z-index: 10;
    min-width: min(340px, 75vw);
    max-height: 55vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px;
    background: #fff;
    border: 1px solid #d7e0ee;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(18, 35, 63, .12);
  }
  .sw-mobile-directory-links a {
    display: block;
    padding: 10px 12px;
    color: #43536b;
    border-radius: 7px;
    font-size: .86rem;
    line-height: 1.45;
    text-decoration: none;
  }
  .sw-mobile-directory-links a:hover,
  .sw-mobile-directory-links a[aria-current="page"] {
    background: #eef5ff;
    color: #2b59c3;
  }
  /* Le sommaire mobile est accessible dans la navigation en haut de page. */
  .sw-detail-page #swSidebarNav {
    display: none;
  }
}

@media (max-width: 820px) {
  /* Transformation automatique des tableaux en cartes verticales ultra-lisibles sur mobile */
  .sw-prose .table-wrap,
  .sw-table-wrap {
    border: none;
    background: transparent;
    box-shadow: none;
    overflow-x: visible;
  }
  .sw-prose table,
  .sw-table,
  #swTable18Categories {
    display: block;
    width: 100%;
    min-width: 0;
    table-layout: auto;
  }
  .sw-prose thead,
  .sw-table thead {
    display: none;
  }
  .sw-prose tbody,
  .sw-table tbody {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
  }
  .sw-prose tbody tr,
  .sw-table tbody tr {
    display: block;
    background: #ffffff !important;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 4px 0;
    box-shadow: 0 3px 10px rgba(18, 35, 63, 0.05);
    overflow: hidden;
  }
  .sw-prose tbody tr[hidden],
  .sw-table tbody tr[hidden] {
    display: none;
  }
  .sw-prose tbody td,
  .sw-table tbody td {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px dashed #e2e8f0;
    border-inline-end: none !important;
    text-align: start;
    width: auto;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .sw-prose tbody td:first-child,
  .sw-table tbody td:first-child {
    background: linear-gradient(135deg, #f0f6ff 0%, #e6effd 100%);
    border-bottom: 1px solid #c7dcf9;
    padding: 11px 14px;
    font-weight: 800;
    color: var(--mp-primary, #2b59c3);
  }
  .sw-prose tbody td:last-child,
  .sw-table tbody td:last-child {
    border-bottom: none;
  }
  .sw-prose tbody td[data-label]::before,
  .sw-table tbody td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: none;
    letter-spacing: normal;
    color: #475569;
    margin-bottom: 4px;
  }
  .sw-prose tbody td:first-child[data-label]::before,
  .sw-table tbody td:first-child[data-label]::before {
    color: #1e40af;
  }
}

@media (max-width: 680px) {
  .has-social-worker-guide .proto-banner { display: none; }
  .has-social-worker-guide .explore-nav { margin-bottom: 8px; }
  .has-social-worker-guide .explore-nav-desc { display: none; }
  .has-social-worker-guide .explore-nav-link { padding-block: 6px; }
  .sw-detail-page .sw-breadcrumb { font-size: .75rem; gap: 5px; margin-bottom: 10px; }
  .sw-breadcrumb-root,
  .sw-breadcrumb-full,
  .sw-breadcrumb-page { display: none; }
  .sw-breadcrumb-short { display: inline; }
  .sw-detail-header-top { gap: 8px; margin-bottom: 12px; }
  .sw-detail-header-top .sw-type-pill {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: .76rem;
  }
  .sw-detail-header-top .sw-lang-switcher { padding: 3px; gap: 1px; }
  .sw-detail-header-top .sw-lang-pill { padding: 5px 8px; font-size: .72rem; }
  .sw-detail-header h1 { overflow-wrap: anywhere; text-wrap: pretty; }
  .sw-detail-header { margin-bottom: 16px; }
  .sw-detail-lead { margin-bottom: 16px; line-height: 1.6; }
  .sw-detail-meta-bar { gap: 8px; padding-top: 10px; }
  .sw-detail-meta-left { gap: 8px 14px; }
  .sw-meta-item { font-size: .75rem; }
  .sw-detail-meta-right { margin-inline-start: auto; }
  .sw-toc-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .sw-container {
    padding: 10px 12px 36px;
  }
  .sw-hero,
  .sw-detail-header,
  .sw-prose {
    padding: 18px 15px;
    border-radius: 16px;
  }
  .sw-hero h1,
  .sw-detail-header h1 {
    font-size: 1.42rem;
    line-height: 1.32;
  }
  .sw-hero-lead,
  .sw-detail-lead {
    font-size: 0.94rem;
  }
  .sw-cards-grid,
  .sw-tools-grid,
  .sw-benchmarks-grid,
  .sw-pager {
    grid-template-columns: 1fr;
  }
  .sw-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .sw-stat-card {
    padding: 11px 12px;
  }
  .sw-stat-num {
    font-size: 1.3rem;
  }
  .sw-search-form {
    flex-direction: column;
  }
  .sw-search-submit {
    width: 100%;
  }
  /* Rubriques défilables horizontalement sur mobile */
  .sw-category-pills,
  .sw-subsite-cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .sw-category-pills::-webkit-scrollbar,
  .sw-subsite-cats::-webkit-scrollbar {
    display: none;
  }
  .sw-cat-pill,
  .sw-subsite-cat-link {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .sw-subsite-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    margin-bottom: 12px;
  }
  .sw-subsite-cats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
    padding-bottom: 0;
  }
  .sw-subsite-cat-link {
    padding: 8px;
    white-space: normal;
    font-size: .74rem;
    line-height: 1.4;
    align-items: flex-start;
  }
  .sw-subsite-cat-link i { flex-shrink: 0; margin-top: 2px; }
  .sw-subsite-home { padding: 8px; font-size: .78rem; }
  .sw-subsite-top-actions {
    justify-content: space-between;
  }
  .sw-subsite-tools {
    display: none;
  }
  .sw-filter-toolbar {
    flex-direction: column;
    padding: 14px;
    gap: 12px;
  }
  .sw-filter-field {
    min-width: 0;
    width: 100%;
    flex-basis: auto;
  }
  .sw-template-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .sw-template-actions {
    width: 100%;
  }
  .sw-template-actions .sw-btn {
    width: 100%;
  }
  .sw-lang-disclaimer {
    flex-direction: column;
    padding: 14px 16px;
  }
  .sw-lang-disclaimer-links {
    flex-direction: column;
    width: 100%;
  }
  .sw-lang-disclaimer-links .sw-btn {
    width: 100%;
  }
  .sw-pager-next {
    text-align: start;
  }
  .sw-pager-next .sw-pager-dir {
    justify-content: flex-start;
  }
}

@media print {
  .no-print,
  .sw-sidebar,
  .sw-subsite-bar,
  .sw-pager,
  .sw-related-section {
    display: none !important;
  }
  .sw-detail-layout {
    display: block !important;
  }
  .sw-prose {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .sw-prose table,
  #swTable18Categories {
    min-width: 0;
    width: 100%;
  }
}
