/*
 * Finitions visuelles communes aux pages publiques.
 * Charge en dernier depuis menu.php : les regles ici corrigent les conflits
 * entre les feuilles precedentes (liquid-theme, thematic-global, fluid...).
 */

/*
 * Base commune : couleurs, rayons et police.
 * Les autres feuilles utilisent var(--pn-*, #valeur) : la valeur de secours
 * garde le rendu identique sur les pages qui ne chargent pas ce fichier.
 */
:root {
  --pn-primary: #0f5c8c;
  --pn-primary-dark: #0b4870;
  --pn-ink: #082f57;
  --pn-text: #3d5570;
  --pn-muted: #64748b;
  --pn-accent: #0f766e;
  --pn-accent-dark: #0b5a54;
  --pn-border: #e2e8f0;
  --pn-soft: #eef4f8;
  --pn-sky: #1596cf;
  --pn-yellow: #f4d200;
  --pn-red: #e2463e;
  --pn-red-dark: #c63431;
  --pn-radius-sm: 6px;
  --pn-radius: 8px;
  --pn-radius-lg: 12px;
  --pn-font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/*
 * Echelle de graisses : 400 texte, 500-600 libelles, 700 titres et boutons.
 * Seuls les grands titres de page gardent la graisse Black (800).
 */
html body:not(.pnmls-admin-page) .pnmls-hero h1,
html body:not(.pnmls-admin-page) .all-docs-hero h1,
html body:not(.pnmls-admin-page) .topic-hero h1,
html body:not(.pnmls-admin-page) .university-hero h1,
html body:not(.pnmls-admin-page) .video-hero h1,
html body:not(.pnmls-admin-page) .featured-docs-head h2,
html body:not(.pnmls-admin-page) .home-publications-head h2,
html body:not(.pnmls-admin-page) .templatemo_gallerymid_title {
  font-weight: 800 !important;
  letter-spacing: -.01em;
}

/* Titres de section : gras (700), jamais Black ni regular. */
html body:not(.pnmls-admin-page) .home-type-head h3,
html body:not(.pnmls-admin-page) .doc-theme-head h2,
html body:not(.pnmls-admin-page) .doc-theme-head h3,
html body:not(.pnmls-admin-page) .video-section-head h2,
html body:not(.pnmls-admin-page) .topic-section-head h2,
html body:not(.pnmls-admin-page) .university-section-head h2,
html body:not(.pnmls-admin-page) .research-doc-head h2,
html body:not(.pnmls-admin-page) .pnmls-panel > h2,
html body:not(.pnmls-admin-page) .pnmls-section-head h2 {
  font-weight: 700 !important;
}

/* Titres des cartes "Tous les documents" : 3 lignes nettes, sans ligne coupee qui depasse. */
html body:not(.pnmls-admin-page) .all-doc-title {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
  overflow: hidden !important;
  min-height: 0 !important;
  max-height: none !important;
  padding-bottom: 0 !important;
}


/* Badges de type : premiere lettre en majuscule, texte tronque proprement. */
.home-doc-type,
.all-doc-type-badge,
.document-type,
.pnmls-badge,
.pnmls-auto-badge,
.featured-badge {
  display: inline-block !important;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-transform: lowercase;
}

.home-doc-type::first-letter,
.all-doc-type-badge::first-letter,
.document-type::first-letter,
.pnmls-badge::first-letter,
.pnmls-auto-badge::first-letter,
.featured-badge::first-letter {
  text-transform: uppercase;
}

/* Cartes de resultats (recherche avancee) : le badge ne chevauche plus le titre. */
.pnmls-card > .pnmls-badge {
  position: static !important;
  align-self: flex-start;
  max-width: 100%;
  margin: 0 0 12px !important;
  box-shadow: none !important;
  background: #e9f3fa !important;
  border-color: #d4e6f3 !important;
}

html[data-theme="dark"] .pnmls-card > .pnmls-badge {
  background: rgba(117, 194, 232, .14) !important;
  border-color: rgba(117, 194, 232, .24) !important;
  color: #cfe9f8 !important;
}

.pnmls-card h3 {
  min-height: 0 !important;
  margin-bottom: 10px !important;
}

@media (min-width: 640px) {
  .pnmls-card .pnmls-actions {
    grid-template-columns: minmax(0, 1fr) auto auto !important;
  }
}

/* Resumes : alignement a gauche (le texte justifie creait des trous). */
.all-doc-summary,
.home-doc-card p,
.document-card p,
.pnmls-card p,
.featured-summary {
  text-align: left !important;
}

/* Case a cocher alignee avec son libelle. */
body:not(.pnmls-admin-page) .pnmls-field label.pnmls-check {
  display: flex !important;
  align-items: center;
  margin-bottom: 0;
  gap: 10px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
}

.pnmls-check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0 !important;
  accent-color: var(--pn-primary);
}

/* Couvertures generees (js/pnmls-covers.js) pour les documents sans vraie couverture. */
.has-gen-cover {
  position: relative !important;
  display: block;
  min-height: 140px;
  background: linear-gradient(180deg, #eef4f8, #e3ecf3) !important;
}

.pnmls-gen-cover {
  --gc-from: #0b5f93;
  --gc-to: #0a3f66;
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  aspect-ratio: 3 / 4;
  max-width: calc(100% - 24px);
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: 6%;
  padding: 9% 9% 0;
  overflow: hidden;
  border-radius: 3px 6px 6px 3px;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(255, 255, 255, .16), transparent 60%),
    linear-gradient(160deg, var(--gc-from), var(--gc-to));
  color: #fff;
  text-align: left;
  box-shadow:
    inset 5px 0 0 rgba(0, 0, 0, .18),
    0 10px 22px rgba(8, 47, 87, .22);
  transition: transform .2s ease;
}

