/*
 * Obsidian ID : feuille de style unique (la CSP interdit les styles en ligne).
 * Jetons repris de Paper « Obsidian OS — Design », page Fondations (8 nov. 2026) :
 * fond blanc, surface grise #F6F6F5, texte noir obsidienne #211D19, texte
 * secondaire taupe foncé #6B635A (5,9:1), vert Laurier réservé au succès.
 * Mode clair ou sombre : celui de l'appareil par défaut (décision R4 du 8 nov.), ou
 * celui choisi dans « Mon compte » (demande de Gwendal du 13 nov. 2026) : le serveur
 * pose alors data-theme="clair" ou "sombre" sur <html> (src/http/theme.ts).
 */

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/plus-jakarta-sans.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --fond: #ffffff;
  --surface: #f6f6f5;
  --eleve: #ffffff;
  --texte: #211d19;
  --texte-2: #6b635a;
  --texte-3: #8a7f72;
  --trait: rgb(33 29 25 / 10%);
  --trait-fort: rgb(33 29 25 / 18%);
  --survol: rgb(33 29 25 / 5%);
  --selection: rgb(33 29 25 / 8%);
  --accent: #3e5d3e;
  --accent-fond: #e8ece8;
  --ambre: #7d5f1c;
  --ambre-fond: #f5ebd7;
  --erreur: #8f4436;
  --erreur-fond: #f2e9e7;
  --ardoise: #4a6482;
  --ardoise-fond: #e4eaf0;
  --neutre-fond: #f0efee;
  --bouton: #211d19;
  --bouton-texte: #ffffff;
  --voile: rgb(33 29 25 / 25%);
  --danger: #8f4436;
  --danger-texte: #ffffff;
  --interrupteur-eteint: rgb(33 29 25 / 18%);
  --rayon-sm: 6px;
  --rayon: 8px;
  --rayon-md: 10px;
  --rayon-lg: 14px;
  --police: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* Sombre : l'appareil le demande et rien n'a été choisi, ou « Sombre » a été choisi. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='clair']) {
    color-scheme: dark;
    --fond: #1c1a17;
    --surface: #24211e;
    --eleve: #2c2925;
    --texte: #f0ece6;
    --texte-2: #a9a29a;
    --texte-3: #7a736b;
    --trait: rgb(240 236 230 / 12%);
    --trait-fort: rgb(240 236 230 / 22%);
    --survol: rgb(240 236 230 / 6%);
    --selection: rgb(240 236 230 / 10%);
    --accent: #89b389;
    --accent-fond: rgb(137 179 137 / 16%);
    --ambre: #d9b565;
    --ambre-fond: rgb(217 181 101 / 15%);
    --erreur: #e0907f;
    --erreur-fond: rgb(224 144 127 / 15%);
    --ardoise: #9db3cc;
    --ardoise-fond: rgb(157 179 204 / 15%);
    --neutre-fond: rgb(240 236 230 / 8%);
    --bouton: #f0ece6;
    --bouton-texte: #1c1a17;
    --voile: rgb(0 0 0 / 45%);
  --danger: #b4594a;
  --interrupteur-eteint: rgb(240 236 230 / 22%);
  }
}

:root[data-theme='sombre'] {
  color-scheme: dark;
  --fond: #1c1a17;
  --surface: #24211e;
  --eleve: #2c2925;
  --texte: #f0ece6;
  --texte-2: #a9a29a;
  --texte-3: #7a736b;
  --trait: rgb(240 236 230 / 12%);
  --trait-fort: rgb(240 236 230 / 22%);
  --survol: rgb(240 236 230 / 6%);
  --selection: rgb(240 236 230 / 10%);
  --accent: #89b389;
  --accent-fond: rgb(137 179 137 / 16%);
  --ambre: #d9b565;
  --ambre-fond: rgb(217 181 101 / 15%);
  --erreur: #e0907f;
  --erreur-fond: rgb(224 144 127 / 15%);
  --ardoise: #9db3cc;
  --ardoise-fond: rgb(157 179 204 / 15%);
  --neutre-fond: rgb(240 236 230 / 8%);
  --bouton: #f0ece6;
  --bouton-texte: #1c1a17;
  --voile: rgb(0 0 0 / 45%);
  --danger: #b4594a;
  --interrupteur-eteint: rgb(240 236 230 / 22%);
}

