/* kuromichaeng — feuille de style unique.
   Noir et blanc, Inter partout, en minuscules, sans italique. Thème clair / sombre par variables.
   Attention : --noir = couleur de l'encre et --blanc = couleur des surfaces ; en sombre elles s'inversent. */

:root {
  color-scheme: light;
  --noir: #000;             /* encre : texte, traits */
  --blanc: #fff;            /* surface : cartes, champs */
  --fond: #f6f6f7;          /* fond de page */
  --gris-clair: #e9e9ec;    /* zones neutres, bandeaux de titre */
  --gris-ligne: #d4d4d9;    /* lignes de tableau, filets */
  --gris-texte: #4a4a4f;    /* texte secondaire (8,9:1 sur blanc) */
  --survol: #f0f0f2;
  --voile: rgba(0, 0, 0, 0.4);
  --fleche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E");

  --trait: 1.5px solid var(--noir);
  --trait-fin: 1px solid var(--noir);
  --filet: 1px solid var(--gris-ligne);
  --rayon: 14px;
  --rayon-champ: 10px;
  --rayon-pilule: 999px;

  --e1: 4px; --e2: 8px; --e3: 12px; --e4: 16px; --e5: 24px; --e6: 32px; --e7: 48px;

  --police: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --t-petit: 0.8125rem;
  --t-base: 1rem;
  --t-moyen: 1.125rem;
  --t-h2: 1.125rem;
  --t-h1: clamp(1.625rem, 4vw, 2.25rem);

  --largeur: 1120px;
  --cible: 44px;
  --menu: 232px;
}

/* Thème sombre : fond noir, texte blanc. Suivi du système, sauf choix forcé (data-theme sur <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --noir: #fff; --blanc: #141414; --fond: #141414; --gris-clair: #262628; --gris-ligne: #3a3a3e;
    --gris-texte: #b4b4ba; --survol: #1f1f22; --voile: rgba(0, 0, 0, 0.7);
    --fleche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --noir: #fff; --blanc: #141414; --fond: #141414; --gris-clair: #262628; --gris-ligne: #3a3a3e;
  --gris-texte: #b4b4ba; --survol: #1f1f22; --voile: rgba(0, 0, 0, 0.7);
  --fleche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E");
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--police);
  font-optical-sizing: none; /* coupe « display » d'Inter trop serrée aux grandes tailles */
  font-size: var(--t-base);
  line-height: 1.5;
  color: var(--noir);
  background: var(--fond);
  overflow-x: hidden;
  font-feature-settings: "cv11", "ss01";
}
* { font-style: normal !important; } /* aucun italique, nulle part (y compris le Markdown saisi) */

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

a { color: inherit; text-underline-offset: 3px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--e3); }
h1 { font-size: var(--t-h1); font-weight: 600; letter-spacing: 0; }
h2 { font-size: var(--t-h2); font-weight: 600; letter-spacing: 0; }
h3 { font-size: var(--t-moyen); font-weight: 600; }
p { margin: 0 0 var(--e3); }

:focus-visible {
  outline: 3px solid var(--noir);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--blanc);
}

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

[hidden] { display: none !important; }

/* ---------- Mise en page ---------- */

.page {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: var(--e5) var(--e4) var(--e7);
}
.page--etroite { max-width: 760px; }

.pile > * + * { margin-top: var(--e5); }

.entete-page {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--e3) var(--e4);
  margin-bottom: var(--e5);
}
.entete-page h1 { margin: 0; }

.fil {
  font-size: var(--t-petit);
  color: var(--gris-texte);
  margin-bottom: var(--e2);
}
.fil a { color: var(--noir); font-weight: 600; }

.etoile { font-style: normal; }

.aide { font-size: var(--t-petit); color: var(--gris-texte); margin: var(--e1) 0 0; }
.muet { color: var(--gris-texte); }

/* ---------- En-tête du site ---------- */

.tete {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: var(--e4) var(--e4) 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--e3);
}
.marque {
  font-weight: 600;
 
  font-size: 1.25rem;
  letter-spacing: 0;
  text-decoration: none;
}
.nav { display: flex; flex-wrap: wrap; gap: var(--e2); }
.nav .pill { min-height: 36px; padding: 0 14px; font-size: 0.875rem; text-decoration: none; cursor: pointer; }
.nav .pill[aria-current="page"] { background: var(--noir); color: var(--blanc); }

/* ---------- Fenêtre rétro ---------- */

.fenetre {
  background: var(--blanc);
  border: var(--trait);
  border-radius: var(--rayon);
  overflow: hidden;
  min-width: 0;
}
.fenetre-barre {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: var(--e2);
  padding: 7px 12px;
  border-bottom: var(--trait);
  min-height: 36px;
}
.fenetre-titre {
  grid-column: 2;
  margin: 0;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fenetre-boutons {
  grid-column: 3;
  justify-self: end;
  display: flex;
  gap: 5px;
}
.fenetre-boutons span {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--noir);
  color: var(--blanc);
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  font-weight: 600;
  user-select: none;
}
.fenetre-corps { padding: var(--e4); }
.fenetre-corps > :last-child { margin-bottom: 0; }

/* ---------- Pilules ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: var(--trait-fin);
  border-radius: var(--rayon-pilule);
  background: var(--blanc);
  color: var(--noir);
  padding: 2px 10px;
  font: inherit;
  font-size: var(--t-petit);
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.pill--on::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--noir); }
.pill--off { color: var(--gris-texte); border-style: dashed; }
.pill--plein { background: var(--noir); color: var(--blanc); }
.pills { display: flex; flex-wrap: wrap; gap: var(--e2); align-items: center; }

/* ---------- Badge rond (montants importants) ---------- */