.pnmls-gen-cover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4%;
  min-height: 4px;
  background: linear-gradient(90deg, #1596cf 0 40%, #f4d200 40% 60%, #e2463e 60% 100%);
}

.pnmls-gen-cover.tone-teal { --gc-from: var(--pn-accent); --gc-to: #0b4a45; }
.pnmls-gen-cover.tone-red { --gc-from: #b3261e; --gc-to: #6e1511; }
.pnmls-gen-cover.tone-green { --gc-from: #2f7d4a; --gc-to: #1b4d2c; }
.pnmls-gen-cover.tone-indigo { --gc-from: #3f4fae; --gc-to: #262f73; }
.pnmls-gen-cover.tone-slate { --gc-from: #3a5570; --gc-to: #1f2f42; }

.pnmls-gen-cover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.pnmls-gen-cover-logo {
  flex: 0 0 62%;
  max-width: 150px;
  aspect-ratio: 2 / 1;
  background: url("../img/logo.png") left center / contain no-repeat;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .25));
}

.pnmls-gen-cover-title {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-top: 7%;
  border-top: 2px solid rgba(255, 255, 255, .35);
  font-size: clamp(10px, 8.2cqw, 18px);
  line-height: 1.25;
  font-weight: 800;
  overflow-wrap: break-word;
  hyphens: auto;
}

.pnmls-gen-cover-foot {
  margin-top: auto;
  padding-bottom: 12%;
  font-size: clamp(9px, 7cqw, 14px);
  font-weight: 700;
  opacity: .85;
}

.home-doc-card:hover .pnmls-gen-cover,
.all-doc-card:hover .pnmls-gen-cover,
.pnmls-auto-card:hover .pnmls-gen-cover {
  transform: translateX(-50%) translateY(-3px);
}

html[data-theme="dark"] .has-gen-cover {
  background: linear-gradient(180deg, #16293a, #0f1f2d) !important;
}

@media (prefers-reduced-motion: reduce) {
  .pnmls-gen-cover {
    transition: none;
  }
}

/*
 * Boutons des cartes documentaires : un seul style sur tout le site.
 * Lire = action principale (bleu), Telecharger = action secondaire (vert),
 * Info = contour (voir plus haut). Selecteurs volontairement forts pour
 * passer devant les styles historiques (liquid-theme, footer, home).
 */
html body:not(.pnmls-admin-page) .home-doc-btn,
html body:not(.pnmls-admin-page) .all-doc-btn,
html body:not(.pnmls-admin-page) .document-btn,
html body:not(.pnmls-admin-page) .featured-btn,
html body:not(.pnmls-admin-page) .topic-doc-btn,
html body:not(.pnmls-admin-page) .university-doc-btn,
html body:not(.pnmls-admin-page) .pnmls-card .pnmls-actions .pnmls-btn,
html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions a,
html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 38px !important;
  padding: 8px 14px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background-image: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  transform: none !important;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease !important;
}

html body:not(.pnmls-admin-page) .home-doc-btn.read,
html body:not(.pnmls-admin-page) .all-doc-btn.read,
html body:not(.pnmls-admin-page) .document-btn.view,
html body:not(.pnmls-admin-page) .featured-btn.view,
html body:not(.pnmls-admin-page) .topic-doc-btn.read,
html body:not(.pnmls-admin-page) .university-doc-btn.read,
html body:not(.pnmls-admin-page) .pnmls-card .pnmls-actions .pnmls-btn:not(.secondary):not(.details):not(.light),
html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions .view {
  background-color: var(--pn-primary) !important;
  color: #fff !important;
}

html body:not(.pnmls-admin-page) .home-doc-btn.read:hover,
html body:not(.pnmls-admin-page) .all-doc-btn.read:hover,
html body:not(.pnmls-admin-page) .document-btn.view:hover,
html body:not(.pnmls-admin-page) .featured-btn.view:hover,
html body:not(.pnmls-admin-page) .topic-doc-btn.read:hover,
html body:not(.pnmls-admin-page) .university-doc-btn.read:hover,
html body:not(.pnmls-admin-page) .pnmls-card .pnmls-actions .pnmls-btn:not(.secondary):not(.details):not(.light):hover,
html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions .view:hover {
  background-color: var(--pn-primary-dark) !important;
}

html body:not(.pnmls-admin-page) .home-doc-btn.download,
html body:not(.pnmls-admin-page) .all-doc-btn.download,
html body:not(.pnmls-admin-page) .document-btn.download,
html body:not(.pnmls-admin-page) .featured-btn.download,
html body:not(.pnmls-admin-page) .topic-doc-btn.download,
html body:not(.pnmls-admin-page) .university-doc-btn.download,
html body:not(.pnmls-admin-page) .pnmls-card .pnmls-actions .pnmls-btn.secondary,
html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions .download {
  background-color: var(--pn-accent) !important;
  color: #fff !important;
}

html body:not(.pnmls-admin-page) .home-doc-btn.download:hover,
html body:not(.pnmls-admin-page) .all-doc-btn.download:hover,
html body:not(.pnmls-admin-page) .document-btn.download:hover,
html body:not(.pnmls-admin-page) .featured-btn.download:hover,
html body:not(.pnmls-admin-page) .topic-doc-btn.download:hover,
html body:not(.pnmls-admin-page) .university-doc-btn.download:hover,
html body:not(.pnmls-admin-page) .pnmls-card .pnmls-actions .pnmls-btn.secondary:hover,
html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions .download:hover {
  background-color: var(--pn-accent-dark) !important;
}

html body:not(.pnmls-admin-page) .home-doc-btn.details,
html body:not(.pnmls-admin-page) .all-doc-btn.details,
html body:not(.pnmls-admin-page) .document-btn.details,
html body:not(.pnmls-admin-page) .featured-btn.details,
html body:not(.pnmls-admin-page) .topic-doc-btn.details,
html body:not(.pnmls-admin-page) .university-doc-btn.details,
html body:not(.pnmls-admin-page) .pnmls-card .pnmls-actions .pnmls-btn.details,
html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions .details {
  background-color: transparent !important;
  border-color: rgba(15, 92, 140, .3) !important;
  color: var(--pn-primary) !important;
}

html body:not(.pnmls-admin-page) .home-doc-btn.details:hover,
html body:not(.pnmls-admin-page) .all-doc-btn.details:hover,
html body:not(.pnmls-admin-page) .document-btn.details:hover,
html body:not(.pnmls-admin-page) .featured-btn.details:hover,
html body:not(.pnmls-admin-page) .topic-doc-btn.details:hover,
html body:not(.pnmls-admin-page) .university-doc-btn.details:hover,
html body:not(.pnmls-admin-page) .pnmls-card .pnmls-actions .pnmls-btn.details:hover,
html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions .details:hover {
  background-color: var(--pn-soft) !important;
  border-color: var(--pn-primary) !important;
}

html[data-theme="dark"] body:not(.pnmls-admin-page) .home-doc-btn.details,
html[data-theme="dark"] body:not(.pnmls-admin-page) .all-doc-btn.details,
html[data-theme="dark"] body:not(.pnmls-admin-page) .document-btn.details,
html[data-theme="dark"] body:not(.pnmls-admin-page) .featured-btn.details,
html[data-theme="dark"] body:not(.pnmls-admin-page) .topic-doc-btn.details,
html[data-theme="dark"] body:not(.pnmls-admin-page) .university-doc-btn.details,
html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-card .pnmls-actions .pnmls-btn.details,
html[data-theme="dark"] body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions .details {
  border-color: rgba(159, 211, 245, .35) !important;
  color: #9fd3f5 !important;
}

html[data-theme="dark"] body:not(.pnmls-admin-page) .home-doc-btn.details:hover,
html[data-theme="dark"] body:not(.pnmls-admin-page) .all-doc-btn.details:hover,
html[data-theme="dark"] body:not(.pnmls-admin-page) .document-btn.details:hover,
html[data-theme="dark"] body:not(.pnmls-admin-page) .featured-btn.details:hover,
html[data-theme="dark"] body:not(.pnmls-admin-page) .topic-doc-btn.details:hover,
html[data-theme="dark"] body:not(.pnmls-admin-page) .university-doc-btn.details:hover,
html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-card .pnmls-actions .pnmls-btn.details:hover,
html[data-theme="dark"] body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions .details:hover {
  background-color: rgba(159, 211, 245, .10) !important;
}

/* Rangee d'actions : Lire s'etire, Telecharger et Info prennent leur place naturelle. */
html body:not(.pnmls-admin-page) .home-doc-actions,
html body:not(.pnmls-admin-page) .all-doc-actions,
html body:not(.pnmls-admin-page) .document-actions,
html body:not(.pnmls-admin-page) .featured-actions,
html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  gap: 8px !important;
}

html body:not(.pnmls-admin-page) .home-doc-btn.disabled,
html body:not(.pnmls-admin-page) .all-doc-btn.disabled,
html body:not(.pnmls-admin-page) .document-btn.disabled,
html body:not(.pnmls-admin-page) .featured-btn.disabled,
html body:not(.pnmls-admin-page) .topic-doc-btn.disabled,
html body:not(.pnmls-admin-page) .university-doc-btn.disabled,
html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions .disabled {
  background-color: #eef2f6 !important;
  color: var(--pn-muted) !important;
  pointer-events: none !important;
}

html[data-theme="dark"] body:not(.pnmls-admin-page) .home-doc-btn.disabled,
html[data-theme="dark"] body:not(.pnmls-admin-page) .all-doc-btn.disabled,
html[data-theme="dark"] body:not(.pnmls-admin-page) .document-btn.disabled,
html[data-theme="dark"] body:not(.pnmls-admin-page) .featured-btn.disabled,
html[data-theme="dark"] body:not(.pnmls-admin-page) .topic-doc-btn.disabled,
html[data-theme="dark"] body:not(.pnmls-admin-page) .university-doc-btn.disabled,
html[data-theme="dark"] body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions .disabled {
  background-color: rgba(148, 163, 184, .14) !important;
  color: #94a3b8 !important;
}

html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions {
  align-items: center !important;
  padding: 16px 18px 18px !important;
}

/* Cartes etroites (2 colonnes sur mobile) : Lire et Telecharger cote a cote, Info en dessous. */
@media (max-width: 640px) {
  html body:not(.pnmls-admin-page) .home-doc-actions,
  html body:not(.pnmls-admin-page) .all-doc-actions,
  html body:not(.pnmls-admin-page) .document-actions,
  html body:not(.pnmls-admin-page) .featured-actions,
  html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 6px !important;
  }

  html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions {
    padding: 12px !important;
  }

  html body:not(.pnmls-admin-page) .home-doc-actions > .details,
  html body:not(.pnmls-admin-page) .all-doc-actions > .details,
  html body:not(.pnmls-admin-page) .document-actions > .details,
  html body:not(.pnmls-admin-page) .featured-actions > .details,
  html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions > .details {
    grid-column: 1 / -1 !important;
    min-height: 32px !important;
  }

  html body:not(.pnmls-admin-page) .home-doc-btn,
  html body:not(.pnmls-admin-page) .all-doc-btn,
  html body:not(.pnmls-admin-page) .document-btn,
  html body:not(.pnmls-admin-page) .featured-btn,
  html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions a,
  html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions button {
    min-height: 36px !important;
    padding: 7px 6px !important;
    font-size: 12px !important;
  }
}

/*
 * Navigation principale.
 * Selecteurs avec #pnmls_main_nav : le <style> de menu.php est charge apres cette feuille.
 */
#pnmls_main_nav .nav-link,
#pnmls_main_nav .nav-link:hover,
#pnmls_main_nav .nav-link:focus {
  transform: none !important;
  box-shadow: none !important;
}