:root[data-theme='clair'] {
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: anywhere;
}

a {
  color: inherit;
}

h1 {
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}

h2 {
  font-size: 20px;
  line-height: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

p {
  margin: 0;
}

code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.92em;
}

.texte-secondaire {
  color: var(--texte-2);
}

.texte-discret {
  color: var(--texte-3);
  font-size: 13px;
}

.texte-erreur {
  color: var(--erreur);
}

.icone {
  flex-shrink: 0;
}

/* ---------- Écrans de connexion (M1 à M8) ---------- */

.corps-carte {
  min-height: 100vh;
  min-height: 100dvh;
}

.ecran-carte {
  max-width: 440px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 24px 48px;
}

.marque {
  padding: 8px 0 40px;
}

.logo {
  display: inline-flex;
}

.logo img {
  display: block;
  height: 18px;
  width: auto;
}

/* Deux logos, un par thème : choisis en CSS pour suivre aussi le thème choisi dans « Mon compte ». */
.logo-sombre {
  display: none !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='clair']) .logo-clair {
    display: none !important;
  }
  :root:not([data-theme='clair']) .logo-sombre {
    display: block !important;
  }
}

:root[data-theme='sombre'] .logo-clair {
  display: none !important;
}

:root[data-theme='sombre'] .logo-sombre {
  display: block !important;
}

.carte > h1 + .texte-secondaire,
.carte > .texte-secondaire {
  margin-bottom: 24px;
}

.carte {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.carte > * + * {
  margin-top: 16px;
}

.carte > h1 + * {
  margin-top: 0;
}

.etape {
  color: var(--texte-2);
  font-size: 13px;
  margin-bottom: 12px !important;
}

.pile {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pile-serree {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.champ {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.champ > span,
.champ > legend {
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  padding: 0;
  margin-bottom: 6px;
}

.champ > small,
.champ small {
  color: var(--texte-2);
  font-size: 13px;
}

.champ .erreur-champ {
  color: var(--erreur);
}

input:not([type]),
input[type='text'],
input[type='email'],
input[type='password'],
input[type='search'],
textarea,
select {
  font: inherit;
  font-size: 16px;
  color: var(--texte);
  background: var(--fond);
  border: 1px solid var(--trait-fort);
  border-radius: var(--rayon);
  height: 48px;
  padding: 0 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

textarea {
  height: auto;
  padding: 12px 14px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--texte);
  border-width: 1.5px;
  box-shadow: 0 0 0 3px var(--selection);
}

input[aria-invalid='true'] {
  border-color: var(--erreur);
}

.champ-code {
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
  font-size: 20px !important;
}

.case {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  cursor: pointer;
}

.case input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--texte);
  flex-shrink: 0;
}

.case small {
  display: block;
  color: var(--texte-2);
  font-size: 13px;
}

.bouton {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border-radius: var(--rayon);
  border: 1px solid transparent;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s, opacity 0.12s;
}

.bouton-principal {
  background: var(--bouton);
  color: var(--bouton-texte);
}

.bouton-principal:hover {
  opacity: 0.9;
}

.bouton-secondaire {
  background: var(--fond);
  color: var(--texte);
  border-color: var(--trait-fort);
}

.bouton-secondaire:hover {
  background: var(--survol);
}

.bouton-danger {
  background: var(--erreur);
  color: #fff;
}

.bouton-danger-discret {
  background: var(--fond);
  color: var(--erreur);
  border-color: color-mix(in srgb, var(--erreur) 35%, transparent);
}

.bouton-lien {
  background: none;
  border: 0;
  color: var(--texte-2);
  height: auto;
  padding: 8px 0;
  font-size: 15px;
}

.bouton-petit {
  height: 34px;
  font-size: 14px;
  padding: 0 14px;
}

.pile > .bouton,
.carte > .bouton,
.carte form > .bouton {
  width: 100%;
}

.bouton-google img {
  display: block;
}

.lien-discret {
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--texte-2);
}

.lien-discret a {
  text-decoration: none;
}

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

.separateur {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--texte-2);
  font-size: 13px;
  margin: 24px 0 !important;
}