.badge-rond {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 132px;
  height: 132px;
  flex: none;
  border: var(--trait);
  border-radius: 50%;
  background: var(--blanc);
  text-align: center;
  padding: var(--e3);
}
.badge-rond strong {
 
  font-weight: 600;
  font-size: 1.375rem;
  letter-spacing: 0;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.badge-rond small { font-size: 0.75rem; color: var(--gris-texte); }
.badge-rond--petit { width: 96px; height: 96px; }
.badge-rond--petit strong { font-size: 1.0625rem; }

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--e2);
  min-height: var(--cible);
  padding: 0 18px;
  border: var(--trait);
  border-radius: var(--rayon-pilule);
  background: var(--blanc);
  color: var(--noir);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--survol); }
.btn--noir { background: var(--noir); color: var(--blanc); }
.btn--noir:hover { opacity: 0.85; }
.btn--petit { min-height: 36px; padding: 0 12px; font-size: 0.875rem; }
.btn--danger { border-style: dashed; }
.btn--geant { min-height: 60px; padding: 0 28px; font-size: 1.125rem; font-weight: 600; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-icone {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border: var(--trait-fin);
  border-radius: 50%;
  background: var(--blanc);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0;
}
.btn-icone:hover { background: var(--survol); }
.btn-icone:disabled { opacity: 0.35; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: var(--e2); align-items: center; }
.actions--fin { justify-content: flex-end; }

@media (pointer: coarse) {
  .btn--petit, .nav .pill { min-height: var(--cible); }
  .btn-icone { width: var(--cible); height: var(--cible); }
}

/* ---------- Champs ---------- */

.champ { margin-bottom: var(--e4); min-width: 0; }
.champ > label, .etiquette {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: var(--e1);
}
input[type="text"], input[type="search"], input[type="password"], input[type="number"],
input[type="datetime-local"], input[type="date"], input:not([type]), select, textarea {
  width: 100%;
  min-height: var(--cible);
  padding: 8px 12px;
  font: inherit;
  font-size: 1rem; /* 16 px : pas de zoom auto sur iPhone */
  color: var(--noir);
  background: var(--blanc);
  border: var(--trait);
  border-radius: var(--rayon-champ);
}
textarea { min-height: 220px; line-height: 1.5; resize: vertical; font-family: var(--police); }
select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: var(--fleche);
  background-repeat: no-repeat; background-position: right 14px center; }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; accent-color: var(--noir); cursor: pointer; margin: 0; flex: none; }
input[type="range"] { width: 100%; accent-color: var(--noir); }
.case { display: inline-flex; align-items: center; gap: var(--e2); font-weight: 500; cursor: pointer; min-height: var(--cible); }
.grille-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 var(--e4); }

/* ---------- Alertes et toast ---------- */

.alerte {
  border: var(--trait);
  border-radius: var(--rayon-champ);
  background: var(--blanc);
  padding: 10px 14px;
  font-weight: 500;
  margin-bottom: var(--e4);
  display: flex;
  gap: var(--e3);
  align-items: flex-start;
  justify-content: space-between;
}
.alerte--erreur { border-width: 2px; border-style: dashed; }
.alerte--erreur::before { content: "!"; font-weight: 600; flex: none; }
.alerte--info::before { content: "i"; font-weight: 600; flex: none; }
.alerte > span { flex: 1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 100;
  max-width: calc(100vw - 32px);
  background: var(--noir);
  color: var(--blanc);
  padding: 12px 20px;
  border-radius: var(--rayon-pilule);
  font-weight: 600;
  box-shadow: 0 0 0 2px var(--blanc);
  text-align: center;
}

/* ---------- Galerie façon Notion ---------- */

.galerie {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--e5);
}
.carte {
  position: relative;
  background: var(--blanc);
  border: var(--trait);
  border-radius: var(--rayon);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.carte:hover { background: var(--survol); }
.carte:focus-within { outline: 3px solid var(--noir); outline-offset: 2px; }
.carte-couv {
  aspect-ratio: 3 / 2;
  border-bottom: var(--trait);
  overflow: hidden;
}
.carte-couv img { width: 100%; height: 100%; object-fit: cover; }
.carte-corps { padding: var(--e3) var(--e4) var(--e4); display: grid; gap: var(--e2); }
.carte-titre { font-size: 1.0625rem; font-weight: 600; font-style: normal; margin: 0; overflow-wrap: anywhere; }
.carte-lien { text-decoration: none; }
.carte-lien::after { content: ""; position: absolute; inset: 0; } /* toute la carte est cliquable */
.carte-lien:focus-visible { outline: none; box-shadow: none; }
.carte-meta { display: flex; flex-wrap: wrap; gap: var(--e2); align-items: center; font-size: var(--t-petit); color: var(--gris-texte); }
.carte-modif { position: absolute; top: 10px; right: 10px; z-index: 2; }
.carte--ajout {
  border-style: dashed;
  min-height: 200px;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  font-size: 1.0625rem;
  cursor: pointer;
  color: var(--noir);
}
.carte--ajout span { font-size: 2rem; font-weight: 300; line-height: 1; }

/* Fond neutre sans image : aplat gris, sans motif */
.neutre { background-color: var(--gris-clair); }

/* ---------- Tableaux façon tableur ---------- */

.defile { overflow-x: auto; }
.tableur {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9375rem;
}
.tableur th {
  text-align: left;
  font-size: var(--t-petit);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: var(--trait);
  white-space: nowrap;
  background: var(--blanc);
}
.tableur td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--gris-ligne);
  vertical-align: top;
}
.tableur tbody tr:hover td { background: var(--survol); }
.tableur tr:last-child td { border-bottom: 0; }
.tableur .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableur .serre { width: 1%; white-space: nowrap; }
.tableur .serre .actions { flex-wrap: nowrap; }
.tableur .large { min-width: 170px; }
.tableur .champ-date { min-width: 200px; }
.tableur td input, .tableur td select { min-height: 38px; padding: 6px 10px; }
.tableur td select { padding-right: 32px; }
.tableur tfoot td { border-top: var(--trait); border-bottom: 0; padding-top: var(--e3); }
.lignes { margin: 0; padding: 0; list-style: none; }
.lignes li + li { margin-top: 2px; }
.code { font-variant-numeric: tabular-nums; letter-spacing: 0.06em; font-weight: 600; }

