/* QG VA — style plat, pensé pour le téléphone (Android d'entrée de gamme, connexion lente) : polices du système, aucune image. */
:root {
  --fond: #f4f3ef;
  --surface: #ffffff;
  --encre: #1b1a17;
  --doux: #5c5850;
  --trait: #e2dfd8;
  --trait-fort: #c9c5bb;
  --principal: #1f45c4;
  --principal-fond: #e8edfb;
  --sur-principal: #ffffff;
  --ok: #17713f;
  --ok-fond: #e3f2e9;
  --attention: #9a5406;
  --attention-fond: #fbf0dd;
  --danger: #b3261e;
  --danger-fond: #fbe7e5;
  --rayon: 10px;
  --barre: 64px;
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --chiffres: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--encre); font: 16px/1.5 var(--police);
  min-height: 100dvh; overscroll-behavior-y: contain;
}
a { color: var(--principal); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
.doux { color: var(--doux); }
.petit { font-size: 14px; }
.chiffre { font-family: var(--chiffres); font-variant-numeric: tabular-nums; }
.cache { display: none !important; }
:focus-visible { outline: 3px solid var(--principal); outline-offset: 2px; }

/* mise en page */
.page { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(var(--barre) + 24px); }
.page.large { max-width: 1180px; }
.pile > * + * { margin-top: 12px; }
.pile-l > * + * { margin-top: 24px; }
.ligne { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ligne.entre { justify-content: space-between; }
.grille { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* en-tête */
.entete { background: var(--surface); border-bottom: 1px solid var(--trait); position: sticky; top: 0; z-index: 10; }
.entete .dedans { max-width: 760px; margin: 0 auto; padding: 12px 16px; }
.page.large ~ .entete .dedans, .entete.large .dedans { max-width: 1180px; }
.progression { height: 8px; background: var(--trait); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progression > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .25s ease-out; }

/* barre de navigation du bas (téléphone) ; en haut sur grand écran */
.barre { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--trait);
  display: flex; padding-bottom: env(safe-area-inset-bottom); }
.barre button { flex: 1; min-height: var(--barre); border: 0; background: none; font: 500 12px/1.2 var(--police); color: var(--doux);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; touch-action: manipulation; }
.barre button svg { width: 24px; height: 24px; }
.barre button[aria-current="page"] { color: var(--principal); font-weight: 700; }
.barre button[aria-current="page"]::before { content: ""; position: absolute; }
.badge { min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; }
@media (min-width: 900px) {
  .barre.haut { position: sticky; top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid var(--trait); justify-content: center; }
  .barre.haut button { flex: 0 0 auto; flex-direction: row; padding: 0 18px; font-size: 15px; min-height: 52px; }
  .barre.haut button[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--principal); }
  .page.large { padding-bottom: 40px; }
}

/* cartes */
.carte { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px; }
.carte.faite { background: var(--ok-fond); border-color: #bfdcc9; }
.carte.maintenant { border: 2px solid var(--principal); }
.carte.alerte { background: var(--attention-fond); border-color: #ecd3a8; }
.carte.rouge { background: var(--danger-fond); border-color: #f0c3bf; }
.chiffre-cle { font: 700 28px/1.1 var(--chiffres); font-variant-numeric: tabular-nums; }
.etiquette { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--principal-fond); color: var(--principal); }
.etiquette.ok { background: var(--ok-fond); color: var(--ok); }
.etiquette.attention { background: var(--attention-fond); color: var(--attention); }
.etiquette.danger { background: var(--danger-fond); color: var(--danger); }
.etiquette.neutre { background: #eeece7; color: var(--doux); }
.heure { font: 700 24px/1 var(--chiffres); font-variant-numeric: tabular-nums; }

/* texte à copier */
.citation { background: var(--fond); border: 1px dashed var(--trait-fort); border-radius: 8px; padding: 12px; white-space: pre-wrap; word-break: break-word; font-size: 17px; }

/* boutons et champs */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--trait-fort); background: var(--surface); color: var(--encre); font: 600 15px/1.2 var(--police); cursor: pointer;
  text-decoration: none; touch-action: manipulation; transition: transform .12s ease-out, background-color .15s; }
.bouton:active { transform: scale(.97); }
.bouton svg { width: 20px; height: 20px; flex: none; }
.bouton.principal { background: var(--principal); border-color: var(--principal); color: var(--sur-principal); }
.bouton.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.bouton.danger { color: var(--danger); border-color: #e6b4af; }
.bouton.plein { width: 100%; }
.bouton[disabled] { opacity: .45; cursor: not-allowed; }
.bouton.petit { min-height: 40px; padding: 0 12px; font-size: 14px; }
label.champ { display: block; }
label.champ > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
label.champ > small { display: block; color: var(--doux); font-size: 13px; margin-top: 4px; }
input[type=text], input[type=url], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--trait-fort); border-radius: 8px; background: #fff;
  font: 16px/1.4 var(--police); color: var(--encre); }
textarea { min-height: 96px; resize: vertical; }
.case { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; cursor: pointer; }
.case input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--ok); }
.erreur-champ { color: var(--danger); font-size: 14px; margin-top: 6px; }