.separateur::before,
.separateur::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--trait);
}

.message {
  border-radius: var(--rayon);
  padding: 12px 14px;
  font-size: 15px;
}

.message-erreur {
  background: var(--erreur-fond);
  color: var(--erreur);
}

.message-alerte {
  background: var(--ambre-fond);
  color: var(--ambre);
}

.message-info {
  background: var(--surface);
  color: var(--texte);
}

.message-succes {
  background: var(--accent-fond);
  color: var(--accent);
}

.encadre {
  background: var(--surface);
  border-radius: var(--rayon-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.encadre-ambre {
  background: var(--ambre-fond);
  color: var(--ambre);
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

.aide summary {
  cursor: pointer;
  color: var(--texte-2);
  font-weight: 500;
  font-size: 15px;
  text-align: center;
  list-style: none;
}

.aide summary::-webkit-details-marker {
  display: none;
}

.aide p {
  margin-top: 10px;
  color: var(--texte-2);
  font-size: 14px;
}

.code-erreur {
  color: var(--texte-3);
  font-size: 13px;
}

.liste-puces {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Enrôlement (M4 à M6) */

.regles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--texte-2);
  font-size: 14px;
}

.regles li::before {
  content: '·';
  display: inline-block;
  width: 14px;
  color: var(--texte-3);
}

.astuce {
  display: flex;
  gap: 8px;
  color: var(--texte-2);
  font-size: 14px;
}

.etapes-totp {
  margin: 0;
  padding: 0 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.etapes-totp > li > strong {
  display: block;
  margin-bottom: 10px;
}

.etapes-totp > li {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.apps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.apps li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon-md);
  padding: 12px 14px;
  font-weight: 500;
}

.apps a {
  color: var(--texte-2);
  font-size: 14px;
  text-decoration: none;
}

.apps a:first-of-type {
  margin-left: auto;
}

.qr {
  display: block;
  border-radius: var(--rayon);
  border: 1px solid var(--trait);
  background: #fff;
}

.cle-secrete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--rayon-md);
  padding: 12px 14px;
}

.cle-secrete code {
  font-weight: 600;
  letter-spacing: 0.06em;
}

.bouton-icone {
  appearance: none;
  border: 0;
  background: none;
  color: var(--texte-2);
  width: 32px;
  height: 32px;
  cursor: pointer;
  border-radius: var(--rayon-sm);
}

.bouton-icone.copier::before {
  content: '⧉';
  font-size: 18px;
}

.copie {
  color: var(--accent) !important;
}

.codes {
  list-style: none;
  margin: 0;
  padding: 18px;
  background: var(--surface);
  border-radius: var(--rayon-md);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}

.codes code {
  font-size: 16px;
  letter-spacing: 0.06em;
}

.codes li:nth-child(even) {
  text-align: right;
}

.rangee {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.rangee > .bouton {
  flex: 1;
}

.rangee-fin {
  justify-content: flex-end;
}

.rangee-fin > .bouton {
  flex: 0 0 auto;
}

.seulement-ordinateur {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .seulement-mobile {
    display: none;
  }
  .seulement-ordinateur {
    display: block;
  }
}

/* ---------- Console d'ID (D2 à D7, Mon compte) ---------- */

.corps-console > .barre {
  grid-column: 1;
  grid-row: 1;
}

.corps-console > .console {
  grid-column: 2;
  grid-row: 1;
}

.corps-console {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

.barre {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}

.barre-haut {
  padding: 6px 8px 22px;
}

.barre-logo {
  display: inline-flex;
}

.barre-titre {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--texte-2);
  padding: 0 10px 8px;
}

.nav-lien {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--rayon);
  text-decoration: none;
  font-size: 15px;
  color: var(--texte);
}

.nav-lien:hover {
  background: var(--survol);
}