/* Téléphone : chaque ligne devient une fiche */
.membres-mobile { display: none; }
@media (max-width: 720px) {
  .membres-mobile { display: inline; color: var(--gris-texte, inherit); }
  .fiches td.col-membres { display: none; }
  .fiches thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fiches, .fiches tbody, .fiches tfoot, .fiches tr, .fiches td { display: block; width: 100%; }
  .fiches tr {
    border: var(--trait);
    border-radius: 12px;
    padding: var(--e3);
    margin-bottom: var(--e3);
    background: var(--blanc);
  }
  .fiches tbody tr:hover td { background: transparent; }
  .fiches td {
    display: grid;
    grid-template-columns: 6.5em minmax(0, 1fr);
    gap: var(--e2);
    align-items: center;
    border: 0;
    padding: 5px 0;
    text-align: left !important;
    white-space: normal !important;
  }
  .fiches td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: var(--t-petit);
    color: var(--gris-texte);
  }
  .fiches td[data-label=""]::before, .fiches td:not([data-label])::before { content: none; }
  .fiches td:not([data-label]), .fiches td[data-label=""] { display: block; }
  .fiches tfoot tr { border-style: dashed; }
  .fiches tfoot td { border-top: 0; padding-top: 5px; }
  .fiches .actions, .fiches .serre .actions { justify-content: flex-start; flex-wrap: wrap; }
  .fiches td.serre { width: 100%; padding-top: var(--e2); }
  .fiches td > .pill, .fiches td > .case { justify-self: start; }
  .fiches .champ-date, .fiches .large { min-width: 0; }
  .fiches .champ-date { padding: 6px 8px; }
  .fiches td { grid-template-columns: 5.5em minmax(0, 1fr); }
  .fiches td input, .fiches td select { min-height: var(--cible); }
  .tableur { font-size: 1rem; }
}

/* ---------- Dialogues ---------- */

dialog.fenetre {
  padding: 0;
  width: min(600px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  color: var(--noir);
}
dialog.fenetre::backdrop { background: var(--voile); }
dialog .fenetre-barre { position: sticky; top: 0; background: var(--blanc); z-index: 1; }

/* ---------- Markdown rendu ---------- */

.texte { max-width: 68ch; overflow-wrap: anywhere; }
.texte h2 { margin-top: var(--e5); font-size: 1.375rem; font-weight: 600; }
.texte h3 { margin-top: var(--e5); }
.texte h4 { margin: var(--e4) 0 var(--e2); font-size: 1rem; }
.texte > :first-child { margin-top: 0; }
.texte ul { padding-left: 0; list-style: none; margin: 0 0 var(--e3); }
.texte li { padding-left: 1.4em; position: relative; margin-bottom: var(--e1); }
.texte li::before { content: "–"; position: absolute; left: 0; font-size: 0.8em; top: 0.15em; }
.texte a { font-weight: 600; }

.editeur-md { display: grid; gap: var(--e4); grid-template-columns: 1fr 1fr; }
.editeur-md .outils { display: flex; flex-wrap: wrap; gap: var(--e2); margin-bottom: var(--e2); }
.apercu { border: 1px dashed var(--noir); border-radius: var(--rayon-champ); padding: var(--e4); min-height: 220px; max-height: 480px; overflow: auto; }
@media (max-width: 860px) { .editeur-md { grid-template-columns: 1fr; } }

/* ---------- Images ---------- */

.avatar {
  width: 120px; height: 120px;
  border-radius: 50%;
  border: var(--trait);
  overflow: hidden;
  flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--petit { width: 72px; height: 72px; }

.visuel {
  border: var(--trait);
  border-radius: 12px;
  overflow: hidden;
  background: var(--blanc);
  display: grid;
  place-items: center;
  min-height: 160px;
}
.visuel img { width: 100%; max-height: 520px; object-fit: contain; }
.visuel.neutre { aspect-ratio: 16 / 5; min-height: 0; }
.vignettes { display: flex; flex-wrap: wrap; gap: var(--e3); margin-top: var(--e3); padding: 0; list-style: none; }
.vignette { display: grid; gap: var(--e1); justify-items: center; }
.vignette > button:first-child {
  width: 84px; height: 84px; padding: 0;
  border: var(--trait-fin); border-radius: 10px; overflow: hidden; background: var(--blanc); cursor: pointer;
}
.vignette > button:first-child[aria-pressed="true"] { border-width: 3px; }
.vignette img { width: 100%; height: 100%; object-fit: cover; }
.vignette .actions { gap: var(--e1); }
.vignette .btn-icone { width: 28px; height: 28px; font-size: 0.75rem; }
@media (pointer: coarse) { .vignette .btn-icone { width: 36px; height: 36px; } }

.recadrage {
  position: relative;
  width: 100%;
  border: var(--trait);
  border-radius: 10px;
  overflow: hidden;
  background: var(--gris-clair);
  touch-action: none;
  cursor: grab;
}
.recadrage:active { cursor: grabbing; }
.recadrage canvas { width: 100%; height: 100%; display: block; }

/* ---------- Pages ---------- */

.connexion { max-width: 440px; margin: 8vh auto 0; }

.profil { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e4) var(--e5); }
.profil h1 { margin: 0; }

.go-joiner-corps { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--e5); }
@media (max-width: 760px) { .go-joiner-corps { grid-template-columns: minmax(0, 1fr); } }

.resume { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e4); }

.liste-edit { list-style: none; margin: 0 0 var(--e3); padding: 0; display: grid; gap: var(--e2); }
.liste-edit li { display: flex; gap: var(--e2); align-items: center; }
.liste-edit input { flex: 1; min-width: 0; }

.deux-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--e5); align-items: start; }
@media (max-width: 400px) { .deux-col { grid-template-columns: 1fr; } }

