/* Socle HC Intranet. Les composants n'utilisent que les jetons.
   Spécificité : une classe. Un modificateur pour un état simulé.
   Aucune règle n'en annule une autre. */

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../polices/inter-ext-400.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../polices/inter-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../polices/inter-ext-500.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../polices/inter-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../polices/inter-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../polices/inter-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../polices/inter-ext-700.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../polices/inter-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../polices/jetbrains-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../polices/jetbrains-mono-500.woff2") format("woff2");
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--surface-0);
  color: var(--texte);
  font-family: var(--police);
  font-size: var(--texte-m);
  font-weight: var(--poids-corps);
  line-height: var(--interligne);
  font-feature-settings: "cv01" 1, "ss03" 1;
  font-kerning: normal;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* Un élément marqué `hidden` est caché, quelle que soit la classe qui le
   met en flex ou en grille. Sans cette règle, `.actions { display: flex }`
   l'emporte sur `[hidden]` et les deux modes d'une fiche s'affichent
   ensemble. */
[hidden] {
  display: none !important;
}

a {
  color: var(--texte);
  text-decoration-thickness: var(--filet);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--texte);
}

:focus-visible {
  outline: var(--anneau) solid var(--lueur-chaude);
  outline-offset: var(--anneau);
}

.visuellement-masque {
  position: absolute;
  width: var(--filet);
  height: var(--filet);
  padding: 0;
  margin: calc(-1 * var(--filet));
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.saut-contenu {
  position: absolute;
  left: var(--espace-4);
  top: calc(-1 * var(--espace-16));
  z-index: 2;
  padding: var(--espace-2) var(--espace-4);
  background: var(--surface-3);
  color: var(--texte);
  border-radius: var(--rayon-s);
}

.saut-contenu:focus {
  top: var(--espace-4);
}

/* --- Halo : seule animation autonome, la veilleuse --- */

.halo {
  position: fixed;
  top: -10rem;
  left: 50%;
  z-index: 0;
  width: min(48rem, 130vw);
  height: 26rem;
  pointer-events: none;
  background: radial-gradient(
    50% 55% at 50% 40%,
    rgba(var(--lueur-chaude-rvb), 0.22) 0%,
    rgba(var(--lueur-chaude-rvb), 0.07) 42%,
    transparent 70%
  );
  transform: translateX(-50%);
  animation: respiration-halo 20s var(--courbe-sortie) infinite;
}

@keyframes respiration-halo {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.7;
  }
}

/* --- Page --- */

.entete,
.page {
  position: relative;
  z-index: 1;
}

.entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--espace-4);
  width: 100%;
  max-width: var(--largeur-page);
  margin-inline: auto;
  padding: var(--espace-5) var(--gouttiere);
}

.entete-marque {
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
}

.entete-identite {
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
  color: var(--texte-doux);
}

.page {
  width: 100%;
  max-width: var(--largeur-page);
  margin-inline: auto;
  padding: 0 var(--gouttiere) var(--espace-16);
}

.mesure {
  max-width: var(--mesure);
}

.compte,
time {
  font-variant-numeric: tabular-nums;
}

/* --- Type --- */

h1,
h2,
h3 {
  line-height: var(--interligne-titre);
  font-weight: var(--poids-titre);
}

h1 {
  font-size: var(--titre-l);
  letter-spacing: var(--approche-l);
}

h2 {
  font-size: var(--titre-m);
  font-weight: var(--poids-meta);
  letter-spacing: var(--approche-m);
}

h3 {
  font-size: var(--titre-s);
  font-weight: var(--poids-meta);
  letter-spacing: var(--approche-s);
}

.meta {
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
  color: var(--texte-doux);
}

/* --- Recherche : pilule de précision, pas une bannière --- */

.barre-recherche {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--espace-3);
  width: 100%;
  max-width: var(--recherche-largeur);
  height: var(--recherche-hauteur);
  margin-inline: auto;
  padding: 0 var(--espace-4);
  background: var(--surface-2);
  border: var(--filet) solid var(--bord);
  border-radius: var(--rayon-plein);
  transition: border-color var(--duree-rapide) var(--courbe-sortie);
}

/* --- Suggestions : un panneau qui flotte sous la barre ---
   Il ne pousse pas la page : la grille des espaces ne saute plus à
   chaque frappe. Deux lettres suffisent pour l'ouvrir, et il propose
   les fiches récentes avant même qu'on ait tapé quoi que ce soit. */
.suggestions {
  position: absolute;
  z-index: 5;
  top: calc(100% + var(--espace-2));
  left: 0;
  right: 0;
  max-height: min(26rem, 60vh);
  padding: var(--espace-2);
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: left;
  background: var(--surface-3);
  border: var(--filet) solid var(--bord-fort);
  border-radius: var(--rayon-m);
  box-shadow:
    inset 0 var(--filet) 0 var(--arete),
    0 var(--espace-4) var(--espace-10) rgba(0, 0, 0, 0.55);
}