.nav-actif {
  background: var(--selection);
  font-weight: 500;
}

.nav-compteur {
  margin-left: auto;
  color: var(--texte-2);
  font-size: 13px;
}

.nav-discret {
  color: var(--texte-2);
}

.barre-bas {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profil {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 8px;
  border-top: 1px solid var(--trait);
  margin-top: 6px;
  padding-top: 6px;
}

.profil-lien {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 15px;
}

.profil-aide {
  color: var(--texte-2);
  display: inline-flex;
  margin-left: 10px;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bouton);
  color: var(--bouton-texte);
  font-weight: 600;
  flex-shrink: 0;
}

.avatar-petit {
  width: 22px;
  height: 22px;
  font-size: 9px;
}

.avatar-moyen {
  width: 56px;
  height: 56px;
  font-size: 19px;
}

.avatar-grand {
  width: 60px;
  height: 60px;
  font-size: 20px;
}

.console {
  padding: 48px 40px 64px;
  min-width: 0;
  max-width: 1180px;
}

.entete-page {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.entete-fiche .identite {
  display: flex;
  align-items: center;
  gap: 16px;
}

.entete-fiche h1 {
  margin: 0;
}

.fil {
  color: var(--texte-2);
  font-size: 14px;
  margin-bottom: 20px;
}

.fil a {
  text-decoration: none;
}

.filtres {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.recherche {
  height: 38px !important;
  width: 280px !important;
  font-size: 14px !important;
}

.pastille {
  appearance: none;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--trait-fort);
  background: var(--fond);
  color: var(--texte);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  width: auto !important;
}

select.pastille {
  height: 32px;
}

.pastille-active {
  background: var(--bouton);
  color: var(--bouton-texte);
  border-color: var(--bouton);
}

.tableau {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.tableau th {
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  color: var(--texte-2);
  padding: 10px 12px;
  border-bottom: 1px solid var(--trait);
}

.tableau td {
  overflow-wrap: normal;
  word-break: normal;
  padding: 12px;
  border-bottom: 1px solid var(--trait);
  vertical-align: middle;
}

.tableau tbody tr:hover {
  background: var(--survol);
}

.ligne-eteinte td {
  color: var(--texte-2);
}

.lien-personne {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.lien-personne .email,
.email {
  color: var(--texte-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.etiquette {
  display: inline-block;
  font-size: 13px;
  line-height: 18px;
  padding: 2px 8px;
  border-radius: var(--rayon-sm);
  background: var(--neutre-fond);
  color: var(--texte-2);
  white-space: nowrap;
}

.etiquette-ambre {
  background: var(--ambre-fond);
  color: var(--ambre);
}

.etiquette-ardoise {
  background: var(--ardoise-fond);
  color: var(--ardoise);
}

.etiquette-erreur {
  background: var(--erreur-fond);
  color: var(--erreur);
}

.etiquette-succes {
  background: var(--accent-fond);
  color: var(--accent);
}

.vide {
  color: var(--texte-2);
  padding: 24px 12px;
}

.colonne {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.colonne-etroite {
  max-width: 520px;
}

.colonne-formulaire {
  max-width: 560px;
}

.carte-profil {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border-radius: var(--rayon-lg);
  padding: 22px;
}

.titre-profil {
  font-size: 22px;
  line-height: 28px;
  margin: 0 0 4px;
}

.section {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}

.section-titre {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--texte-2);
  font-weight: 500;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--trait);
  margin: 0;
}

.titre-section {
  font-size: 18px;
  margin-bottom: 8px;
}

.ligne {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--trait);
  margin: 0;
}

.ligne-titre {
  font-weight: 500;
}

.ligne-detail {
  color: var(--texte-2);
  font-size: 14px;
}

.lien-action {
  appearance: none;
  background: none;
  border: 0;
  font: inherit;
  color: var(--texte-2);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.lien-action:hover {
  color: var(--texte);
}

.tuiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding-top: 14px;
}

.tuile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon-md);
  text-decoration: none;
  font-weight: 500;
}

.tuile:hover {
  background: var(--survol);
}

.tuile-icone {
  width: 32px;
  height: 32px;
  border-radius: var(--rayon);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.deux-colonnes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.segments {
  display: flex;
  border: 1px solid var(--trait-fort);
  border-radius: var(--rayon);
  overflow: hidden;
}

.segment {
  flex: 1;
  position: relative;
}

.segment input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.segment span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  font-size: 15px;
}

.segment input:checked + span {
  background: var(--bouton);
  color: var(--bouton-texte);
}

.segment input:focus-visible + span {
  box-shadow: inset 0 0 0 2px var(--texte-2);
}

.segments-petits .segment span {
  height: 32px;
  font-size: 14px;
}

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

.pastille-choix {
  position: relative;
}

.pastille-choix input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.pastille-choix span {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--trait-fort);
  font-size: 14px;
}