.ligne-claim { display: grid; grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr); gap: var(--e2); align-items: end; padding: var(--e2) 0; border-bottom: 1px solid var(--gris-ligne); }
.ligne-claim .etiquette { margin: 0 0 var(--e1); }
@media (max-width: 520px) { .ligne-claim { grid-template-columns: minmax(0, 1fr) 90px; } .ligne-claim .champ-membres { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* ---------- Étape 2 : paquets EMS ---------- */

.groupe-cases { border: 0; padding: 0; margin: 0 0 var(--e4); min-width: 0; }
.liste-gos { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.liste-gos .case { align-items: flex-start; padding-top: 10px; min-height: 0; }
.liste-gos .case input { margin-top: 3px; flex: none; }

.tarifs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--e2) var(--e3); }
.tarif label { display: block; font-size: var(--t-petit); font-weight: 600; margin-bottom: 2px; }
.champ-montant { text-align: right; font-variant-numeric: tabular-nums; }

/* Obtenu / cible / écart */
.bilan-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--e2); margin: 0; }
.bilan-grille > div { border: var(--trait-fin); border-radius: var(--rayon-champ); padding: var(--e2) var(--e3); min-width: 0; }
.bilan-grille dt { font-size: var(--t-petit); color: var(--gris-texte); font-weight: 600; }
.bilan-grille dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bilan-ecart { border-style: dashed !important; }
.bilan-ecart dd { }
.bilan-ok { background: var(--noir); color: var(--blanc); }
.bilan-ok dt { color: var(--blanc); }

/* Montant EMS / customs d'un joiner : auto, ou corrigé à la main */
.cellule-montant { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 6px; }
.cellule-montant input { width: 6.5em; flex: none; }
.cellule-montant input.corrige { border-style: dashed; border-width: 2px; font-weight: 600; }
.cellule-montant input:disabled { background: var(--gris-clair); }
.note-auto { flex-basis: 100%; text-align: right; font-size: 0.75rem; color: var(--gris-texte); white-space: nowrap; }
.btn-auto { min-height: 30px; padding: 0 10px; }
.table-paquet tfoot td { font-variant-numeric: tabular-nums; }
.table-paquet .col-items-mobile { display: none; }

@media (max-width: 720px) {
  .table-paquet .col-qte { display: none !important; }
  .table-paquet .col-items-mobile { display: grid; }
  .cellule-montant { justify-content: flex-start; }
  .note-auto { text-align: left; }
  .bilan-grille { grid-template-columns: 1fr; }
  .bilan-grille > div { display: flex; justify-content: space-between; gap: var(--e3); align-items: baseline; }
}

/* Montants d'un paquet (espace joiner, cartes) */
.montants { margin: 0; display: grid; gap: var(--e2); flex: 1; min-width: 180px; }
.montant { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--e2); border-bottom: 1px solid var(--gris-ligne); padding-bottom: var(--e2); }
.montant:last-child { border-bottom: 0; padding-bottom: 0; }
.montant dt { font-weight: 600; }
.montant dd { margin: 0; display: flex; flex-wrap: wrap; gap: var(--e2); align-items: center; font-variant-numeric: tabular-nums; }
.montants--carte { font-size: var(--t-petit); min-width: 0; }

/* ---------- Étape 3 : envois ---------- */

.adresse { white-space: pre-line; overflow-wrap: anywhere; }
.destinataire { margin: var(--e2) 0; overflow-wrap: anywhere; }
.contenu-paquet + .contenu-paquet { margin-top: var(--e3); padding-top: var(--e3); border-top: 1px dashed var(--gris-ligne); }
.contenu-paquet .etiquette { margin-bottom: 2px; }
.contenu-paquet .lignes li + li { margin-top: var(--e1); }
.table-envoi .large { min-width: 200px; }
.table-envoi .champ-frais { width: 6.5em; }
.table-envoi select { min-width: 165px; }
.table-envoi input[data-champ="tracking"] { min-width: 150px; }
@media (max-width: 720px) {
  .table-envoi td { grid-template-columns: 5.5em minmax(0, 1fr); align-items: start; }
  .table-envoi select, .table-envoi input[data-champ="tracking"] { min-width: 0; }
  .table-envoi .champ-frais { width: 100%; }
}

/* Onglets de l'espace joiner */
.onglets { display: flex; flex-wrap: wrap; gap: var(--e2); }
.onglets [role="tab"] { min-height: var(--cible); padding: 0 18px; font-size: 0.9375rem; font-weight: 600; cursor: pointer; }
.onglets [aria-selected="true"] { background: var(--noir); color: var(--blanc); }

/* Numéro de suivi bien visible */
.suivi { border: var(--trait); border-radius: var(--rayon-champ); padding: var(--e2) var(--e3); margin-bottom: var(--e4); }
.suivi strong { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; overflow-wrap: anywhere; user-select: all; }
.suivi--vide { border-style: dashed; color: var(--gris-texte); }
.form-envoi textarea { min-height: 120px; }

/* ---------- Étape 4 : sorting des photocards ---------- */

/* Carte photocard : pilule un peu plus grande ; bouton dans l'aperçu admin */
.pc { font-size: 0.875rem; font-weight: 600; padding: 4px 12px; }
button.pc { cursor: pointer; min-height: 36px; }
button.pc:hover:not(:disabled) { background: var(--survol); }
button.pc[aria-pressed="true"] { background: var(--noir); color: var(--blanc); outline: 3px solid var(--noir); outline-offset: 2px; }
button.pc[aria-pressed="true"]::after { content: "selected"; font-size: 0.75rem; font-weight: 500; }
button.pc:disabled { cursor: default; color: var(--noir); }
.pc--doublon { border-style: dashed; border-width: 2px; }
@media (pointer: coarse) { button.pc { min-height: var(--cible); } }

/* Lots de l'aperçu : un joiner par ligne */
.lots { list-style: none; margin: 0; padding: 0; display: grid; }
.lot { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: var(--e2) var(--e4); padding: var(--e3) 0; border-top: 1px solid var(--gris-ligne); align-items: start; }
.lot:first-child { border-top: 0; }
.lot-qui { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-width: 0; }
.lot-qui strong { overflow-wrap: anywhere; }
.lot--manque { background: repeating-linear-gradient(-45deg, transparent 0 8px, var(--survol) 8px 16px); }
.restantes { border: var(--trait); border-style: dashed; border-radius: var(--rayon-champ); padding: var(--e3); margin-top: var(--e4); }
@media (max-width: 600px) { .lot { grid-template-columns: 1fr; } }