/* listes */
.liste-follows { list-style: none; margin: 0; padding: 0; }
.liste-follows li { display: flex; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--trait); }
.liste-follows li:last-child { border-bottom: 0; }
.liste-follows .nom { flex: 1; font-weight: 600; word-break: break-all; }
.liste-follows li.fait .nom { color: var(--ok); text-decoration: line-through; }

/* tableaux (patron) */
.tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau th { text-align: left; font-weight: 600; color: var(--doux); border-bottom: 1px solid var(--trait-fort); padding: 8px; white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.tableau td { border-bottom: 1px solid var(--trait); padding: 8px; vertical-align: top; }
.tableau td.n, .tableau th.n { text-align: right; font-family: var(--chiffres); font-variant-numeric: tabular-nums; }
.defile { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* message flottant */
#toast { position: fixed; left: 0; right: 0; margin: 0 auto; width: fit-content; bottom: calc(var(--barre) + 16px); z-index: 50; max-width: calc(100% - 32px);
  background: var(--encre); color: #fff; padding: 12px 16px; border-radius: 8px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s ease-out; }
#toast.visible { opacity: 1; }
#toast.erreur { background: var(--danger); }

details.plie > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; list-style: none; }
details.plie > summary::-webkit-details-marker { display: none; }
details.plie > summary svg, .etiquette svg, h2 svg { width: 20px; height: 20px; flex: none; margin-right: 8px; }
.etiquette svg { width: 14px; height: 14px; margin-right: 0; }
details.plie > summary::after { content: "+"; margin-left: auto; font: 700 20px var(--chiffres); color: var(--doux); }
details.plie[open] > summary::after { content: "–"; }

.vide { text-align: center; padding: 32px 16px; color: var(--doux); }
.squelette { background: linear-gradient(90deg, #ece9e3 0, #f6f4f0 50%, #ece9e3 100%); background-size: 200% 100%; animation: luire 1.2s infinite linear; border-radius: var(--rayon); height: 96px; }
@keyframes luire { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.tableau select { min-width: 140px; min-height: 40px; padding: 6px 8px; font-size: 14px; }

/* tableaux de comparaison (cadences, follows, saisie) : la première colonne garde sa largeur, le tableau défile */
.tableau.comparaison td:first-child, .tableau.comparaison th:first-child { min-width: 220px; }
.tableau.comparaison th { white-space: nowrap; }

/* bannières et photos de profil déposées */
.grille-medias { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.grille-medias figure { margin: 0; display: grid; gap: 6px; }
.grille-medias img { width: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--trait, #ddd); }
.grille-medias img.banniere { aspect-ratio: 3 / 1; }
.grille-medias img.photo { aspect-ratio: 1; border-radius: 50%; width: 96px; }
.grille-medias figcaption { display: flex; justify-content: space-between; align-items: center; gap: 6px; }

/* kits de profil (patron) : chaque compte vu comme sur X */
.grille-medias img.source { aspect-ratio: 3 / 4; }
.alerte-kit { background: var(--attention-fond); color: var(--attention); border-radius: var(--rayon); padding: 12px 14px; }
.grille-kits { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-top: 8px; }
.kit-apercu { border: 1px solid var(--trait); border-radius: 14px; overflow: hidden; background: var(--surface); }
.kit-banniere { aspect-ratio: 3 / 1; background: #eeece7; display: grid; place-items: center; }
.kit-banniere img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kit-corps { padding: 0 14px 14px; }
.kit-corps > * + * { margin-top: 6px; }
.kit-avatar { width: 76px; height: 76px; border-radius: 50%; border: 4px solid var(--surface); margin-top: -38px; background: #e2dfd8; overflow: hidden; display: grid; place-items: center; position: relative; }
.kit-avatar img { width: 100%; height: 100%; object-fit: cover; }
.kit-nom { font-weight: 700; font-size: 17px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kit-bio { white-space: pre-line; font-size: 15px; line-height: 1.4; }