#pnmls_main_nav .nav-link:hover,
#pnmls_main_nav .nav-link:focus-visible {
  background: rgba(255, 255, 255, .12) !important;
  border-radius: 8px;
}

#pnmls_main_nav .nav-item.active > .nav-link {
  background: rgba(255, 255, 255, .18) !important;
  border-radius: 8px;
}

#pnmls_main_nav .nav-item.active > .nav-link::before {
  width: 24px;
}

#pnmls_main_nav .dropdown-item:hover,
#pnmls_main_nav .dropdown-item:focus-visible {
  transform: none !important;
  box-shadow: none !important;
}

#pnmls_main_nav .dropdown-item[aria-current="page"] {
  background: var(--pn-soft);
  color: var(--pn-primary);
  font-weight: 600 !important;
}

#pnmls_main_nav .dropdown-divider {
  height: 1px;
  margin: 6px 8px;
  background: #e5edf4;
}

#pnmls_main_nav .dropdown-header {
  display: block;
  padding: 6px 12px 4px;
  color: var(--pn-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

@media (min-width: 1181px) {
  #pnmls_main_nav .dropdown-menu-wide {
    min-width: 320px;
  }

  #pnmls_main_nav .dropdown-menu-columns {
    min-width: 480px;
    columns: 2;
    column-gap: 4px;
  }

  #pnmls_main_nav .dropdown-menu-columns .dropdown-item {
    break-inside: avoid;
  }
}