.suggestions-titre {
  padding: var(--espace-2) var(--espace-3) var(--espace-1);
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
  color: var(--texte-doux);
}

.suggestions-titre:not(:first-child) {
  margin-top: var(--espace-2);
  border-top: var(--filet) solid var(--bord);
}

.suggestions-liste {
  list-style: none;
}

.suggestions-liste a {
  display: flex;
  align-items: center;
  gap: var(--espace-3);
  padding: var(--espace-2) var(--espace-3);
  color: var(--texte);
  text-decoration: none;
  border-radius: var(--rayon-s);
}

.suggestions-liste a:hover,
.suggestions-liste a.actif {
  background: rgba(var(--lueur-chaude-rvb), 0.13);
}

.suggestions-liste a.actif .suggestions-icone {
  color: var(--lueur-chaude);
}

.suggestions-icone {
  display: inline-flex;
  flex: none;
  color: var(--texte-doux);
}

.suggestions-corps {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.suggestions-nom {
  font-size: var(--texte-s);
  font-weight: var(--poids-meta);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestions-extrait {
  font-size: var(--texte-xs);
  color: var(--texte-doux);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestions-extrait b {
  color: var(--texte);
  font-weight: var(--poids-meta);
}

.suggestions-chemin {
  flex: none;
  max-width: 40%;
  font-size: var(--texte-xs);
  color: var(--texte-doux);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.barre-recherche-icone {
  flex: none;
  color: var(--texte-doux);
}

.barre-recherche-icone svg {
  width: var(--espace-4);
  height: var(--espace-4);
}

.barre-recherche input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  color: var(--texte);
  font: inherit;
  font-size: var(--texte-s);
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: none;
  appearance: none;
}

.barre-recherche input::placeholder {
  color: var(--texte-doux);
}

.barre-recherche input::-webkit-search-decoration,
.barre-recherche input::-webkit-search-cancel-button {
  appearance: none;
}

.raccourci {
  flex: none;
  padding: var(--espace-1) var(--espace-2);
  font-family: inherit;
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
  line-height: 1;
  color: var(--texte-doux);
  background: var(--surface-1);
  border: var(--filet) solid var(--bord);
  border-radius: var(--rayon-s);
}

.barre-recherche:hover,
.barre-recherche.est-survol {
  border-color: var(--bord-fort);
}

.barre-recherche:focus-within,
.barre-recherche.est-focus {
  border-color: var(--lueur-chaude);
  outline: var(--anneau) solid var(--lueur-chaude);
  outline-offset: var(--anneau);
}

.barre-recherche.est-presse {
  background: var(--surface-1);
}

.barre-recherche.est-desactive,
.barre-recherche:has(input:disabled) {
  opacity: 0.4;
  pointer-events: none;
}

.barre-recherche.en-cours {
  opacity: 0.7;
}

/* --- Tuiles --- */

.grille-tuiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--tuile-min)), 1fr));
  gap: var(--espace-4);
}

/* Verre poli : le fond transparaît, une arête haute très légère
   décolle la tuile, le halo ambré l'effleure. Pas d'ombre grise,
   pas de saut, pas de filet ambré plein. */
.tuile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--espace-2);
  min-height: var(--tuile-hauteur);
  padding: var(--espace-4) var(--espace-5) var(--espace-4);
  color: inherit;
  text-decoration: none;
  background: var(--verre);
  border: var(--filet) solid var(--verre-bord);
  border-radius: var(--rayon-l);
  box-shadow: inset 0 var(--filet) 0 var(--arete);
  -webkit-backdrop-filter: blur(var(--flou-verre)) saturate(1.2);
  backdrop-filter: blur(var(--flou-verre)) saturate(1.2);
  overflow: hidden;
  transition:
    background-color var(--duree-pose) var(--courbe-sortie),
    border-color var(--duree-pose) var(--courbe-sortie),
    box-shadow var(--duree-pose) var(--courbe-sortie);
}

/* Arête supérieure lumineuse : un filet de jour sur le verre. */
.tuile::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 230, 190, 0.16) 0%,
    transparent 28%
  );
  opacity: 0.85;
}

/* Le halo de la page traverse le verre, très bas. */
.tuile::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    90% 70% at 50% -20%,
    rgba(var(--lueur-chaude-rvb), 0.10) 0%,
    transparent 58%
  );
  opacity: 0.75;
}

.tuile > * {
  position: relative;
  z-index: 1;
}

.tuile-haut {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--espace-3);
}

.tuile-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--espace-8);
  height: var(--espace-8);
  margin-bottom: var(--espace-1);
  border-radius: var(--rayon-m);
  background: rgba(var(--lueur-chaude-rvb), 0.12);
  color: var(--teinte, var(--lueur-chaude));
}

.tuile-icone svg {
  width: var(--espace-5);
  height: var(--espace-5);
}

/* Ce que la tuile contient, en clair — réservé au tableau de bord
   d'administration. Sur l'accueil, une tuile est un panneau de porte. */