/* Joiners dans l'ordre des claims */
.ordre-claims { list-style: none; margin: 0; padding: 0; }
.ordre-claims li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--gris-ligne); }
.ordre-claims li:first-child { border-top: 0; }
.ordre-claims .num { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 2.5em; }
.classement-texte { flex-basis: 100%; color: var(--gris-texte); font-size: 0.875rem; overflow-wrap: anywhere; }

/* Compteurs de cartes sorties */
.compteurs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--e2) var(--e3); }
.compteur { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 6px; border: var(--trait-fin); border-radius: var(--rayon-champ); padding: 6px 8px; min-width: 0; }
.compteur label { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.compteur input { width: 3.6em; text-align: center; padding-left: 4px; padding-right: 4px; font-variant-numeric: tabular-nums; }

/* Classement des membres par le joiner (boutons ↑ ↓, pas de glisser-déposer) */
.classement { list-style: none; margin: 0 0 var(--e4); padding: 0; display: grid; gap: 6px; }
.classement li { display: grid; grid-template-columns: 2.2em 1fr auto auto; align-items: center; gap: var(--e2); border: var(--trait-fin); border-radius: var(--rayon-champ); background: var(--blanc); padding: 4px 6px 4px 10px; }
.classement li:first-child { border: var(--trait); border-width: 2px; }
.classement .rang { font-weight: 600; font-variant-numeric: tabular-nums; }
.classement .nom { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.classement--fige li { grid-template-columns: 2.2em 1fr; padding: 8px 10px; }
.classement .btn-icone { width: var(--cible); height: var(--cible); font-size: 1.1rem; }

/* ==========================================================
   Étape 5a : nouveau look (menu latéral, thème, dashboard…)
   ========================================================== */

em, i { font-weight: 600; } /* l'emphase Markdown passe en demi-gras (pas d'italique) */

/* Sections simples (au lieu des fenêtres) : filet + espace */
.section { padding-top: var(--e5); margin-top: var(--e5); border-top: var(--filet); }
.section--sans-filet { border-top: 0; padding-top: 0; }
.section-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--e2) var(--e3); margin-bottom: var(--e3); }
.section-tete h2 { margin: 0; }

/* Bandeau de titre façon notion : aplat gris, texte gras */
.bande { display: inline-block; margin: 0; }


/* Bouton discret (texte seul) et icônes */
.btn--nu { border-color: transparent; background: transparent; }
.btn--nu:hover { background: var(--survol); }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-icone { color: var(--noir); }
.btn-icone .ico { width: 17px; height: 17px; }
.btn-icone--nu { border-color: transparent; background: transparent; }
.btn-icone--nu:hover { background: var(--survol); }

/* Bouton mode nuit (pages publiques et joiner) */
.btn-theme { position: absolute; top: 12px; right: 12px; z-index: 20; background: var(--blanc); }

/* ---------- Menu admin ---------- */

.admin .page { margin-left: var(--menu); max-width: calc(var(--largeur) + var(--menu)); padding: var(--e6) var(--e6) var(--e7); }
.admin .page--etroite { max-width: calc(820px + var(--menu)); }
.menu {
  position: fixed; inset: 0 auto 0 0; z-index: 30;
  width: var(--menu);
  display: flex; flex-direction: column;
  padding: var(--e5) var(--e3) var(--e4);
  background: var(--blanc);
  border-right: var(--filet);
  overflow-y: auto;
}
.menu .marque { display: block; padding: 0 12px var(--e5); font-size: 1.375rem; }
.menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.menu hr { border: 0; border-top: var(--filet); margin: var(--e3) 12px; }
.menu-lien {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 40px; padding: 0 12px;
  border: 0; border-radius: var(--rayon-champ); background: none; color: var(--gris-texte);
  font: inherit; font-size: 0.9375rem; font-weight: 600; text-decoration: none; text-align: left; cursor: pointer;
}
.menu-lien:hover { background: var(--survol); color: var(--noir); }
.menu-lien[aria-current="page"] { background: var(--gris-clair); color: var(--noir); }
.menu-bas { margin-top: auto; padding-top: var(--e5); }
.barre-mobile, .menu-voile, .menu-fermer { display: none; }

@media (max-width: 900px) {
  .admin .page { margin-left: 0; padding: var(--e4) var(--e4) var(--e7); }
  .barre-mobile {
    display: flex; align-items: center; justify-content: space-between; gap: var(--e3);
    position: sticky; top: 0; z-index: 25;
    padding: 6px var(--e3) 6px var(--e4);
    background: var(--blanc); border-bottom: var(--filet);
  }
  .barre-mobile .marque { font-size: 1.125rem; }
  .menu { transform: translateX(-100%); visibility: hidden; transition: transform 0.2s, visibility 0.2s; width: min(280px, 85vw); }
  .menu-ouvert .menu { transform: none; visibility: visible; }
  .menu-ouvert .menu-voile { display: block; position: fixed; inset: 0; z-index: 29; background: var(--voile); }
  .menu-fermer { display: inline-grid; position: absolute; top: 14px; right: 12px; }
  .menu-lien { min-height: var(--cible); }
}
.connexion-seule .menu, .connexion-seule .barre-mobile { display: none; }
.connexion-seule .page { margin-left: 0; }

/* ---------- Dashboard : calendrier ---------- */