/* Recherche : bouton loupe compact a la place de "Valider". */
#pnmls_main_nav .pnmls-menu-search .pnmls-search-btn {
  flex: 0 0 40px !important;
  width: 40px !important;
  min-width: 40px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  background: var(--pn-primary) !important;
  box-shadow: none !important;
  transform: none !important;
}

#pnmls_main_nav .pnmls-menu-search .pnmls-search-btn:hover,
#pnmls_main_nav .pnmls-menu-search .pnmls-search-btn:focus-visible {
  background: var(--pn-primary-dark) !important;
}

@media (max-width: 640px) {
  #pnmls_main_nav .pnmls-menu-search .form-control {
    flex: 1 1 calc(100% - 48px) !important;
  }
}

/* Les libelles du menu etant plus courts, plus besoin de les reduire a 10 px entre 1181 et 1460 px. */
@media (min-width: 1181px) {
  #pnmls_main_nav .nav-link {
    font-size: 13.5px !important;
    padding: 10px clamp(6px, .7vw, 11px) !important;
  }
}

/*
 * Mode sombre : les tokens prennent leurs valeurs sombres, et les panneaux
 * qui restaient blancs (texte clair illisible) passent sur une surface sombre.
 */
html[data-theme="dark"] {
  --pn-primary: #2f80bf;
  --pn-primary-dark: #256aa0;
  --pn-ink: #e8f2fa;
  --pn-text: #c4d4e1;
  --pn-muted: #9db0c1;
  --pn-accent: #148a7f;
  --pn-accent-dark: #0f766e;
  --pn-border: rgba(148, 178, 204, .22);
  --pn-soft: #17293a;
  --pn-surface: #102131;
  --pn-surface-raised: #152b3e;
}

html[data-theme="dark"] body:not(.pnmls-admin-page) .templatemo_gallery_left,
html[data-theme="dark"] body:not(.pnmls-admin-page) .home-type-section,
html[data-theme="dark"] body:not(.pnmls-admin-page) .doc-theme-section,
html[data-theme="dark"] body:not(.pnmls-admin-page) .theme-nav,
html[data-theme="dark"] body:not(.pnmls-admin-page) .featured-docs-panel,
html[data-theme="dark"] body:not(.pnmls-admin-page) .featured-main,
html[data-theme="dark"] body:not(.pnmls-admin-page) .featured-side-card,
html[data-theme="dark"] body:not(.pnmls-admin-page) .featured-main-body,
html[data-theme="dark"] body:not(.pnmls-admin-page) .featured-side-body,
html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-panel,
html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-hero,
html[data-theme="dark"] body:not(.pnmls-admin-page) .all-docs-hero,
html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-shell > section:not(.pnmls-hero) > .pnmls-card,
html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-card {
  background: var(--pn-surface) !important;
  border-color: var(--pn-border) !important;
  color: var(--pn-text) !important;
}

html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-auto-card,
html[data-theme="dark"] body:not(.pnmls-admin-page) .home-doc-card,
html[data-theme="dark"] body:not(.pnmls-admin-page) .all-doc-card {
  background: var(--pn-surface-raised) !important;
  border-color: var(--pn-border) !important;
}

html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-auto-card .pnmls-auto-title,
html[data-theme="dark"] body:not(.pnmls-admin-page) .featured-main h3,
html[data-theme="dark"] body:not(.pnmls-admin-page) .featured-side-card h3,
html[data-theme="dark"] body:not(.pnmls-admin-page) .featured-docs-head h2,
html[data-theme="dark"] body:not(.pnmls-admin-page) .templatemo_gallerymid_title,
html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-hero h1,
html[data-theme="dark"] body:not(.pnmls-admin-page) .all-docs-hero h1,
html[data-theme="dark"] body:not(.pnmls-admin-page) .home-publications-head h2,
html[data-theme="dark"] body:not(.pnmls-admin-page) .home-type-head h3,
html[data-theme="dark"] body:not(.pnmls-admin-page) .doc-theme-head h2,
html[data-theme="dark"] body:not(.pnmls-admin-page) .doc-theme-head h3,
html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-card h3 {
  color: var(--pn-ink) !important;
}