.tuile-apercu {
  font-size: var(--texte-s);
  line-height: 1.45;
  color: var(--texte-doux);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.tuile:hover .tuile-apercu {
  color: var(--texte);
}

.tuile-nom {
  font-size: var(--titre-tuile);
  font-weight: var(--poids-titre);
  letter-spacing: var(--approche-s);
  line-height: 1.2;
}

.tuile-pied {
  display: flex;
  align-items: baseline;
  gap: var(--espace-3);
  margin-top: auto;
  padding-top: var(--espace-2);
}

.tuile-compte {
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
  font-variant-numeric: tabular-nums;
  color: var(--texte-doux);
}

.tuile-compte + .tuile-compte::before {
  content: "·";
  margin-right: var(--espace-3);
  color: var(--bord-fort);
}

/* Panneau de porte : icône et nom au centre, rien d'autre. */
.tuile-porte {
  align-items: center;
  justify-content: stretch;
  text-align: center;
  padding-bottom: var(--espace-8);
}

.tuile-coeur {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--espace-3);
  flex: 1;
  width: 100%;
}

.tuile-porte .tuile-icone,
.tuile-porte .tuile-ajout-signe {
  margin-bottom: 0;
}

.tuile-porte .tuile-pied {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--espace-3);
  justify-content: center;
  margin: 0;
  padding: 0;
  opacity: 0.45;
}

.tuile-porte:hover .tuile-pied,
.tuile-porte.est-survol .tuile-pied {
  opacity: 0.7;
}

/* La tuile qui ouvre un domaine : même gabarit, trait discontinu, elle
   se lit comme une place à prendre et non comme un espace existant. */
.tuile-ajout {
  justify-content: center;
  background: transparent;
  border-style: dashed;
  border-color: var(--bord-fort);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.tuile-ajout::after,
.tuile-ajout::before {
  display: none;
}

.tuile-ajout .tuile-nom,
.tuile-ajout .tuile-apercu {
  color: var(--texte-doux);
}

.tuile-ajout-signe {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--espace-8);
  height: var(--espace-8);
  margin-bottom: var(--espace-1);
  border-radius: var(--rayon-m);
  border: var(--filet) dashed var(--bord-fort);
  color: var(--texte-doux);
}

.tuile-ajout-signe svg {
  width: var(--espace-4);
  height: var(--espace-4);
}

.tuile-ajout:hover {
  border-style: solid;
  border-color: var(--verre-bord);
  background: var(--verre);
  box-shadow: inset 0 var(--filet) 0 var(--arete);
}

.tuile-ajout:hover .tuile-nom {
  color: var(--texte);
}

.tuile-ajout:hover .tuile-ajout-signe {
  border-style: solid;
  border-color: rgba(var(--lueur-chaude-rvb), 0.45);
  color: var(--lueur-chaude);
}

.tuile-activite {
  display: inline-flex;
  align-items: center;
  gap: var(--espace-2);
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
  font-variant-numeric: tabular-nums;
  color: var(--texte-doux);
}

.temoin {
  width: var(--espace-1);
  height: var(--espace-1);
  background: var(--lueur-chaude);
  border-radius: var(--rayon-plein);
}

.tuile:hover,
.tuile.est-survol {
  color: inherit;
  background: color-mix(in srgb, var(--verre) 40%, rgba(255, 255, 255, 0.07));
  border-color: var(--verre-bord);
  box-shadow: inset 0 var(--filet) 0 var(--arete-forte);
}

.tuile:hover::before,
.tuile.est-survol::before {
  opacity: 1;
}

.tuile:hover::after,
.tuile.est-survol::after {
  opacity: 1;
}

.tuile:hover .tuile-icone {
  background: rgba(var(--lueur-chaude-rvb), 0.2);
}

@media (prefers-reduced-motion: reduce) {
  .tuile,
  .tuile:hover {
    transition: none;
  }
}

.tuile:focus-visible,
.tuile.est-focus {
  outline: var(--anneau) solid var(--lueur-chaude);
  outline-offset: var(--anneau);
}

.tuile:active,
.tuile.est-presse {
  background: color-mix(in srgb, var(--verre) 70%, var(--surface-1));
  box-shadow: inset 0 var(--filet) 0 var(--arete);
}

.tuile.est-desactive,
.tuile[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}

.tuile.en-cours {
  opacity: 0.7;
}

/* --- Carte, zone --- */

.carte,
.zone {
  background: var(--surface-2);
  border: var(--filet) solid var(--bord);
  border-radius: var(--rayon-m);
  box-shadow: inset 0 var(--filet) 0 var(--arete);
}

.carte {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--espace-3);
  padding: var(--espace-5);
}

/* Un titre de carte : dit ce que règle le bloc, sans peser. */
.carte-titre {
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
  color: var(--texte-doux);
}

/* Un bouton dans une carte en colonne s'étirait sur toute sa largeur :
   « Désactiver » faisait 940 px de long. */