.pastille-choix input:checked + span {
  background: var(--bouton);
  color: var(--bouton-texte);
  border-color: var(--bouton);
}

.pastille-choix input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--selection);
}

.pied-formulaire {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--trait);
}

.tableau-acces .col-app {
  width: 200px;
}

.tableau-diff {
  border: 1px solid var(--trait);
  border-radius: var(--rayon-md);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.tableau-diff th {
  background: var(--surface);
}

.tableau-diff .avant {
  color: var(--texte-2);
  text-decoration: line-through;
}

.tableau-diff .apres {
  font-weight: 600;
}

.note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface);
  border-radius: var(--rayon-md);
  padding: 14px 16px;
  color: var(--texte);
  font-size: 14px;
  max-width: 760px;
  margin-top: 20px;
}

.bandeau {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: var(--rayon-md);
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 15px;
}

.bandeau-ambre {
  background: var(--ambre-fond);
  color: var(--ambre);
}

.corps-confirmation {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tableau-journal .details {
  font-size: 12px;
  color: var(--texte-2);
  white-space: pre-wrap;
  word-break: break-all;
}

.nowrap {
  white-space: nowrap;
}

.secret {
  font-size: 15px;
  user-select: all;
}

/* Console sur téléphone : la barre passe en haut (M9 se lit sur un téléphone). */
/* ---------- Console v2 (retours de Gwendal du 13 nov. 2026, maquettes Paper « ID · Console v2 ») ----------
 * « Les boutons sont un peu trop gros » : 34 px dans la console (comme HQ), 46 px sur les pages de connexion.
 * « On pourrait avoir des toggles » : `.interrupteur`, un seul par ligne ; les réglages secondaires restent des cases.
 * « Se déconnecter de partout […] une position qui leur est propre » : `.zone`, fond gris, en bas des écrans.
 * Désactiver, « la ligne la plus grave du compte » : `.zone-grave`, avec une infobulle `.bulle`.
 * Code de sécurité « dans une popup » : `.fenetre`, ouverte par le serveur (`.voile`) ou par le navigateur (`popover`).
 */

.corps-console .bouton {
  height: 34px;
  padding: 0 13px;
  font-size: 14px;
  gap: 6px;
  border-radius: 7px;
}

.corps-console .bouton .icone {
  width: 16px;
  height: 16px;
}

.corps-console input:not([type='checkbox']):not([type='radio']):not([type='hidden']),
.corps-console select {
  height: 40px;
  font-size: 15px;
}

.corps-console .champ-code {
  font-size: 18px !important;
}

.bouton-danger {
  background: var(--danger);
  color: var(--danger-texte);
}

.bouton-danger:hover {
  opacity: 0.92;
}

.bouton-discret {
  background: none;
  border-color: transparent;
  color: var(--texte-2);
}

.bouton-discret:hover {
  background: var(--survol);
  color: var(--texte);
}

.retour {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--texte-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 18px;
}

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

.fiche-v2 {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.entete-v2 {
  display: flex;
  align-items: center;
  gap: 16px;
}

.entete-v2 h1 {
  font-size: 24px;
  line-height: 30px;
  margin: 0;
}

.bloc {
  display: flex;
  flex-direction: column;
}

.bloc-titre {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 16px;
  line-height: 22px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 6px;
}

.bloc-titre small {
  font-size: 13px;
  font-weight: 400;
  color: var(--texte-2);
}

.rang {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--trait);
  margin: 0;
}

.bloc > .rang:last-child,
.bloc > form:last-child > .rang:last-child {
  border-bottom: 1px solid var(--trait);
}

.rang-icone {
  width: 20px;
  display: inline-flex;
  justify-content: center;
  color: var(--texte-2);
  flex-shrink: 0;
}

.rang-texte {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.rang-titre {
  font-size: 15px;
  font-weight: 500;
  line-height: 21px;
}

.rang-detail {
  font-size: 13.5px;
  line-height: 19px;
  color: var(--texte-2);
}

.rang-valeur {
  font-size: 15px;
  font-weight: 500;
}

.rang-note {
  font-size: 13px;
  color: var(--texte-3);
  white-space: nowrap;
}

.pied-bloc {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--trait);
}

.pied-bloc .note {
  flex: 1;
  margin: 0;
  padding: 0;
  background: none;
  font-size: 13px;
  color: var(--texte-2);
}

/* Une ligne par app : pastille, nom, réglages, interrupteur. */
.app-rang {
  display: grid;
  grid-template-columns: 28px 130px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--trait);
}