html[data-theme="dark"] body:not(.pnmls-admin-page) .featured-summary,
html[data-theme="dark"] body:not(.pnmls-admin-page) .featured-meta,
html[data-theme="dark"] body:not(.pnmls-admin-page) .featured-docs-head p,
html[data-theme="dark"] body:not(.pnmls-admin-page) .home-type-head p,
html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-hero p,
html[data-theme="dark"] body:not(.pnmls-admin-page) .all-docs-hero p {
  color: var(--pn-text) !important;
}

html[data-theme="dark"] body:not(.pnmls-admin-page) .featured-docs-link,
html[data-theme="dark"] body:not(.pnmls-admin-page) .home-doc-year,
html[data-theme="dark"] body:not(.pnmls-admin-page) .all-doc-year,
html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-auto-year {
  color: #8cc4ec !important;
}

html[data-theme="dark"] body:not(.pnmls-admin-page) .featured-docs-link,
html[data-theme="dark"] body:not(.pnmls-admin-page) .home-type-more {
  background: var(--pn-soft) !important;
  border-color: var(--pn-border) !important;
}

/* Formulaires en mode sombre : libelles lisibles, champs sombres. */
html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-field label,
html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-meta {
  color: var(--pn-text) !important;
}

html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-input,
html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-select,
html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-textarea {
  background: #0b1824 !important;
  border-color: var(--pn-border) !important;
  color: var(--pn-ink) !important;
}

html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-input::placeholder,
html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-textarea::placeholder {
  color: var(--pn-muted) !important;
}

html[data-theme="dark"] body:not(.pnmls-admin-page) .pnmls-btn.light {
  background: var(--pn-soft) !important;
  color: var(--pn-ink) !important;
}

/* Gabarit unique des rubriques (includes/topic_page.php). */
.rubrique-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  gap: 14px;
  align-items: end;
}

.rubrique-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--pn-text);
  font-size: 13px;
  font-weight: 600;
}

.rubrique-actions {
  display: flex;
  gap: 8px;
}

.rubrique-results {
  margin-top: 18px;
}

html body:not(.pnmls-admin-page) .rubrique-results .all-docs-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
}

.rubrique-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 44px 20px;
  border: 1px dashed var(--pn-border);
  border-radius: var(--pn-radius-lg);
  text-align: center;
  color: var(--pn-text);
}

.rubrique-empty strong {
  color: var(--pn-ink);
  font-size: 17px;
}

.rubrique-empty .pnmls-btn {
  margin-top: 8px;
}

.rubrique-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 26px;
}

.rubrique-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--pn-border);
  border-radius: var(--pn-radius);
  background: #fff;
  color: var(--pn-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
}

.rubrique-page:hover {
  border-color: var(--pn-primary);
  background: var(--pn-soft);
}

.rubrique-page.current {
  border-color: var(--pn-primary);
  background: var(--pn-primary);
  color: #fff;
}

.rubrique-siblings {
  margin: 26px 0 10px;
  padding: 20px 22px;
  border: 1px solid var(--pn-border);
  border-radius: var(--pn-radius-lg);
  background: #fff;
}

.rubrique-siblings h2 {
  margin: 0 0 12px;
  color: var(--pn-ink);
  font-size: 17px;
  font-weight: 700;
}

.rubrique-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rubrique-chips .theme-chip {
  text-decoration: none !important;
}

html[data-theme="dark"] .rubrique-page,
html[data-theme="dark"] .rubrique-siblings {
  background: var(--pn-surface);
}

html[data-theme="dark"] .rubrique-page.current {
  background: var(--pn-primary);
}

@media (max-width: 760px) {
  .rubrique-toolbar {
    grid-template-columns: 1fr;
  }

  .rubrique-actions .pnmls-btn {
    flex: 1 1 auto;
  }
}

/*
 * Ajustements mobiles (verifies en emulation 390 x 844).
 */