.carte > .bouton,
.carte > .bouton-discret,
.carte > .actions {
  align-self: flex-start;
}

.zone {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--espace-4);
  padding: var(--espace-6);
}

.zone-vide {
  background: var(--surface-1);
  box-shadow: none;
}

.zone-erreur {
  box-shadow:
    inset 0 var(--filet) 0 var(--arete),
    inset var(--espace-1) 0 0 var(--lueur-chaude);
}

/* --- Champ : six états --- */

.champ {
  display: flex;
  flex-direction: column;
  gap: var(--espace-2);
}

.champ label {
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
  color: var(--texte-doux);
}

.champ input,
.champ textarea,
.champ select {
  width: 100%;
  padding: var(--espace-2) var(--espace-3);
  color: var(--texte);
  font: inherit;
  font-size: var(--texte-s);
  background: var(--surface-1);
  border: var(--filet) solid var(--bord);
  border-radius: var(--rayon-s);
  appearance: none;
  transition: border-color var(--duree-rapide) var(--courbe-sortie), background-color var(--duree-rapide) var(--courbe-sortie);
}

.champ textarea {
  min-height: var(--zone-saisie);
  resize: vertical;
}

.champ input::placeholder,
.champ textarea::placeholder {
  color: var(--texte-doux);
}

.champ input:hover,
.champ textarea:hover,
.champ select:hover,
.champ.est-survol input {
  background: var(--surface-2);
  border-color: var(--bord-fort);
}

.champ input:focus-visible,
.champ textarea:focus-visible,
.champ select:focus-visible,
.champ.est-focus input {
  background: var(--surface-2);
  border-color: var(--lueur-chaude);
}

.champ.est-presse input {
  background: var(--surface-0);
}

.champ input:disabled,
.champ textarea:disabled,
.champ.est-desactive input {
  opacity: 0.4;
}

.champ.en-cours input {
  opacity: 0.7;
}

.champ-erreur input,
.champ-erreur textarea {
  border-color: var(--lueur-chaude);
}

.champ-aide {
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
  color: var(--texte-doux);
}

/* --- Boutons : six états --- */

.bouton,
.bouton-discret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--espace-2);
  padding: var(--espace-2) var(--espace-4);
  font-family: inherit;
  font-size: var(--texte-s);
  font-weight: var(--poids-meta);
  line-height: 1.3;
  border-radius: var(--rayon-s);
  cursor: pointer;
  transition:
    background-color var(--duree-rapide) var(--courbe-sortie),
    color var(--duree-rapide) var(--courbe-sortie),
    border-color var(--duree-rapide) var(--courbe-sortie),
    box-shadow var(--duree-rapide) var(--courbe-sortie);
}

.bouton {
  color: var(--texte);
  background: var(--surface-3);
  border: var(--filet) solid var(--bord-fort);
  box-shadow: inset 0 var(--filet) 0 var(--arete);
}

.bouton-principal {
  color: var(--surface-0);
  background: var(--lueur-chaude);
  border: var(--filet) solid var(--lueur-chaude);
  box-shadow: none;
}

.bouton-discret {
  color: var(--texte-doux);
  background: transparent;
  border: var(--filet) solid transparent;
}

/* Un bouton posé sur une balise <a> restait souligné : il se lisait
   comme un lien de navigation, pas comme une commande. */
a.bouton,
a.bouton-discret {
  text-decoration: none;
}

.bouton svg,
.bouton-discret svg {
  flex: none;
  width: 1em;
  height: 1em;
  opacity: 0.85;
}

.bouton:hover,
.bouton.est-survol {
  border-color: var(--bord-fort);
  box-shadow: inset 0 var(--filet) 0 var(--arete-forte);
}

.bouton-principal:hover,
.bouton-principal.est-survol {
  background: var(--lueur-chaude);
  border-color: var(--lueur-chaude);
  box-shadow: 0 0 0 var(--anneau) rgba(var(--lueur-chaude-rvb), 0.35);
  filter: brightness(1.08);
}

.bouton-discret:hover,
.bouton-discret.est-survol {
  color: var(--texte);
  background: var(--surface-2);
  border-color: var(--bord);
}

.bouton:focus-visible,
.bouton-discret:focus-visible,
.bouton.est-focus,
.bouton-discret.est-focus {
  outline: var(--anneau) solid var(--lueur-chaude);
  outline-offset: var(--anneau);
}

.bouton:active,
.bouton.est-presse {
  background: var(--surface-1);
  box-shadow: none;
  transition-duration: var(--duree-rapide);
  transition-timing-function: var(--courbe-entree);
}

.bouton-principal:active,
.bouton-principal.est-presse {
  background: var(--lueur-chaude);
  border-color: var(--lueur-chaude);
  filter: brightness(0.92);
  box-shadow: none;
}

.bouton-discret:active,
.bouton-discret.est-presse {
  color: var(--texte);
  background: var(--surface-1);
}

.bouton:disabled,
.bouton-discret:disabled,
.bouton.est-desactive,
.bouton-discret.est-desactive {
  opacity: 0.4;
  pointer-events: none;
}