.app-pastille {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.app-nom {
  font-size: 15px;
  font-weight: 500;
  padding-top: 3px;
}

.app-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 3px;
  font-size: 13.5px;
  color: var(--texte-2);
  min-width: 0;
}

.app-detail .segments {
  align-self: flex-start;
  width: auto;
}

.app-detail .segment {
  flex: none;
}

.app-detail .segment span {
  padding: 0 14px;
  height: 30px;
  font-size: 13.5px;
  color: var(--texte);
}

.app-detail .segment input:checked + span {
  color: var(--bouton-texte);
}

.app-detail .pastilles {
  gap: 6px;
}

.app-detail .pastille-choix span {
  font-size: 13px;
}

.bulle-note {
  display: block;
  margin-top: 8px;
  opacity: 0.75;
}

.app-rang .interrupteur {
  margin-top: 4px;
}

/* Texte pour les lecteurs d'écran et les recherches, invisible à l'écran. */
.lisible-seulement {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Cases à cocher de la console : plus petites que l'interrupteur (retour de Gwendal du 13 nov. 2026 : « les checkbox
 * sont trop grosses car elles sont plus grosses que le toggle en fin de ligne »). Dessinées en CSS, coche comprise :
 * la CSP n'admet pas d'image `data:`. */
.corps-console .case {
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.corps-console .case input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  width: 15px;
  height: 15px;
  margin: 0;
  border: 1.5px solid color-mix(in srgb, var(--texte) 35%, transparent);
  border-radius: 4px;
  background: var(--fond);
  cursor: pointer;
  flex-shrink: 0;
}

.corps-console .case input[type='checkbox']:checked {
  background: var(--bouton);
  border-color: var(--bouton);
}

.corps-console .case input[type='checkbox']:checked::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid var(--bouton-texte);
  border-width: 0 1.8px 1.8px 0;
  transform: translateY(-1px) rotate(45deg);
}

.corps-console .case input[type='checkbox']:focus-visible {
  outline: 2px solid var(--texte);
  outline-offset: 2px;
}

/* Réglage secondaire d'une app (Administre ID) : seconde ligne, sous le nom de l'app. */
.app-sous-reglage {
  grid-column: 2 / -1;
  margin-top: -4px;
  color: var(--texte-2);
}

/* Interrupteur : une case à cocher (dans un formulaire) ou un lien vers la confirmation d'un geste. */
.interrupteur {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: var(--interrupteur-eteint);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.interrupteur::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 25%);
  transition: left 0.15s;
}

.interrupteur:checked,
.interrupteur[aria-checked='true'] {
  background: var(--bouton);
}

.interrupteur:checked::before,
.interrupteur[aria-checked='true']::before {
  left: 16px;
  background: var(--fond);
  box-shadow: none;
}

.interrupteur:focus-visible {
  outline: 2px solid var(--texte);
  outline-offset: 2px;
}