.cal-tete { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e2); margin-bottom: var(--e3); }
.cal-tete h2 { margin: 0 auto 0 0; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: var(--filet); border-left: var(--filet); }
.cal-jsem { padding: 6px 8px; font-size: var(--t-petit); font-weight: 600; color: var(--gris-texte); border-right: var(--filet); border-bottom: var(--filet); }
.cal-jour { min-height: 112px; padding: 4px 6px 6px; border-right: var(--filet); border-bottom: var(--filet); background: var(--blanc); min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cal-jour--hors { background: transparent; }
.cal-num { display: flex; justify-content: space-between; align-items: center; font-size: var(--t-petit); font-weight: 600; color: var(--gris-texte); }
.cal-jour--ajd .cal-num span { background: var(--noir); color: var(--blanc); border-radius: var(--rayon-pilule); padding: 0 7px; }
.cal-ajout { width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--gris-texte); font: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; opacity: 0; }
.cal-jour:hover .cal-ajout, .cal-ajout:focus-visible { opacity: 1; }
.cal-ajout:hover { background: var(--survol); }
@media (pointer: coarse) { .cal-ajout { opacity: 1; } }
.cal-evt { display: block; width: 100%; border: 0; border-radius: 6px; padding: 2px 6px; font: inherit; font-size: 0.75rem; line-height: 1.35; text-align: left; text-decoration: none; overflow-wrap: anywhere; cursor: pointer; color: var(--noir); }
.cal-evt--deadline { background: var(--noir); color: var(--blanc); font-weight: 600; }
.cal-evt--note { background: var(--gris-clair); }
.cal-evt:hover { opacity: 0.85; }
.cal-liste { display: none; list-style: none; margin: 0; padding: 0; }
@media (max-width: 720px) {
  .cal { display: none; }
  .cal-liste { display: block; }
  .cal-liste > li { display: grid; grid-template-columns: 3.6em minmax(0, 1fr); gap: var(--e3); padding: var(--e3) 0; border-top: var(--filet); }
  .cal-liste > li:first-child { border-top: 0; }
  .cal-liste .cal-date { font-weight: 600; line-height: 1.2; }
  .cal-liste .cal-date small { display: block; font-weight: 500; color: var(--gris-texte); }
  .cal-liste .cal-evts { display: grid; gap: 4px; min-width: 0; }
  .cal-liste .cal-evt { font-size: 0.875rem; padding: 8px 10px; }
}

/* ---------- Fiche GO ---------- */

.titre-modifiable { cursor: text; border-radius: 8px; }
.titre-modifiable:hover { background: var(--survol); }
.titre-champ { font: inherit; font-size: var(--t-h1); font-weight: 600; letter-spacing: 0; }
.ligne-totaux { margin: var(--e3) 0 0; color: var(--gris-texte); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.ligne-totaux strong { color: var(--noir); }
.filtres { display: flex; flex-wrap: wrap; gap: var(--e2) var(--e3); align-items: center; }
.filtres .champ { margin: 0; display: flex; align-items: center; gap: var(--e2); }
.filtres .champ > label { margin: 0; white-space: nowrap; }
.filtres select { min-height: 38px; width: auto; min-width: 120px; padding-top: 4px; padding-bottom: 4px; }
.claims .petit { font-size: 0.75rem; color: var(--gris-texte); white-space: nowrap; }
.claims tr.paye td { color: var(--gris-texte); }
@media (max-width: 720px) { .filtres .champ { flex: 1 1 140px; } .filtres select { width: 100%; } }

/* Panneau de réglages (dialog collé à droite) */
dialog.panneau {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh;
  width: min(560px, 100vw); max-width: 100vw; padding: 0; border: 0; border-left: var(--filet);
  background: var(--blanc); color: var(--noir);
}
dialog.panneau::backdrop { background: var(--voile); }
.panneau-tete { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: var(--e3); padding: var(--e3) var(--e4); background: var(--blanc); border-bottom: var(--filet); }
.panneau-tete h2 { margin: 0; }
.panneau-corps { padding: var(--e4); }
.panneau-corps .section { margin-top: var(--e4); padding-top: var(--e4); }
.items-liste { list-style: none; margin: 0 0 var(--e3); padding: 0; }
.items-liste li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--e2); align-items: center; padding: 6px 0; border-bottom: var(--filet); }

/* Barre « unsaved changes » du package */
.barre-save { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--e3); padding: var(--e3) 0; background: var(--fond); border-top: var(--filet); margin-top: var(--e4); }
.barre-save .etat { margin-right: auto; font-weight: 600; }
.barre-save .etat--modifie::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--noir); margin-right: 8px; vertical-align: middle; }

/* Photo des cartes d'un sorting */
.photo-cartes { max-width: 520px; border-radius: 12px; overflow: hidden; border: var(--filet); background: var(--blanc); }
.photo-cartes img { width: 100%; max-height: 420px; object-fit: contain; }

/* Listes simples (archives…) */
.liste-simple { list-style: none; margin: 0; padding: 0; }
.liste-simple li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e2) var(--e3); padding: var(--e3) 0; border-top: var(--filet); }
.liste-simple li:first-child { border-top: 0; }
.liste-simple .vign { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; flex: none; }
.liste-simple .vign img { width: 100%; height: 100%; object-fit: cover; }
.liste-simple .quoi { flex: 1; min-width: 160px; overflow-wrap: anywhere; }

/* Items dans les réglages du GO : nom | type | prix | × */
.items-reglages { list-style: none; margin: 0 0 var(--e3); padding: 0; }
.item-ligne { display: grid; grid-template-columns: minmax(0, 1fr) 120px 96px auto; gap: var(--e2); align-items: end; padding: 6px 0; border-bottom: var(--filet); }
.item-ligne input, .item-ligne select { min-height: 38px; padding-top: 4px; padding-bottom: 4px; }
.item-nouveau { border-bottom: 0; }
@media (max-width: 480px) { .item-ligne { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; } .item-ligne > :first-child { grid-column: 1 / -1; } }
details > summary { cursor: pointer; min-height: var(--cible); display: flex; align-items: center; gap: var(--e2); list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "›"; font-weight: 600; font-size: 1.2rem; transition: transform 0.15s; display: inline-block; width: 1ch; }
details[open] > summary::before { transform: rotate(90deg); }
.details-grille { display: grid; grid-template-columns: max-content 1fr; gap: 4px var(--e4); margin: 0 0 var(--e4); }
.details-grille dt { color: var(--gris-texte); }
.details-grille dd { margin: 0; }
.visuel { border: 0; background: none; place-items: start; min-height: 0; }
.visuel img { width: auto; max-width: 100%; max-height: 560px; border-radius: 12px; }
/* Shipping list : tient sans défilement à 1280 px avec le menu */
.table-envoi .large { min-width: 150px; }
.table-envoi select { min-width: 150px; }
.table-envoi input[data-champ="tracking"] { min-width: 110px; }
.table-envoi .champ-frais { width: 5.5em; }