.bouton.en-cours,
.bouton-discret.en-cours {
  opacity: 0.7;
  cursor: wait;
}

/* --- Fil d'Ariane, étiquette --- */

/* Le fil reste sur une ligne et glisse s'il est trop long. Replié, il
   se dépliait sur quatre lignes par-dessus les boutons du bandeau. */
.fil-ariane {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
  list-style: none;
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
  color: var(--texte-doux);
  scrollbar-width: none;
}

.fil-ariane::-webkit-scrollbar {
  display: none;
}

.fil-ariane a {
  color: inherit;
  text-decoration: none;
}

.fil-ariane a:hover {
  color: var(--texte);
}

.fil-ariane li {
  display: flex;
  flex: none;
  align-items: center;
  white-space: nowrap;
}

.fil-ariane li:not(:last-child)::after {
  content: "›";
  margin-inline: var(--espace-2);
  color: var(--texte-doux);
}

.fil-ariane li:last-child {
  color: var(--texte);
}

.etiquette {
  display: inline-flex;
  align-items: center;
  padding: var(--espace-1) var(--espace-2);
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
  color: var(--texte-doux);
  background: var(--surface-1);
  border: var(--filet) solid var(--bord);
  border-radius: var(--rayon-plein);
}

/* --- Code, tableau, avertissement --- */

.bloc-code,
pre,
code {
  font-family: var(--police-code);
}

code {
  font-size: 0.9em;
}

/* --- Typographie du contenu d'une fiche ---
   Le rendu serveur ne laisse passer que b, i, u, mark, code, a et br :
   aucune classe de l'utilisateur n'atteint le navigateur. C'est donc
   ici, et nulle part ailleurs, qu'on habille ces balises. */
.colonne-lecture code,
.fiche-corps-lecture code {
  padding: 0.1em 0.35em;
  font-family: var(--police-code);
  font-size: 0.9em;
  background: var(--surface-1);
  border: var(--filet) solid var(--bord);
  border-radius: var(--rayon-s);
}

/* Le surligneur du navigateur est un jaune criard sur texte noir.
   Il prend l'ambre de la maison, et garde la couleur du texte. */
.colonne-lecture mark,
.fiche-corps-lecture mark {
  padding: 0.05em 0.2em;
  color: inherit;
  background: rgba(var(--lueur-chaude-rvb), 0.26);
  border-radius: var(--rayon-s);
}

.colonne-lecture u,
.fiche-corps-lecture u {
  text-decoration-thickness: var(--filet);
  text-underline-offset: 0.22em;
}

/* Un lien dans une fiche se voit : c'est souvent la suite de la
   procédure. Il prend l'unique couleur d'accent. */
.fiche-corps-lecture a,
.fiche-citation a,
.encadre-avertissement a {
  color: var(--lueur-chaude);
  text-decoration-color: rgba(var(--lueur-chaude-rvb), 0.45);
  text-underline-offset: 0.2em;
}

.fiche-corps-lecture a:hover {
  color: var(--lueur-chaude);
  text-decoration-color: var(--lueur-chaude);
}

/* Un titre long se coupe ; l'adresse complète reste au survol
   (attribut title) et dans le lien. */
.lien-texte {
  overflow-wrap: anywhere;
}

.fiche-lien .lien-texte {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* Cases à cocher d'une procédure. La case du navigateur est un carré
   gris clair, illisible sur le fond profond : on la redessine. Cochée,
   la ligne s'efface un peu — on voit d'un coup ce qui reste à faire. */
.fiche-liste-taches input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 1.1em;
  height: 1.1em;
  margin: 0;
  background: var(--surface-1);
  border: var(--filet) solid var(--bord-fort);
  border-radius: var(--rayon-s);
}

.fiche-liste-taches input[type="checkbox"]:checked {
  background: var(--lueur-chaude);
  border-color: var(--lueur-chaude);
}

.fiche-liste-taches input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 0.3em;
  top: 0.12em;
  width: 0.28em;
  height: 0.55em;
  border: solid var(--surface-0);
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

.fiche-liste-taches label:has(input:checked) {
  color: var(--texte-doux);
  text-decoration: line-through;
  text-decoration-color: var(--bord-fort);
}

/* Pièce jointe : une carte qu'on repère, pas un lien perdu dans le
   texte. Le trombone vient du CSS, le rendu serveur reste sobre. */
.fiche-fichier {
  display: flex;
  align-items: center;
  gap: var(--espace-3);
  padding: var(--espace-3) var(--espace-4);
  background: var(--surface-1);
  border: var(--filet) solid var(--bord);
  border-radius: var(--rayon-m);
}

.fiche-fichier::before {
  content: "";
  flex: none;
  width: var(--espace-5);
  height: var(--espace-5);
  background: currentColor;
  color: var(--texte-doux);
  -webkit-mask: var(--icone-trombone) center / contain no-repeat;
  mask: var(--icone-trombone) center / contain no-repeat;
}