/* Zone des sessions et des appareils : à part, sur fond gris, sans contour. */
.zone {
  background: var(--surface);
  border-radius: 12px;
  padding: 4px 18px;
}

.zone .rang:first-child {
  border-top: 0;
}

.zone .rang-separe {
  border-top-color: var(--trait-fort);
}

.etiquette-appareil {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--fond);
  font-size: 12px;
  font-weight: 500;
  color: var(--texte-2);
  vertical-align: 1px;
}

/* Désactiver : la ligne la plus grave du compte. */
.zone-grave {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 12px;
  background: var(--erreur-fond);
}

.zone-grave .rang-icone {
  color: var(--danger);
}

.titre-avec-aide {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Infobulle sans script : au survol ou au focus du « i ». */
.aide-bulle {
  position: relative;
  display: inline-flex;
}

.aide-bulle > button {
  appearance: none;
  border: 0;
  background: none;
  padding: 2px;
  color: var(--texte-2);
  cursor: help;
  display: inline-flex;
  border-radius: 50%;
}

.bulle {
  display: none;
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 8px);
  left: -12px;
  width: 360px;
  max-width: calc(100vw - 48px);
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--texte);
  color: var(--fond);
  font-size: 13px;
  line-height: 19px;
  font-weight: 400;
  box-shadow: 0 6px 20px rgb(0 0 0 / 18%);
}

.bulle strong {
  display: block;
  margin-bottom: 4px;
}

.bulle .liste-puces li::before {
  background: var(--fond);
}

.aide-bulle:hover .bulle,
.aide-bulle:focus-within .bulle {
  display: block;
}

/* Puces visibles (retour de Gwendal du 13 nov. : « le point est ridiculement petit par rapport au texte »). */
.liste-puces {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.liste-puces li {
  position: relative;
  padding-left: 18px;
}

.liste-puces li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--texte);
}

/* Changement de thème fluide (id.js) : fondu de la page entière quand le navigateur sait faire une transition de
 * vue, sinon fondu des couleurs pendant 0,3 s. Rien de tout ça si l'appareil demande moins d'animations. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.28s;
  animation-timing-function: ease;
}

.theme-en-transition,
.theme-en-transition *,
.theme-en-transition *::before {
  transition:
    background-color 0.28s ease,
    color 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease !important;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* Choix du thème : trois boutons d'un même formulaire. */
.choix-theme {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: var(--surface);
  flex-shrink: 0;
}

.choix-theme button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--texte-2);
  cursor: pointer;
}

.choix-theme button[aria-pressed='true'] {
  background: var(--fond);
  color: var(--texte);
  box-shadow: 0 1px 2px rgb(0 0 0 / 12%);
}

.choix-theme .icone {
  width: 14px;
  height: 14px;
}

/* Barre : aide et déconnexion à côté du prénom. */
.profil-icone {
  appearance: none;
  border: 0;
  background: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--texte-2);
  cursor: pointer;
  padding: 0;
}

.profil-icone:hover {
  background: var(--survol);
  color: var(--texte);
}

.profil-lien {
  flex: 1;
}

.profil-forme {
  display: inline-flex;
}