/* Corrections 5a (testeur) */
/* Dashboard : 4 groupes récents sur une rangée, 2×2 sur tablette, 1 colonne sur téléphone */
.galerie--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--e4); }
@media (max-width: 1100px) { .galerie--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .galerie--4 { grid-template-columns: minmax(0, 1fr); } }

/* Fiche GO : photo limitée en hauteur pour que les claims arrivent vite (image entière) */
.visuel img { max-height: 45vh; object-fit: contain; }
@media (max-width: 720px) { .visuel img { max-height: 60vh; } }

/* Claims sur téléphone : fiche compacte de 3 lignes, sans cadre
   « #1 @pseudo · date » / items / « total ✎ paid » */
@media (max-width: 720px) {
  .fiches.claims tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "num handle date date" "items items items items" "total total edit paye";
    gap: 2px var(--e2); align-items: center;
    border: 0; border-bottom: var(--filet); border-radius: 0; margin: 0; padding: var(--e3) 0; background: none;
  }
  .fiches.claims td { display: block; width: auto; padding: 0; }
  .fiches.claims td::before { content: none; }
  .fiches.claims .c-num { grid-area: num; color: var(--gris-texte); }
  .fiches.claims .c-handle { grid-area: handle; }
  .fiches.claims .c-date { grid-area: date; text-align: right !important; }
  .fiches.claims .c-items { grid-area: items; min-width: 0; }
  .fiches.claims .c-total { grid-area: total; }
  .fiches.claims td.c-edit { grid-area: edit; width: auto; padding: 0; }
  .fiches.claims td.c-paye { grid-area: paye; width: auto; }
  .fiches.claims .c-paye .case { min-height: var(--cible); padding: 0 4px; }
}
@media (max-width: 720px) {
  .fiches.claims td.col-membres { display: none; }
  .fiches.claims .c-num::after { content: "."; }
}
/* À l'ouverture, le panneau devient visible tout de suite (sinon le focus ne peut pas y entrer) */
.menu-ouvert .menu { transition: transform 0.2s; }
@media (max-width: 720px) { .filtres .champ { min-width: 0; } .filtres select { min-width: 0; } }

/* ---------- Étape 5b : espace joiner ---------- */

/* Carte d'identité rétro : un des rares encadrés */
.carte-id-fen { background: var(--blanc); border: var(--trait); border-radius: var(--rayon); overflow: hidden; }
.carte-id-barre { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: var(--e2); padding: 4px 8px 4px 12px; border-bottom: var(--trait); min-height: 40px; }
.carte-id-barre h2 { grid-column: 2; margin: 0; text-align: center; font-size: 0.9375rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-id-barre .btn-icone { grid-column: 3; justify-self: end; }
.ronds { display: flex; gap: 5px; }
.ronds i { width: 13px; height: 13px; border-radius: 50%; border: var(--trait-fin); display: block; }
.ronds i:first-child { background: var(--noir); }
.carte-id-corps { display: flex; gap: var(--e5); align-items: center; padding: var(--e4); }
.carte-id-initiale { flex: none; width: 104px; height: 104px; display: grid; place-items: center; border: var(--trait); border-radius: 12px; background: var(--gris-clair); font-size: 3.5rem; font-weight: 600; line-height: 1; overflow: hidden; }
.carte-id-champs { margin: 0; flex: 1; min-width: 0; display: grid; gap: var(--e2); }
.carte-id-champs div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: var(--e2); border-bottom: var(--filet); padding-bottom: var(--e2); }
.carte-id-champs div:last-child { border-bottom: 0; padding-bottom: 0; }
.carte-id-champs dt { color: var(--gris-texte); font-size: var(--t-petit); padding-top: 2px; }
.carte-id-champs dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.carte-id-form { flex: 1; min-width: 0; }
.carte-id-form .champ { margin-bottom: var(--e3); }
@media (max-width: 520px) { .carte-id-corps { flex-direction: column; align-items: stretch; } .carte-id-initiale { width: 88px; height: 88px; font-size: 3rem; } }

/* Bloc « to pay » */
.a-payer .bande { margin-bottom: var(--e3); }
.a-payer-rien { font-size: 1.375rem; font-weight: 600; margin: 0; }
.ap-haut { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--e3) var(--e5); }
.ap-total { font-size: 2.5rem; font-weight: 600; letter-spacing: 0; line-height: 1.1; margin: 0 0 var(--e1); font-variant-numeric: tabular-nums; }
.ap-prochaine { margin: 0; color: var(--gris-texte); }
.ap-prochaine strong { color: var(--noir); }
.ap-liste { list-style: none; margin: var(--e4) 0 0; padding: 0; border-top: var(--filet); }
.ap-liste li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: var(--e2) var(--e3); align-items: center; padding: var(--e2) 0; border-bottom: var(--filet); }
.ap-nom { overflow-wrap: anywhere; font-weight: 500; }
.ap-montant { font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .ap-liste li { grid-template-columns: minmax(0, 1fr) auto auto; }
  .ap-dl { grid-column: 1 / -1; order: 3; margin-top: -4px; }
  .btn--geant { width: 100%; }
}
.dl { font-size: var(--t-petit); color: var(--gris-texte); white-space: nowrap; }
.dl--urgent { color: var(--noir); font-weight: 600; text-decoration: underline; text-decoration-style: dotted; }