.fiche-fichier--pdf::before {
  -webkit-mask: var(--icone-pdf) center / contain no-repeat;
  mask: var(--icone-pdf) center / contain no-repeat;
}

.fiche-fichier--powerpoint::before {
  -webkit-mask: var(--icone-powerpoint) center / contain no-repeat;
  mask: var(--icone-powerpoint) center / contain no-repeat;
}

.fiche-fichier--excel::before {
  -webkit-mask: var(--icone-excel) center / contain no-repeat;
  mask: var(--icone-excel) center / contain no-repeat;
}

.fiche-fichier--word::before {
  -webkit-mask: var(--icone-word) center / contain no-repeat;
  mask: var(--icone-word) center / contain no-repeat;
}

.fiche-fichier a {
  font-weight: var(--poids-meta);
  text-decoration: none;
}

.fiche-fichier a:hover {
  text-decoration: underline;
}

.fiche-lien {
  transition: border-color var(--duree-rapide) var(--courbe-sortie);
}

.fiche-lien:hover {
  border-color: rgba(var(--lueur-chaude-rvb), 0.35);
}

/* Marque d'un lien qui part ailleurs : une icône à côté, pas une
   flèche collée au mot. Le trombone des pièces jointes est le même
   geste — un pictogramme en masque, posé par la charte. */
.lien-externe-marque {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 0.4em;
  vertical-align: 0.08em;
  background: currentColor;
  opacity: 0.55;
  -webkit-mask: var(--icone-lien-externe) center / contain no-repeat;
  mask: var(--icone-lien-externe) center / contain no-repeat;
}

a.lien-externe:hover .lien-externe-marque,
a.lien-externe.est-survol .lien-externe-marque {
  opacity: 0.9;
}

a.lien-externe:focus-visible .lien-externe-marque,
a.lien-externe.est-focus .lien-externe-marque {
  opacity: 1;
}

a.lien-externe:active .lien-externe-marque,
a.lien-externe.est-presse .lien-externe-marque {
  opacity: 0.7;
}

/* Repère du geste sur une pièce jointe : s'ouvre ou se télécharge,
   sans bouton supplémentaire. Même langage que le départ externe. */
.piece-geste {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 0.4em;
  vertical-align: 0.08em;
  background: currentColor;
  opacity: 0.55;
}

.piece-geste-ouvre {
  -webkit-mask: var(--icone-lien-externe) center / contain no-repeat;
  mask: var(--icone-lien-externe) center / contain no-repeat;
}

.piece-geste-telecharge {
  -webkit-mask: var(--icone-telecharge) center / contain no-repeat;
  mask: var(--icone-telecharge) center / contain no-repeat;
}

.bloc-code,
pre.bloc-code {
  padding: var(--espace-4);
  overflow-x: auto;
  font-size: var(--texte-s);
  font-weight: var(--poids-corps);
  line-height: 1.6;
  color: var(--texte);
  background: var(--surface-1);
  border: var(--filet) solid var(--bord);
  border-radius: var(--rayon-m);
}

.tableau {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--texte-s);
}

.tableau th,
.tableau td {
  padding: var(--espace-3) var(--espace-4);
  text-align: left;
  vertical-align: baseline;
  border-bottom: var(--filet) solid var(--bord);
}

.tableau th {
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
  color: var(--texte-doux);
}

.tableau .alignee-droite {
  text-align: right;
}

.tableau .alignee-droite form,
.tableau .alignee-droite .bouton-discret {
  margin-left: auto;
}

/* Un état se lit d'un coup d'œil : une pastille, pas un mot perdu dans
   une colonne. */
.etat {
  display: inline-flex;
  align-items: center;
  gap: var(--espace-2);
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
  color: var(--texte-doux);
}

.etat::before {
  content: "";
  width: var(--espace-2);
  height: var(--espace-2);
  border-radius: var(--rayon-plein);
  background: var(--texte-doux);
}

.etat.est-actif {
  color: var(--texte);
}

.etat.est-actif::before {
  background: var(--lueur-chaude);
}

/* Une entrée de liste qui ne mène nulle part garde l'alignement des
   entrées cliquables, sans en prendre l'apparence. */
.entree-inerte {
  display: inline-flex;
  align-items: center;
  gap: var(--espace-3);
  min-width: 0;
  color: var(--texte);
}

.entree-inerte > svg {
  flex: none;
  color: var(--texte-doux);
}

.tableau td.nombre,
.tableau .nombre {
  font-variant-numeric: tabular-nums;
  font-family: var(--police-code);
  font-size: var(--texte-s);
}

.tableau tbody tr:last-child th,
.tableau tbody tr:last-child td {
  border-bottom: 0;
}

.encadre-avertissement {
  padding: var(--espace-4) var(--espace-4) var(--espace-4) var(--espace-5);
  background: var(--surface-2);
  border: var(--filet) solid var(--bord);
  border-radius: var(--rayon-m);
  box-shadow: inset var(--espace-1) 0 0 var(--lueur-chaude);
}