/* Fenêtre de confirmation. Ouverte par le serveur : dans un `.voile`. Ouverte par le navigateur : attribut `popover`. */
.voile {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--voile);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.fenetre {
  width: min(500px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  background: var(--fond);
  color: var(--texte);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgb(0 0 0 / 22%);
  padding: 26px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 14.5px;
  line-height: 22px;
}

.fenetre[popover] {
  border: 0;
  margin: auto;
  inset: 0;
  height: fit-content;
}

.fenetre[popover]:not(:popover-open) {
  display: none;
}

.fenetre[popover]::backdrop {
  background: rgb(33 29 25 / 30%);
}

.fenetre-tete {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fenetre-tete h2 {
  margin: 0;
  font-size: 18px;
  line-height: 24px;
}

.fenetre-pastille {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fenetre-pastille-grave {
  background: var(--erreur-fond);
  color: var(--danger);
}

.fenetre-corps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--texte-2);
}

.fenetre-corps strong {
  color: var(--texte);
}

.fenetre .encadre,
.fenetre .encadre-ambre {
  background: var(--surface);
  color: var(--texte);
}

.fenetre form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fenetre .rangee-fin {
  justify-content: flex-end;
}

/* Navigateur sans `popover` (avant Safari 17) : la fenêtre s'affiche dans le formulaire, avec son propre bouton. */
@supports not selector(:popover-open) {
  .fenetre[popover] {
    display: flex;
    position: static;
    width: auto;
    box-shadow: none;
    padding: 0;
  }
  [popovertarget] {
    display: none !important;
  }
}

@media (max-width: 820px) {
  .corps-console {
    grid-template-columns: 1fr;
  }
  .corps-console > .console {
    grid-column: 1;
    grid-row: 2;
  }
  .barre {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
  }
  .barre-haut {
    padding: 4px 8px 4px 0;
    margin-right: auto;
  }
  .barre-titre,
  .barre-bas .nav-discret {
    display: none;
  }
  .barre-bas {
    margin: 0;
    flex-direction: row;
  }
  .profil {
    border: 0;
    margin: 0;
    padding: 0;
  }
  .nav-lien span:not(.nav-compteur) {
    font-size: 14px;
  }
  .console {
    padding: 24px 20px 48px;
  }
  .entete-page {
    flex-direction: column;
  }
  .tableau {
    display: block;
    overflow-x: auto;
  }
  .deux-colonnes {
    grid-template-columns: 1fr;
  }
}

/* Ajustements après la revue visuelle du 8 nov. (fiche D4) */
.console > .section,
.console > section.section {
  margin-top: 36px;
}
.tableau-acces .segments {
  max-width: 420px;
}
.pied-formulaire .champ,
.colonne-etroite .champ-code {
  max-width: 280px;
}
.pied-formulaire {
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
}
.pied-formulaire .rangee-fin {
  margin-left: auto;
}
.tableau-acces td {
  padding-top: 14px;
  padding-bottom: 14px;
}
.tableau a {
  text-decoration: none;
}
.tableau a:hover {
  text-decoration: underline;
}

/* Parcours « Créer mon accès » (M4 à M6) */
.progression {
  margin-bottom: 20px !important;
}
.progression .etape {
  margin-bottom: 8px !important;
}
.segments-progression {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.segments-progression span {
  height: 4px;
  border-radius: 2px;
  background: var(--trait);
}
.segments-progression span.fait {
  background: var(--texte);
}
.etape-totp {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px !important;
}
.titre-etape {
  font-size: 17px;
  line-height: 22px;
  margin: 0;
}
.carte-app {
  display: grid !important;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px !important;
}
.carte-app-initiale {
  width: 40px;
  height: 40px;
  border-radius: var(--rayon);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--texte-2);
  font-weight: 600;
}
.carte-app-nom {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.carte-app-liens {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.carte-app-liens a,
.apps a:first-of-type {
  margin-left: 0;
}
.bouton-contour {
  background: var(--fond);
  color: var(--texte);
  border: 1.5px solid var(--texte);
  width: 100%;
}
.cle-secrete small {
  display: block;
  color: var(--texte-2);
  font-size: 13px;
}
.visuellement-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Œil « afficher le mot de passe » (M1, M4) */
.champ-mdp {
  position: relative;
  display: block;
}
.champ-mdp input {
  padding-right: 52px;
}
.oeil {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  color: var(--texte-2);
  cursor: pointer;
  border-radius: var(--rayon-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.oeil:hover {
  background: var(--survol);
}
.oeil-ouvert {
  color: var(--texte);
}
.corps-confirmation .encadre-ambre {
  margin-top: 6px;
}
.corps-confirmation .liste-puces {
  margin-top: 8px;
}

@media (max-width: 640px) {
  .app-rang {
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }
  .app-detail {
    grid-column: 2 / 4;
    grid-row: 2;
  }
  .zone-grave,
  .rang {
    flex-wrap: wrap;
  }
  .choix-theme {
    width: 100%;
  }
}