@media (max-width: 640px) {
  /* Texte justifie illisible sur ecran etroit : alignement a gauche. */
  .pn-hero p,
  .home-publications-head p,
  .home-type-head p,
  .all-docs-hero p,
  .topic-hero p {
    text-align: left !important;
    word-spacing: normal !important;
  }

  /* Tailles minimales lisibles (badges, annees, boutons, puces). */
  html body:not(.pnmls-admin-page) .home-doc-type,
  html body:not(.pnmls-admin-page) .all-doc-type-badge,
  html body:not(.pnmls-admin-page) .home-doc-fresh,
  html body:not(.pnmls-admin-page) .all-doc-fresh-badge {
    font-size: 11.5px !important;
    padding: 5px 9px !important;
  }

  html body:not(.pnmls-admin-page) .home-doc-year,
  html body:not(.pnmls-admin-page) .all-doc-year {
    font-size: 12px !important;
  }

  html body:not(.pnmls-admin-page) .home-doc-btn,
  html body:not(.pnmls-admin-page) .all-doc-actions .all-doc-btn,
  html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions a,
  html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions button {
    font-size: 13px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  html body:not(.pnmls-admin-page) .theme-chip,
  html body:not(.pnmls-admin-page) .theme-chip span,
  html body:not(.pnmls-admin-page) .all-docs-stat span,
  html body:not(.pnmls-admin-page) .home-type-head p,
  html body:not(.pnmls-admin-page) .home-type-more {
    font-size: 12.5px !important;
  }

  /* Badge "Plus recent" en bas de la couverture : il ne chevauche plus le badge de type. */
  html body:not(.pnmls-admin-page) .home-doc-fresh,
  html body:not(.pnmls-admin-page) .all-doc-fresh-badge {
    top: auto !important;
    bottom: 10px !important;
    left: 10px !important;
  }

  /* "Voir plus" : pleine largeur, identique dans toutes les sections. */
  html body:not(.pnmls-admin-page) .home-type-more {
    align-self: stretch !important;
    width: 100% !important;
  }

  /* Cartes sur 2 colonnes : boutons empiles, sinon "Telecharger" est coupe. */
  html body:not(.pnmls-admin-page) .home-doc-actions,
  html body:not(.pnmls-admin-page) .all-doc-actions,
  html body:not(.pnmls-admin-page) .templatemo_gallery_left .pnmls-auto-actions {
    grid-template-columns: 1fr !important;
  }

  /* Badge "Plus recent" au-dessus de la couverture et lisible en entier. */
  html body:not(.pnmls-admin-page) .home-doc-fresh,
  html body:not(.pnmls-admin-page) .all-doc-fresh-badge {
    z-index: 4 !important;
    max-width: none !important;
    white-space: nowrap !important;
  }

  /* Menu ouvert : entrees plus compactes. */
  #pnmls_main_nav .navbar-nav {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-content: flex-start !important;
    gap: 6px !important;
  }

  #pnmls_main_nav .navbar-nav > .nav-item {
    flex: 0 0 auto !important;
    margin: 0 !important;
  }

  #pnmls_main_nav .navbar-nav > .nav-item > .nav-link {
    min-height: 44px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  /* Rubriques : 2 colonnes comme "Tous les documents". */
  html body:not(.pnmls-admin-page) .rubrique-results .all-docs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  /* Couvertures generees : zone plus haute pour que le titre reste lisible. */
  html body:not(.pnmls-admin-page) .all-doc-cover.has-gen-cover,
  html body:not(.pnmls-admin-page) .home-doc-cover.has-gen-cover {
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 4 / 5 !important;
  }
}

/* Couverture tres etroite : seulement logo + annee, le titre est deja sous la couverture. */
@container (max-width: 110px) {
  .pnmls-gen-cover-title {
    display: none;
  }
}

/* Menu ouvert (tablette et mobile) : panneau en bloc, recherche et boutons en grille. */
@media (max-width: 1180px) {
  #pnmls_main_nav .navbar-collapse.is-open {
    display: block !important;
    height: auto !important;
  }

  #pnmls_main_nav .navbar-collapse.is-open .navbar-nav {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
  }

  #pnmls_main_nav .navbar-collapse.is-open .navbar-nav > .nav-item {
    flex: 0 0 auto !important;
  }

  #pnmls_main_nav .pnmls-menu-search {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px !important;
    height: auto !important;
    max-width: none !important;
    margin: 14px 0 4px !important;
  }

  #pnmls_main_nav .pnmls-menu-search .form-control,
  #pnmls_main_nav .pnmls-menu-search .pnmls-search-btn,
  #pnmls_main_nav .pnmls-menu-search .pnmls-menu-cta {
    flex: none !important;
    width: 100% !important;
    max-width: none !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  #pnmls_main_nav .pnmls-menu-search .pnmls-menu-cta {
    grid-column: 1 / -1;
  }
}

/*
 * Ecrans d'ordinateur portable : tout le site est dessine en pixels fixes et
 * parait trop gros entre 1025 et 1680 px de large. On reduit l'echelle globale
 * (mobile et grands ecrans inchanges).
 */
@media (min-width: 1025px) and (max-width: 1440px) {
  html:not(.pnmls-no-zoom) {
    zoom: .85;
  }
}

@media (min-width: 1441px) and (max-width: 1680px) {
  html:not(.pnmls-no-zoom) {
    zoom: .92;
  }
}

/* Barre de progression de la navigation sans rechargement (Turbo). */
.turbo-progress-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--pn-sky, #1596cf) 0 40%, var(--pn-yellow, #f4d200) 40% 60%, var(--pn-red, #e2463e) 60% 100%);
}

/* ------------------------------------------------------------------
 * Page "document non disponible" (includes/document_unavailable.php).
 * ------------------------------------------------------------------ */
.pn-missing {
  max-width: 1080px;
  margin: 32px auto 40px;
  padding: 0 16px;
}

.pn-missing-card {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--pn-border, #e2e8f0);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(8, 47, 87, .04), 0 12px 32px rgba(8, 47, 87, .08);
}

.pn-missing-cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 28px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(21, 150, 207, .16), transparent 60%),
    linear-gradient(160deg, #eef4f8, #dfe9f2);
}

.pn-missing-cover img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 340px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(8, 47, 87, .12), 0 16px 32px rgba(8, 47, 87, .2);
  filter: grayscale(.25);
}

.pn-missing-cover .pnmls-gen-cover {
  position: relative;
  top: auto;
  bottom: auto;
  left: auto;
  transform: none;
  width: 210px;
}

.pn-missing-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 32px 34px;
}

.pn-missing-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
  color: var(--pn-muted, #64748b);
  font-size: 13.5px;
}