.encadre-avertissement strong {
  display: block;
  margin-bottom: var(--espace-2);
  font-weight: var(--poids-titre);
}

/* --- Listes de navigation --- */

/* Une liste de navigation remplit la colonne de sa page, qui est déjà
   bornée : elle s'aligne ainsi sur le titre et sur les commandes de
   l'en-tête, au lieu de s'arrêter 200 px avant eux. */
.page-application > .zone-vide {
  max-width: var(--mesure);
}

.liste-nav {
  list-style: none;
  background: var(--surface-2);
  border: var(--filet) solid var(--bord);
  border-radius: var(--rayon-m);
  box-shadow: inset 0 var(--filet) 0 var(--arete);
  overflow: hidden;
}

.liste-nav li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--espace-4);
  padding: var(--espace-3) var(--espace-4);
  border-top: var(--filet) solid var(--bord);
}

.liste-nav li:first-child {
  border-top: none;
}

/* Une entrée : l'icône à gauche, le libellé, et sous lui la précision
   — chemin de la fiche, extrait de recherche. Une seule règle pour
   l'accueil, les rubriques et les résultats de recherche. */
.liste-nav a {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: var(--espace-3);
  row-gap: var(--espace-1);
  /* L'entrée occupe la place laissée par le compteur : sans cela, une
     ligne à trois éléments — poignée, nom, compteur — centrait le nom
     au milieu du vide. */
  flex: 1;
  min-width: 0;
  font-weight: var(--poids-meta);
  text-decoration: none;
}

.liste-nav a:has(> .meta) > svg {
  grid-row: span 2;
  align-self: start;
  margin-top: 0.15em;
}

.liste-nav a > .meta {
  grid-column: 2;
  font-weight: var(--poids-corps);
}

/* L'icône dit le genre de l'entrée — dossier ou fiche — sans un mot de
   plus, et s'efface derrière le libellé. */
.liste-nav a > svg {
  flex: none;
  color: var(--texte-doux);
}

.liste-nav li:hover a > svg {
  color: var(--lueur-chaude);
}

.liste-nav li:hover {
  background: var(--surface-3);
}

.liste-nav a:hover {
  color: var(--texte);
}

.liste-nav .compte {
  flex: none;
  white-space: nowrap;
  color: var(--texte-doux);
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
}

.compte-precision {
  display: block;
  font-weight: var(--poids-corps);
  opacity: 0.72;
}

/* Arbre des rubriques : premier niveau visible, enfants repliés.
   Le chevron et le nom sont deux contrôles distincts. */
.liste-nav > .arbre-item {
  display: block;
  padding: 0;
}

.liste-nav > .arbre-item:hover {
  background: transparent;
}

.arbre-ligne {
  display: flex;
  align-items: center;
  gap: var(--espace-2);
  padding: var(--espace-3) var(--espace-4);
}

.arbre-ligne:hover,
.arbre-ligne.est-survol {
  background: var(--surface-3);
}

.arbre-ligne:focus-within {
  background: var(--surface-3);
}

.arbre-enfants {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: var(--filet) solid var(--bord);
}

.arbre-enfants > li {
  display: block;
  padding: 0;
  border-top: var(--filet) solid var(--bord);
}

.arbre-enfants > li:first-child {
  border-top: none;
}

.arbre-enfants .arbre-ligne {
  padding-left: var(--espace-8);
}

.arbre-enfants .arbre-enfants .arbre-ligne {
  padding-left: var(--espace-16);
}

.arbre-chevron {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--espace-6);
  height: var(--espace-6);
  padding: 0;
  color: var(--texte-doux);
  background: transparent;
  border: var(--filet) solid transparent;
  border-radius: var(--rayon-s);
  cursor: pointer;
}

.arbre-chevron-place {
  flex: none;
  width: var(--espace-6);
  height: var(--espace-6);
}

.arbre-chevron-glyphe {
  display: block;
  font-size: var(--texte-s);
  line-height: 1;
  transform: rotate(0deg);
  transition: transform var(--duree-pose) var(--courbe-sortie);
}

.arbre-chevron[aria-expanded="true"] .arbre-chevron-glyphe {
  transform: rotate(90deg);
}

.arbre-chevron:hover,
.arbre-chevron.est-survol {
  color: var(--texte);
  background: var(--surface-2);
}

.arbre-chevron:focus-visible,
.arbre-chevron.est-focus {
  outline: var(--anneau) solid var(--lueur-chaude);
  outline-offset: var(--anneau);
}

.arbre-chevron:active,
.arbre-chevron.est-presse {
  background: var(--surface-0);
}

.arbre-chevron[aria-expanded="true"] {
  color: var(--lueur-chaude);
}

.arbre-chevron[aria-expanded="true"]:hover,
.arbre-chevron[aria-expanded="true"].est-survol {
  color: var(--lueur-chaude);
  background: var(--surface-2);
}