/* Group orders : groupes repliables, GO repliables */
.champ-tri { margin: 0; display: flex; align-items: center; gap: var(--e2); }
.champ-tri > label { margin: 0; color: var(--gris-texte); font-weight: 500; }
.champ-tri select { width: auto; min-width: 9em; }
.groupe-go { border-top: var(--trait-fin); }
.groupe-go > summary, .go-item > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: var(--e1) var(--e3); min-height: var(--cible); padding: var(--e2) 0 var(--e2) 22px; position: relative; }
.groupe-go > summary::-webkit-details-marker, .go-item > summary::-webkit-details-marker { display: none; }
.groupe-go > summary::before, .go-item > summary::before { content: ""; position: absolute; left: 3px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border-right: 2px solid var(--noir); border-bottom: 2px solid var(--noir); transform: rotate(-45deg); transition: transform 0.15s; }
.groupe-go[open] > summary::before, .go-item[open] > summary::before { transform: rotate(45deg); margin-top: -8px; }
.groupe-go > summary { font-weight: 600; font-size: var(--t-moyen); justify-content: space-between; }
.g-compte { font-size: var(--t-petit); font-weight: 500; color: var(--gris-texte); }
.g-compte strong { color: var(--noir); }
.groupe-go-corps { padding-bottom: var(--e3); }
.go-item { border-top: var(--filet); }
.go-item:first-child { border-top: 0; }
.go-item > summary { font-weight: 600; }
.go-nom { flex: 1 1 14em; min-width: 0; overflow-wrap: anywhere; }
.go-etat { min-width: 5em; text-align: right; font-variant-numeric: tabular-nums; }
.go-dl { min-width: 7em; text-align: right; }
@media (max-width: 520px) { .go-nom { flex-basis: 100%; } .go-etat, .go-dl { text-align: left; min-width: 0; } }
.go-detail { padding: var(--e2) 0 var(--e4) 22px; }
.ligne-du { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e2) var(--e3); margin: var(--e4) 0 0; font-weight: 500; }
.ligne-du strong { font-size: var(--t-moyen); }

/* Claims perdus : barrés */
.perdu .go-nom, tr.perdu td { text-decoration: line-through; color: var(--gris-texte); }

/* Packages : sections simples */

/* Bandeau « ready to ship » : texte à gauche, bouton à droite ; empilés sur téléphone */
.bandeau-envoi { align-items: center; margin-bottom: 0; }
.bandeau-envoi::before { align-self: center; }
@media (max-width: 520px) { .bandeau-envoi { flex-wrap: wrap; } .bandeau-envoi > span { flex-basis: calc(100% - 30px); } .bandeau-envoi .btn { width: 100%; } }

/* Wishlist */
.wishlist { margin-top: var(--e4); padding-top: var(--e4); }

/* Admin : frais de retard dans les claims */
.retard-mobile { display: none; }
@media (max-width: 720px) {
  .fiches.claims td.c-retard { display: none; }
  .retard-mobile { display: inline; margin-left: var(--e2); font-size: var(--t-petit); }
  .fiches.claims tr.perdu .c-handle strong { text-decoration: line-through; }
}
tr.perdu .pill { text-decoration: none; }
.vign-wl { display: inline-block; width: 44px; height: 44px; border: var(--filet); border-radius: 8px; overflow: hidden; flex: none; align-self: center; }
.vign-wl img { width: 100%; height: 100%; object-fit: cover; }
input[data-profil] { min-width: 9em; }

/* Dashboard : group orders récents en colonne à droite du calendrier sur grand écran */
@media (min-width: 1200px) {
  .dash-grille { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--e5); align-items: start; }
  /* la colonne prend la place vide à droite : le calendrier garde sa largeur d'avant */
  .admin .page:has(.dash-grille) { max-width: calc(var(--largeur) + var(--menu) + 280px + var(--e5)); }
  .dash-recents { margin-top: 0; padding-top: 0; border-top: 0; }
  .dash-recents .galerie--4 { grid-template-columns: minmax(0, 1fr); gap: var(--e3); }
}

/* Croix de fermeture des dialogues (simple, comme le crayon de la carte joiner) ; seules les fenêtres qui se ferment en ont une */
.fenetre-barre > .ronds { grid-column: 1; grid-row: 1; }
.fenetre-barre > .fenetre-titre { grid-row: 1; }
.fenetre-boutons .fenetre-fermer {
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--noir); font: inherit; font-size: 22px; line-height: 24px; cursor: pointer;
}
.fenetre-boutons .fenetre-fermer:focus-visible { outline: 2px solid var(--noir); outline-offset: 2px; }

/* Bloc simple côté joiner (remplace les fenêtres) : titre puis contenu, filet entre deux blocs */
.bloc + .bloc { border-top: var(--filet); padding-top: var(--e4); }
.bloc > .bande, .bloc-titre { margin: 0 0 var(--e2); }
.bloc-titre { font-size: var(--t-moyen); }
.bloc-corps > :last-child { margin-bottom: 0; }

/* Alignement dans le Markdown simple ([center] / [right] en début de ligne) */
.md-center { text-align: center; }
.md-right { text-align: right; }
li.md-center, li.md-right { list-style-position: inside; }

/* Icône de la rubrique devant les titres (même dessin que le menu) */
.admin main h1::before {
  content: ""; display: inline-block; width: 0.75em; height: 0.75em; margin-right: 0.35em; vertical-align: -0.04em;
  background: currentColor; -webkit-mask: var(--ico-page) no-repeat center / contain; mask: var(--ico-page) no-repeat center / contain;
}
.admin .connexion h1::before { content: none; }
.ico-titre { width: 0.9em; height: 0.9em; margin-right: 0.35em; vertical-align: -0.1em; }

/* Carte joiner : choix des groupes suivis (menu déroulant de cases) */
.choix-groupes { border: var(--trait-fin); border-radius: 10px; padding: 6px 12px; margin-bottom: var(--e3); }
.choix-groupes > summary { cursor: pointer; font-weight: 600; min-height: var(--cible); display: flex; align-items: center; gap: var(--e2); }
.choix-groupes-liste { display: flex; flex-direction: column; max-height: 220px; overflow: auto; padding-bottom: 6px; }

/* Page info : une étoile devant le nom (le nom vient des réglages) */
h1#pseudo::before { content: "★ "; }
.marque { white-space: nowrap; }