.pn-missing-type {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  background: #e7f4f1;
  color: var(--pn-accent-dark, #0b5a54);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: lowercase;
}

.pn-missing-type::first-letter {
  text-transform: uppercase;
}

.pn-missing-year {
  font-weight: 600;
}

.pn-missing h1 {
  margin: 0 0 8px;
  color: var(--pn-ink, #082f57) !important;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 800 !important;
  line-height: 1.22;
}

.pn-missing-author {
  margin: 0 0 20px;
  color: var(--pn-text, #3d5570);
  font-size: 14.5px;
}

.pn-missing-notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid #f3dfa8;
  border-left: 4px solid var(--pn-yellow, #f4d200);
  border-radius: 10px;
  background: #fffaeb;
}

.pn-missing-notice strong {
  display: block;
  margin-bottom: 3px;
  color: #5c4500;
  font-size: 15px;
}

.pn-missing-notice span {
  color: #6b5a26;
  font-size: 14px;
  line-height: 1.5;
}

.pn-missing-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fdeeb4;
  color: #8a6a00;
  font-size: 17px;
}

.pn-missing-icon.large {
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  background: var(--pn-soft, #eef4f8);
  color: var(--pn-primary, #0f5c8c);
  font-size: 30px;
}

.pn-missing-label {
  margin: 0 0 6px;
  color: var(--pn-muted, #64748b) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pn-missing-summary {
  margin: 0 0 24px;
  color: var(--pn-text, #3d5570);
  font-size: 15px;
  line-height: 1.7;
  text-align: left !important;
}

.pn-missing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.pn-missing-actions.center {
  justify-content: center;
  margin-top: 18px;
}

.pn-missing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--pn-border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  color: var(--pn-primary, #0f5c8c) !important;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.pn-missing-btn:hover {
  border-color: var(--pn-primary, #0f5c8c);
  background: var(--pn-soft, #eef4f8);
}

.pn-missing-btn.primary {
  border-color: var(--pn-primary, #0f5c8c);
  background: var(--pn-primary, #0f5c8c);
  color: #fff !important;
}

.pn-missing-btn.primary:hover {
  background: var(--pn-primary-dark, #0b4870);
}

/* Variante "document introuvable" */
.pn-missing-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 28px;
  text-align: center;
}

.pn-missing-empty p {
  max-width: 520px;
  margin: 0 0 22px;
  color: var(--pn-text, #3d5570);
  font-size: 15.5px;
  line-height: 1.6;
}

.pn-missing-search {
  display: flex;
  gap: 8px;
  width: min(100%, 520px);
}

.pn-missing-search .pnmls-input {
  flex: 1 1 auto;
  min-height: 44px;
}

.pn-missing-similar {
  margin-top: 34px;
}

.pn-missing-similar h2 {
  margin: 0 0 16px;
  color: var(--pn-ink, #082f57) !important;
  font-size: 20px;
  font-weight: 700 !important;
}

html body:not(.pnmls-admin-page) .pn-missing-similar .all-docs-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
}

/* Mode sombre */
html[data-theme="dark"] .pn-missing-card {
  border-color: var(--pn-border);
  background: var(--pn-surface, #102131);
}

html[data-theme="dark"] .pn-missing-cover {
  background: linear-gradient(160deg, #17293a, #0f1f2d);
}

html[data-theme="dark"] .pn-missing h1,
html[data-theme="dark"] .pn-missing-similar h2 {
  color: var(--pn-ink) !important;
}

html[data-theme="dark"] .pn-missing-notice {
  border-color: rgba(244, 210, 0, .3);
  background: rgba(244, 210, 0, .08);
}

html[data-theme="dark"] .pn-missing-notice strong {
  color: #f6e08a;
}

html[data-theme="dark"] .pn-missing-notice span {
  color: #d9cb91;
}

html[data-theme="dark"] .pn-missing-btn:not(.primary) {
  background: transparent;
  color: #8cc4ec !important;
}

@media (max-width: 760px) {
  .pn-missing {
    margin-top: 18px;
  }

  .pn-missing-card {
    grid-template-columns: 1fr;
  }

  .pn-missing-cover {
    padding: 24px;
  }

  .pn-missing-cover img {
    max-height: 240px;
  }

  .pn-missing-cover .pnmls-gen-cover {
    width: 160px;
  }

  .pn-missing-body {
    padding: 22px 20px;
  }

  .pn-missing-actions .pn-missing-btn {
    flex: 1 1 100%;
  }

  .pn-missing-search {
    flex-direction: column;
  }

  html body:not(.pnmls-admin-page) .pn-missing-similar .all-docs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Texte reserve aux lecteurs d'ecran (disponible sur toutes les pages). */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

/* Page "Provinces" (app/pages/provinces.php). */
.topic-hero-stat strong small {
  font-size: 55%;
  opacity: .75;
}

.pn-prov-scopes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.pn-prov-scope {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--pn-border, #e2e8f0);
  border-radius: 12px;
  background: #fff;
  color: var(--pn-ink, #082f57) !important;
  text-decoration: none !important;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.pn-prov-scope:hover {
  border-color: var(--pn-primary, #0f5c8c);
  box-shadow: 0 8px 22px rgba(8, 47, 87, .08);
}

.pn-prov-scope-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--pn-soft, #eef4f8);
  color: var(--pn-primary, #0f5c8c);
  font-size: 18px;
}

.pn-prov-scope strong {
  display: block;
  font-size: 15.5px;
}

.pn-prov-scope small {
  color: var(--pn-muted, #64748b);
  font-size: 13px;
}

.pn-prov-arrow {
  margin-left: auto;
  color: var(--pn-primary, #0f5c8c);
  font-size: 18px;
}

.pn-prov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.pn-prov-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--pn-border, #e2e8f0);
  border-left: 4px solid var(--pn-primary, #0f5c8c);
  border-radius: 10px;
  background: #fff;
  text-decoration: none !important;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.pn-prov-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(8, 47, 87, .08);
}

.pn-prov-name {
  color: var(--pn-ink, #082f57);
  font-size: 15.5px;
  font-weight: 700;
}

.pn-prov-count {
  color: var(--pn-muted, #64748b);
  font-size: 13px;
}

.pn-prov-count strong {
  color: var(--pn-primary, #0f5c8c);
}

.pn-prov-card.is-empty {
  border-left-color: var(--pn-border, #e2e8f0);
  background: #f8fafc;
}

.pn-prov-card.is-empty .pn-prov-name {
  color: var(--pn-text, #3d5570);
  font-weight: 600;
}

/* Compteur "Provinces couvertes" de l'accueil : toute la carte mene a la page Provinces. */
.pn-stats-link {
  position: relative;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.pn-stats-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.pn-stats-link:hover {
  border-color: var(--pn-primary, #0f5c8c) !important;
  box-shadow: 0 8px 20px rgba(8, 47, 87, .08);
}

html[data-theme="dark"] .pn-prov-scope,
html[data-theme="dark"] .pn-prov-card {
  border-color: var(--pn-border);
  background: var(--pn-surface, #102131);
  color: var(--pn-ink) !important;
}

html[data-theme="dark"] .pn-prov-card {
  border-left-color: var(--pn-primary);
}

html[data-theme="dark"] .pn-prov-card.is-empty {
  border-left-color: var(--pn-border);
  background: rgba(16, 33, 49, .55);
}

html[data-theme="dark"] .pn-prov-name {
  color: var(--pn-ink);
}

@media (max-width: 640px) {
  .pn-prov-scopes {
    grid-template-columns: 1fr;
  }

  .pn-prov-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.rubrique-all-link {
  margin-left: 10px;
  color: var(--pn-primary, #0f5c8c) !important;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
}

.rubrique-all-link:hover {
  text-decoration: underline !important;
}

/* Formulaire "Soumettre un document" (app/pages/soumettre_document.php). */
.pn-submit-form {
  max-width: 860px;
  margin: 0 auto;
}

.pn-submit-footer .pnmls-check {
  display: flex !important;
  align-items: center;
  gap: 10px;
  color: var(--pn-text, #3d5570);
  font-weight: 500;
  cursor: pointer;
}

.pn-submit-footer .pnmls-check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0 !important;
  accent-color: var(--pn-primary, #0f5c8c);
}

.pn-submit-step {
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.pn-submit-step legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--pn-ink, #082f57);
  font-size: 17px;
  font-weight: 700;
}

.pn-submit-step legend span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pn-primary, #0f5c8c);
  color: #fff;
  font-size: 13px;
}

/* Zone de depot du fichier */
.pn-submit-drop {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0 0 16px !important;
  padding: 26px 20px;
  border: 2px dashed #b9cfdf;
  border-radius: 12px;
  background: var(--pn-soft, #eef4f8);
  color: var(--pn-text, #3d5570) !important;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}

.pn-submit-drop:hover,
.pn-submit-drop.is-dragging,
.pn-submit-drop:focus-within {
  border-color: var(--pn-primary, #0f5c8c);
  background: #e6f0f7;
}

.pn-submit-drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.pn-submit-drop .fa {
  color: var(--pn-primary, #0f5c8c);
  font-size: 30px;
}

.pn-submit-drop-title {
  max-width: 100%;
  overflow: hidden;
  color: var(--pn-ink, #082f57);
  font-size: 15.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pn-submit-drop-hint {
  color: var(--pn-muted, #64748b);
  font-size: 13px;
}

.pn-submit-drop.has-file {
  border-style: solid;
  border-color: var(--pn-accent, #0f766e);
  background: #e9f6f3;
}

.pn-submit-drop.has-file .fa::before {
  content: "\f15b";
}

.pn-submit-drop.has-file .fa {
  color: var(--pn-accent, #0f766e);
}

.pn-submit-drop.is-too-big {
  border-color: var(--pn-red, #e2463e);
  background: #fdeeed;
}

.pn-submit-drop.is-too-big .pn-submit-drop-hint {
  color: #b42318;
  font-weight: 600;
}

.pn-optional {
  margin-left: 4px;
  color: var(--pn-muted, #64748b);
  font-size: 12px;
  font-weight: 400;
}

/* Bloc facultatif replie */
.pn-submit-more {
  margin: 0 0 22px;
  border: 1px solid var(--pn-border, #e2e8f0);
  border-radius: 12px;
}

.pn-submit-more summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  color: var(--pn-primary, #0f5c8c);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.pn-submit-more summary::-webkit-details-marker {
  display: none;
}

.pn-submit-more summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pn-soft, #eef4f8);
  font-size: 16px;
  line-height: 1;
}

.pn-submit-more[open] summary::before {
  content: "−";
}

.pn-submit-more > .pnmls-grid {
  padding: 4px 18px 18px;
}

.pn-submit-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--pn-border, #e2e8f0);
}

.pn-submit-footer .pnmls-check {
  margin: 0 !important;
}

.pn-submit-footer .pnmls-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 24px;
}

/* Confirmation apres envoi */
.pn-submit-done {
  text-align: center;
}

.pn-submit-done-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: #e7f4f1;
  color: var(--pn-accent, #0f766e);
  font-size: 28px;
}

.pn-submit-done h2 {
  margin: 0 0 8px;
  color: var(--pn-ink, #082f57) !important;
  font-size: 22px;
  font-weight: 700 !important;
}

.pn-submit-done p {
  max-width: 520px;
  margin: 0 auto 20px;
  color: var(--pn-text, #3d5570);
}

.pn-submit-done .pnmls-actions {
  justify-content: center;
}

html[data-theme="dark"] .pn-submit-drop {
  border-color: rgba(148, 178, 204, .35);
  background: rgba(23, 41, 58, .8);
}

html[data-theme="dark"] .pn-submit-drop-title,
html[data-theme="dark"] .pn-submit-step legend,
html[data-theme="dark"] .pn-submit-done h2 {
  color: var(--pn-ink) !important;
}

html[data-theme="dark"] .pn-submit-more summary {
  color: #8cc4ec;
}

@media (max-width: 640px) {
  .pn-submit-footer .pnmls-btn {
    justify-content: center;
    width: 100%;
  }
}

/* Champ piege anti-robots du formulaire de contact : invisible pour les humains. */
.pnmls-hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