.arbre-chevron:disabled,
.arbre-chevron.est-desactive,
.arbre-chevron[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}

/* --- Lecture + rail --- */

.fiche-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--espace-4);
}

.lecture {
  display: grid;
  grid-template-columns: minmax(0, var(--mesure)) minmax(var(--rail-min), 1fr);
  column-gap: var(--espace-12);
  row-gap: var(--espace-8);
  align-items: start;
}

.colonne-lecture {
  display: flex;
  flex-direction: column;
  gap: var(--espace-6);
  min-width: 0;
}

.fiche-corps-lecture,
.fiche-corps {
  display: flex;
  flex-direction: column;
  gap: var(--espace-6);
  min-width: 0;
}

.fiche-corps-lecture > .bloc,
.fiche-corps > .bloc {
  min-width: 0;
}

.fiche-corps-lecture .bloc > :is(h2, h3),
.fiche-corps .bloc > :is(h2, h3) {
  margin: 0;
}

.fiche-corps-lecture .bloc > :is(ul, ol),
.fiche-corps .bloc > :is(ul, ol) {
  padding-left: 1.25em;
}

.fiche-corps-lecture .bloc :is(ul, ol) :is(ul, ol),
.fiche-corps .bloc :is(ul, ol) :is(ul, ol) {
  margin-top: var(--espace-2);
  padding-left: 1.25em;
}

.fiche-corps-lecture .encadre-avertissement,
.fiche-corps .encadre-avertissement {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--espace-3);
}

.fiche-corps-lecture .encadre-avertissement :is(ul, ol),
.fiche-corps .encadre-avertissement :is(ul, ol) {
  padding-left: 1.25em;
}

.fiche-corps-lecture .bloc + .bloc > .bloc-code,
.fiche-corps .bloc + .bloc > .bloc-code {
  box-shadow: inset 0 var(--filet) 0 var(--arete);
}

.rail {
  position: sticky;
  top: var(--espace-6);
  display: flex;
  flex-direction: column;
  gap: var(--espace-4);
  min-width: 0;
}

.rail-sommaire,
.rail-voisines {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--espace-1);
}

.rail-sommaire a,
.rail-voisines a {
  display: block;
  padding: var(--espace-1) var(--espace-3);
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
  color: var(--texte-doux);
  text-decoration: none;
  border-radius: var(--rayon-s);
}

.rail-sommaire a:hover,
.rail-voisines a:hover {
  color: var(--texte);
}

.rail-sommaire a.actif {
  color: var(--lueur-chaude);
  box-shadow: inset var(--espace-1) 0 0 var(--lueur-chaude);
}

.rail-sommaire a.sommaire-piece::before {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.4em;
  vertical-align: -0.05em;
  background: currentColor;
  opacity: 0.55;
  -webkit-mask: var(--icone-trombone) center / contain no-repeat;
  mask: var(--icone-trombone) center / contain no-repeat;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--espace-3);
}

/* --- Catalogue /_socle --- */

.catalogue {
  display: flex;
  flex-direction: column;
  gap: var(--espace-16);
}

.catalogue-intro {
  display: flex;
  flex-direction: column;
  gap: var(--espace-6);
  padding-top: var(--espace-4);
}

.catalogue-titre {
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
  color: var(--texte-doux);
}

.catalogue-bloc {
  display: flex;
  flex-direction: column;
  gap: var(--espace-4);
}

.echelle-surfaces {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--espace-4);
}

.nuancier {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: var(--nuancier-hauteur);
  padding: var(--espace-3);
  font-size: var(--texte-xs);
  font-weight: var(--poids-meta);
  color: var(--texte-doux);
  border: var(--filet) solid var(--bord);
  border-radius: var(--rayon-m);
}

.nuancier-0 {
  background: var(--surface-0);
}

.nuancier-1 {
  background: var(--surface-1);
}

.nuancier-2 {
  background: var(--surface-2);
  box-shadow: inset 0 var(--filet) 0 var(--arete);
}

.nuancier-3 {
  background: var(--surface-3);
  box-shadow: inset 0 var(--filet) 0 var(--arete-forte);
}

.echelle-type {
  display: flex;
  flex-direction: column;
  gap: var(--espace-4);
}

.rangee-etats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--espace-4);
}

.rangee-etats .champ {
  flex: 1;
  min-width: 12.5rem;
}

@media (max-width: 832px) { /* 208 × 4 : lecture empilée */
  .lecture {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
  }

  .echelle-surfaces {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .entete {
    padding-block: var(--espace-4);
  }

  h1 {
    font-size: var(--titre-m);
    letter-spacing: var(--approche-m);
  }

  .fiche-entete {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .halo {
    animation: none;
    opacity: 0.55;
  }

  .tuile,
  .bouton,
  .bouton-discret,
  .bouton-principal,
  .champ input,
  .champ textarea,
  .champ select,
  .barre-recherche,
  .arbre-chevron-glyphe {
    transition: none;
    filter: none;
  }
}
