/* Tableau de bord, version épurée.
   Pensé d'abord pour le téléphone en plein shooting (portrait et paysage), utilisable aussi sur ordinateur.
   Fiche événement : trois onglets (Direct, Photos, Réglages). Sans JavaScript, les trois s'affichent l'un sous l'autre. */
:root {
  --fond: #f6f6f6; --surface: #ffffff; --surface-2: #ececec; --texte: #0c0c0c; --doux: #646464; --trait: #e2e2e2;
  --ok: #17803d; --ko: #c62828; --attente: #8a6d00; --plein: #0c0c0c; --plein-texte: #ffffff;
  --bulle: rgba(16, 16, 16, .58);
  --rayon: 18px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --haut: env(safe-area-inset-top, 0px); --bas: env(safe-area-inset-bottom, 0px);
  --gauche: env(safe-area-inset-left, 0px); --droite: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) { --fond: #000000; --surface: #141414; --surface-2: #1f1f1f; --texte: #f4f4f4; --doux: #8e8e8e; --trait: #232323;
    --ok: #3ccf6e; --ko: #ff5a52; --attente: #e3b341; --plein: #f4f4f4; --plein-texte: #000000; color-scheme: dark; }
}
:root[data-theme="sombre"] { --fond: #000000; --surface: #141414; --surface-2: #1f1f1f; --texte: #f4f4f4; --doux: #8e8e8e; --trait: #232323;
    --ok: #3ccf6e; --ko: #ff5a52; --attente: #e3b341; --plein: #f4f4f4; --plein-texte: #000000; color-scheme: dark; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("/static/polices/inter.woff2") format("woff2"); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.4;
  background: var(--fond); color: var(--texte); font-variant-numeric: tabular-nums; }
a { color: inherit; }
[hidden] { display: none !important; }
h1 { font-size: 1.6rem; margin: 0; letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: 1.05rem; margin: 0; }
h3 { font-size: .95rem; margin: 0; }
code { font-family: var(--mono); font-size: .9em; }
svg.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--texte); outline-offset: 2px; }

/* ---------- squelette ---------- */
.barre { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: calc(10px + var(--haut)) max(16px, var(--droite)) 10px max(16px, var(--gauche)); }
.marque { font-weight: 650; text-decoration: none; }
.retour { color: var(--doux); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.deconnexion { margin: 0; }
main { max-width: 1100px; margin: 0 auto; padding: 0 max(16px, var(--droite)) calc(24px + var(--bas)) max(16px, var(--gauche)); }
.pile { display: flex; flex-direction: column; gap: 10px; }
.aide { margin: 0; color: var(--doux); font-size: 13.5px; }
.centre { text-align: center; }
.mono { font-family: var(--mono); letter-spacing: -.01em; }

/* ---------- éléments ---------- */
.bloc, .carte { background: var(--surface); border-radius: var(--rayon); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bloc p { margin: 0; }
.etiquette-bloc { margin: 0; color: var(--doux); font-size: 13px; }
.etroite { max-width: 420px; margin: 8vh auto 0; }

.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 12px; background: var(--surface-2); color: var(--texte); font: inherit; font-size: 14.5px;
  font-weight: 600; text-decoration: none; cursor: pointer; }
.bouton.plein { background: var(--plein); color: var(--plein-texte); }
.bouton.large { width: 100%; min-height: 50px; }
.bouton.petit { min-height: 38px; padding: 0 12px; font-size: 13.5px; }
.bouton.danger { color: var(--ko); }
.bouton:disabled { opacity: .45; cursor: default; }
.lien { background: none; border: 0; padding: 0 4px; min-height: 44px; color: var(--doux); font: inherit; cursor: pointer; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.point { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--doux); }
.ok > .point, .point.ok { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }
.ko > .point, .point.ko { background: var(--ko); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ko) 20%, transparent); }
.point.attente { background: var(--attente); }

.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 12px;
  background: var(--surface); font-size: 14px; white-space: nowrap; }
.puce .point { width: 8px; height: 8px; box-shadow: none; }
.puce b { font-weight: 650; }
.puce.alerte { color: var(--attente); }
.puce.alerte .point { background: var(--attente); }

p.alerte { margin: 0; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--ko) 14%, var(--surface)); }
.succes { margin: 0; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }

/* ---------- formulaires ---------- */
form { margin: 0; }
.formulaire { display: flex; flex-direction: column; gap: 12px; }
.formulaire label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
input[type=text], input[type=password], input[type=date], input[type=email], input[type=tel], select {
  width: 100%; min-height: 46px; padding: 0 12px; font: inherit; font-weight: 400; color: var(--texte);
  background: var(--surface-2); border: 0; border-radius: 12px; }
input[type=color] { width: 64px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--texte); min-height: 32px; }
input[type=file] { font: inherit; font-weight: 400; font-size: 14px; }
.formulaire label.case, label.case { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; }
label.case input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--texte); }
.ligne-reglage { display: flex !important; flex-direction: row !important; align-items: center; justify-content: space-between; }
.seuil-valeur { font-family: var(--mono); font-weight: 600; }

/* ---------- accueil : liste des événements ---------- */
.entete-page { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0 14px; }
.liste-evenements { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--rayon); padding: 0 16px; }
.evenement { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 0; text-decoration: none; }
.evenement + .evenement { border-top: 1px solid var(--trait); }
.pastille-couleur { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--texte) 18%, transparent); }
.ev-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ev-texte strong { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-texte .aide { display: flex; align-items: center; gap: 6px; }
.chiffres { color: var(--doux); font-size: 13.5px; }
.chiffres b { color: var(--texte); font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 6px; flex: none; color: var(--ok); font-size: 13px; font-weight: 600; }
.badge .point { width: 7px; height: 7px; box-shadow: none; background: var(--ok); }
.couverture { display: none; }

/* ---------- fiche événement ---------- */
.vue { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.vue + .vue { margin-top: 28px; }
.tete-vue { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; }
.tete-vue h2 { font-size: 17px; font-weight: 650; }

/* Direct */
.reception { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; min-height: 64px; border-radius: var(--rayon); background: var(--surface); }
.reception .txt { flex: 1; min-width: 0; }
.reception b, .fiche-photo b { display: block; font-size: 16px; font-weight: 650; }
.reception small, .fiche-photo small { display: flex; align-items: center; gap: 6px; color: var(--doux); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.derniere { display: flex; flex-direction: column; gap: 10px; }
.derniere-photo { display: block; width: calc(100% + 32px); margin: 6px -16px 0; padding: 0; border: 0; background: #000; cursor: pointer; aspect-ratio: 3 / 2; }
.derniere-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.derniere-photo { position: relative; }
.derniere-texte { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9a9a9a; font-size: 14px; }
.derniere.masquee .derniere-photo img { opacity: .3; filter: grayscale(1); }
.fiche-photo { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: var(--rayon); background: var(--surface); }
.fiche-photo .txt { flex: 1; min-width: 0; }
.fiche-photo b { font-family: var(--mono); font-size: 14.5px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fiche-photo small .point { width: 7px; height: 7px; box-shadow: none; }
.vide-direct { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 56px 16px; color: var(--doux); text-align: center; }
.vide-direct svg { width: 30px; height: 30px; }
.chiffres-detail { background: var(--surface); border-radius: var(--rayon); padding: 0 16px; }
.chiffres-detail summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 600; list-style: none; }
.chiffres-detail summary::-webkit-details-marker { display: none; }
.chiffres-detail summary::after { content: "›"; color: var(--doux); font-size: 20px; transition: transform .15s; }
.chiffres-detail[open] summary::after { transform: rotate(90deg); }
.stats { margin: 0 0 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--trait); border-radius: 12px; overflow: hidden; }
.stats div { background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column-reverse; }
.stats dt { color: var(--doux); font-size: 12.5px; }
.stats dd { margin: 0; font-size: 20px; font-weight: 650; }
.chiffres-detail .aide { padding-bottom: 14px; }

/* Photos */
.filtres { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.filtre { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border-radius: 10px; border: 0;
  background: var(--surface); color: var(--doux); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.filtre[aria-pressed="true"] { background: var(--plein); color: var(--plein-texte); }
.filtre input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.filtre:has(input:checked) { background: var(--plein); color: var(--plein-texte); }
.filtre:has(input:focus-visible) { outline: 2px solid var(--texte); outline-offset: 2px; }
.liste-photos { display: flex; flex-direction: column; }
.ligne { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--trait); }
.vig { width: 60px; height: 60px; flex: none; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--doux); }
.vig:disabled { cursor: default; }
.vig img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ligne.masquee .vig img { opacity: .3; filter: grayscale(1); }
.ligne .txt { flex: 1; min-width: 0; }
.ligne b { display: block; font-family: var(--mono); font-size: 14px; font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne small { display: flex; align-items: center; gap: 6px; color: var(--doux); font-size: 13px; }
.ligne small .point { width: 7px; height: 7px; box-shadow: none; }
.oeil { width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: transparent; color: var(--texte); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; }
.oeil:disabled { color: var(--doux); opacity: .4; cursor: default; }
.ligne.masquee .oeil { color: var(--ko); }
.actions-ligne { display: flex; gap: 2px; flex: none; }
.corbeille-btn { color: var(--ko); }
.ligne.supprimee .vig img { opacity: .35; }

/* Réglages */
.qr-ligne { display: flex; align-items: center; gap: 14px; }
.qr { flex: none; width: 96px; height: 96px; padding: 6px; background: #fff; border-radius: 10px; }
.qr img { width: 100%; height: 100%; display: block; }
.adresse { margin: 0; font-family: var(--mono); font-size: 12.5px; color: var(--doux); word-break: break-all; }
.adresse a { text-decoration: none; }
.styles-qr summary { cursor: pointer; color: var(--doux); font-size: 14px; min-height: 40px; display: flex; align-items: center; }
.liste-qr { margin: 0; padding-left: 1.1rem; line-height: 2; font-size: 14px; }
.apercu-logo { max-height: 72px; max-width: 220px; background: #fff; padding: 6px; border-radius: 8px; align-self: flex-start; }

/* ---------- onglets : un dock flottant, posé par-dessus le contenu ----------
   Téléphone debout : en bas au centre, assez gros pour le pouce. Téléphone couché : plus petit, en bas à droite. */
.onglets { position: fixed; left: 50%; bottom: calc(12px + var(--bas)); transform: translateX(-50%); z-index: 4;
  display: flex; gap: 4px; padding: 6px; border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 78%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18), inset 0 0 0 1px var(--trait); }
.onglets a { width: 66px; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 2px; border-radius: 16px;
  color: var(--doux); text-decoration: none; font-size: 11px; font-weight: 600; }
.onglets a svg { width: 27px; height: 27px; }
.onglets a span { display: none; }
.onglets a[aria-current="page"] { color: var(--texte); background: var(--surface-2); }
.page-evenement main { padding-bottom: calc(96px + var(--bas)); }
.avec-onglets .vue:not(.active) { display: none; }
.avec-onglets .vue + .vue { margin-top: 0; }

/* Éléments réservés à l'ordinateur (et inversement) */
.choix-evenement, .etat-global, .bande { display: none; }
@media not all and (min-width: 900px) and (min-height: 501px) { .grand-ecran { display: none !important; } }
kbd { font-family: var(--mono); font-size: .85em; padding: 0 5px; border-radius: 5px; border: 1px solid var(--trait); background: var(--surface); }

/* ---------- toast et aperçu ---------- */
.toast { position: fixed; left: max(12px, var(--gauche)); right: max(12px, var(--droite)); bottom: calc(86px + var(--bas)); z-index: 8;
  max-width: 460px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4px 4px 4px 16px; border-radius: 14px; background: var(--plein); color: var(--plein-texte);
  font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.toast button { min-height: 44px; padding: 0 14px; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }

.apercu { position: fixed; inset: 0; z-index: 10; background: #000; color: #fff; display: flex; flex-direction: column;
  padding: calc(12px + var(--haut)) max(12px, var(--droite)) calc(12px + var(--bas)) max(12px, var(--gauche)); gap: 12px; }
.apercu-haut { display: flex; align-items: center; min-height: 40px; }
.apercu-haut .txt { display: flex; flex-direction: column; min-width: 0; }
.apercu-haut b { font-family: var(--mono); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apercu-haut small { color: #a8a8a8; font-size: 13px; }
.apercu-image { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; }
.apercu-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.apercu-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: rgba(28, 28, 28, .85); color: #fff; font: inherit; font-size: 26px; line-height: 1; cursor: pointer; }
#apercu-prec { left: 0; }
#apercu-suiv { right: 0; }
.apercu-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 520px; margin: 0 auto; }
.apercu .bouton { background: #1c1c1c; color: #fff; }
.apercu .bouton.plein { background: #f4f4f4; color: #000; }

/* ---------- téléphone couché : la photo prend tout l'écran, les infos flottent en bulles ---------- */
@media (orientation: landscape) and (max-height: 500px) {
  .page-evenement .barre { padding: 0; }
  .page-evenement .barre > :not(.onglets) { display: none; }
  .page-evenement main { padding-top: calc(10px + var(--haut)); padding-bottom: calc(80px + var(--bas)); }
  .avec-onglets .onglets { left: auto; right: max(12px, var(--droite)); transform: none; gap: 2px; padding: 4px; border-radius: 16px; }
  .avec-onglets .onglets a { width: 50px; min-height: 44px; border-radius: 12px; }
  .avec-onglets .onglets a svg { width: 23px; height: 23px; }
  .avec-onglets .liste-photos { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .avec-onglets #reglages.active { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .avec-onglets #reglages > .tete-vue, .avec-onglets #reglages > .succes { grid-column: 1 / -1; }
  .toast { bottom: calc(16px + var(--bas)); right: auto; left: max(12px, var(--gauche)); max-width: 50%; margin: 0; }

  .avec-onglets #direct.active { position: fixed; inset: 0; z-index: 5; display: block; padding: 0; background: #000; color: #fff;
    --ok: #3ccf6e; --ko: #ff5a52; --attente: #e3b341; }
  #direct.active .derniere-photo { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; aspect-ratio: auto; }
  #direct.active .derniere-photo img { object-fit: cover; }
  #direct.active .reception, #direct.active .puces, #direct.active .fiche-photo, .vue-direct .onglets {
    position: fixed; z-index: 6; transition: opacity .2s ease; }
  #direct.active .reception, #direct.active .fiche-photo, #direct.active .puce, .vue-direct .onglets {
    background: var(--bulle); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: #fff; }
  #direct.active .reception { top: calc(12px + var(--haut)); left: max(12px, var(--gauche)); max-width: 46%; min-height: 56px; padding: 8px 8px 8px 14px; }
  #direct.active .puces { top: calc(12px + var(--haut)); right: max(12px, var(--droite)); max-width: 46%; justify-content: flex-end; gap: 6px; }
  #direct.active .puce { min-height: 36px; }
  #direct.active .puce.alerte { color: var(--attente); }
  #direct.active .reception small, #direct.active .fiche-photo small { color: rgba(255, 255, 255, .75); }
  #direct.active .fiche-photo { bottom: calc(12px + var(--bas)); left: max(12px, var(--gauche)); max-width: 50%; padding: 8px 8px 8px 14px; }
  #direct.active .fiche-photo .bouton { background: rgba(255, 255, 255, .16); color: #fff; }
  #direct.active .aide, #direct.active .chiffres-detail { display: none; }
  #direct.active .vide-direct { position: absolute; inset: 0; justify-content: center; color: #bbb; }
  .vue-direct .onglets { z-index: 6; box-shadow: none; }
  .vue-direct .onglets a { color: rgba(255, 255, 255, .6); }
  .vue-direct .onglets a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .16); }
  .vue-direct .toast { right: auto; left: max(12px, var(--gauche)); bottom: calc(76px + var(--bas)); max-width: 50%; margin: 0; }
  .sans-bulles #direct.active .reception, .sans-bulles #direct.active .puces, .sans-bulles #direct.active .fiche-photo,
  .vue-direct.sans-bulles .onglets { opacity: 0; pointer-events: none; }
}

/* ---------- ordinateur ---------- */
/* Hauteur minimale : un grand téléphone couché (plus de 900 px de large) garde la version « paysage » ci-dessus. */
@media (min-width: 900px) and (min-height: 501px) {
  .petit-ecran { display: none !important; }
  main { max-width: 1400px; }

  /* Une seule barre : marque, événement, onglets, état du PC */
  .page-evenement .barre { position: sticky; top: 0; z-index: 4; background: var(--fond);
    border-bottom: 1px solid var(--trait); padding-top: calc(10px + var(--haut)); padding-bottom: 10px; }
  /* Toutes les pages d'une galerie (client ou live, tous les onglets) : la barre du haut reste visible au
     défilement. Sa hauteur (--haut-barre, mesurée par commun.js) décale ce qui colle en dessous. */
  .page-galerie .barre-galerie { position: sticky; top: 0; z-index: 5; background: var(--fond); border-bottom: 1px solid var(--trait); }
  .page-galerie main { padding-top: 16px; }
  html { scroll-padding-top: calc(var(--haut-barre, 0px) + 12px); }
  .choix-evenement { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; max-width: 300px; padding: 0 12px; border-radius: 10px;
    background: var(--surface); text-decoration: none; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .choix-evenement .pastille-couleur { width: 10px; height: 10px; }
  .choix-evenement .chevron { color: var(--doux); }
  .onglets { position: static; display: flex; gap: 2px; padding: 0; border: 0; border-radius: 0; background: none; transform: none;
    box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .onglets a { width: auto; flex-direction: row; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
  .onglets a[aria-current="page"] { background: var(--surface); }
  .onglets a svg { width: 19px; height: 19px; }
  .onglets a span { display: inline; }
  .onglets a[aria-current="page"] { background: var(--surface); }
  .etat-global { display: flex; gap: 8px; margin-left: auto; }
  .etat-global .puce { min-height: 36px; }
  .page-evenement main { padding-top: 20px; padding-bottom: 40px; }
  .toast { bottom: 24px; }

  /* Direct : la photo en grand + la bande des dernières à gauche, les chiffres et la fiche à droite */
  .avec-onglets #direct.active { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto auto auto auto 1fr auto;
    gap: 12px 20px; height: calc(100vh - 110px); min-height: 560px; padding: 0; }
  #direct > * { grid-column: 2; }
  #direct .derniere { display: contents; }
  #direct .derniere-photo { grid-column: 1; grid-row: 1 / 6; width: 100%; height: 100%; min-height: 0; margin: 0; aspect-ratio: auto;
    border-radius: var(--rayon); overflow: hidden; }
  #direct .vide-direct { grid-column: 1; grid-row: 1 / 6; justify-content: center; border-radius: var(--rayon); background: var(--surface); }
  #direct .bande { grid-column: 1; grid-row: 6; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
  #direct .reception { grid-row: 1; }
  #direct .puces { grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  #direct #aide-pc { grid-row: 3; }
  #direct .fiche-photo { grid-row: 4; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; }
  #direct .fiche-photo .txt { grid-column: 1 / -1; }
  #direct .chiffres-detail { grid-row: 5 / 7; min-height: 0; overflow-y: auto; }
  #direct #etat-pc { display: none; }
  #direct .puce { flex-direction: column; align-items: flex-start; gap: 0; min-height: 0; padding: 12px 14px; border-radius: 14px; white-space: normal; }
  #direct .puce b { font-size: 26px; line-height: 1.15; }
  #direct .puce span { color: var(--doux); font-size: 12.5px; }
  #direct .puce .point { display: none; }
  #direct .puce.alerte b { color: var(--attente); }
  .bande button { position: relative; padding: 0; border: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 3 / 2; background: var(--surface-2);
    color: var(--doux); font: inherit; font-size: 12px; cursor: pointer; }
  .bande button img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .bande button[aria-current="true"] { outline: 2px solid var(--texte); outline-offset: 2px; }
  .bande button.masquee img { opacity: .3; filter: grayscale(1); }
  .bande button:disabled { cursor: default; }

  /* Photos : une grille de vignettes, l'œil apparaît au survol */
  .liste-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 12px; }
  .ligne { position: relative; flex-direction: column; align-items: stretch; gap: 6px; padding: 0; border-bottom: 0; }
  .vig { width: 100%; height: auto; aspect-ratio: 3 / 2; cursor: zoom-in; }
  .vig:disabled { background: repeating-linear-gradient(-45deg, var(--surface-2) 0 8px, var(--surface) 8px 16px); }
  .ligne b { font-size: 12.5px; }
  .ligne small { font-size: 12px; }
  .oeil { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border-radius: 10px; background: rgba(16, 16, 16, .62);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; opacity: 0; transition: opacity .15s ease; }
  .oeil svg.ic { width: 19px; height: 19px; }
  .ligne:hover .oeil, .oeil:focus-visible, .ligne.masquee .oeil { opacity: 1; }
  .ligne.masquee .oeil { color: #ff8a84; }
  .oeil:disabled { display: none; }
  /* L'œil et la corbeille : ensemble en haut à droite de la vignette */
  .actions-ligne { position: absolute; top: 6px; right: 6px; gap: 6px; }
  .actions-ligne .oeil { position: static; }
  .ligne:hover .corbeille-btn, .corbeille-btn:focus-visible { opacity: 1; }
  .corbeille-btn { color: #ff8a84; }
  .actions-ligne .bouton { opacity: 1; }

  /* Réglages : trois colonnes */
  .avec-onglets #reglages.active { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; align-items: start; }
  #reglages > .tete-vue, #reglages > .succes { grid-column: 1 / -1; }

  /* Événements : des cartes avec la dernière photo en couverture */
  .accueil { gap: 14px; }
  .liste-evenements { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; padding: 0; background: none; }
  .evenement { position: relative; flex-direction: column; align-items: stretch; gap: 0; min-height: 0; padding: 0; border-radius: var(--rayon);
    overflow: hidden; background: var(--surface); }
  .evenement + .evenement { border-top: 0; }
  .evenement .couverture { display: block; aspect-ratio: 3 / 2; background: var(--surface-2); }
  .evenement .couverture img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .evenement .pastille-couleur { position: absolute; top: 14px; right: 14px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
  .evenement .ev-texte { padding: 12px 14px 14px; }
  .evenement .badge { position: absolute; top: 10px; left: 10px; height: 26px; padding: 0 10px; border-radius: 8px;
    background: rgba(16, 16, 16, .6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; }
  .evenement .badge .point { background: #3ccf6e; }
  .evenement:hover { outline: 2px solid var(--trait); }
  .accueil > .etat-emails { max-width: 720px; }

  /* Aperçu : flèches sur les côtés, boutons centrés */
  .apercu { padding: 16px 24px 20px; }
  .apercu-image { padding: 0 64px; }
}

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

/* ---------- galerie classique (livraison au client) ---------- */
.barre-galerie { flex-wrap: wrap; row-gap: 8px; }
.titre-galerie { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.titre-galerie b { font-size: 17px; font-weight: 650; }
.onglets-galerie { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); }
.onglets-galerie a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 10px;
  color: var(--doux); text-decoration: none; font-size: 14px; font-weight: 600; }
.onglets-galerie a[aria-current="page"] { background: var(--plein); color: var(--plein-texte); }
.actions-galerie { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.puce.etat-preparation { color: var(--attente); }
.puce.etat-preparation .point { background: var(--attente); }
.puce.etat-prete { color: var(--ok); }
.puce.etat-prete .point { background: var(--ok); }
.puce.etat-expiree { color: var(--ko); }
.puce.etat-expiree .point { background: var(--ko); }
.page-galerie main { max-width: 1360px; }

.import { gap: 14px; }
.depot { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; min-height: 112px; padding: 16px;
  border: 1.5px dashed color-mix(in srgb, var(--texte) 25%, transparent); border-radius: 14px; color: var(--doux); cursor: pointer; text-align: center; }
.depot.survol { border-color: var(--texte); background: var(--surface-2); color: var(--texte); }
.depot .ic { width: 26px; height: 26px; }
.progressions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.progression { display: flex; flex-direction: column; gap: 6px; }
.ligne-prog { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; min-height: 24px; }
.ligne-prog .lien { min-height: 24px; font-size: 13.5px; }
.rate { color: var(--ko) !important; }
.barre-prog { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.barre-prog span { display: block; height: 100%; width: 0; background: var(--plein); transition: width .3s; }
.barre-prog.attente span { background: var(--attente); }
#disque.alerte { color: var(--ko); }

.grille-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 6px; }
.tuile { position: relative; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.tuile a, .attente-tuile { display: block; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.tuile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attente-tuile { display: flex; align-items: center; justify-content: center; color: var(--doux); font-size: 12.5px; }
.statut-erreur .attente-tuile { color: var(--ko); }
.tuile.ouverture a { outline: 2px solid var(--texte); outline-offset: 2px; }
.badge-ouverture { position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--bulle); color: #fff; font-size: 11.5px; font-weight: 600; }
.tuile figcaption { font-family: var(--mono); font-size: 11.5px; color: var(--doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions-tuiles { display: flex; gap: 4px; flex-wrap: wrap; }
.action-tuile { min-height: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: var(--surface); color: var(--texte); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.action-tuile.danger { color: var(--ko); }
@media (hover: hover) {
  .tuile .actions-tuiles { opacity: 0; transition: opacity .15s; }
  .tuile:hover .actions-tuiles, .tuile:focus-within .actions-tuiles { opacity: 1; }
}

.reglages-galerie { max-width: 560px; }
.reglages-galerie h2 { margin-top: 8px; }
.reglages-galerie textarea { width: 100%; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--texte);
  background: var(--surface-2); border: 0; border-radius: 12px; resize: vertical; }
.prolonger { display: flex; gap: 8px; flex-wrap: wrap; }
.liste-evenements .type-galerie { flex: none; font-size: 12px; font-weight: 600; color: var(--doux); }
.titre-section { margin: 18px 0 0; font-size: 15px; font-weight: 650; color: var(--doux); }

/* Galerie classique : chapitres, sélection, ordre (C2) */
.galerie-photos { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.chapitres-admin { flex: 1 1 240px; max-width: 280px; gap: 6px; padding: 12px; }
.chapitres-admin .etiquette-bloc { margin: 4px 6px; }
.contenu-photos { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.liste-chapitres { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.chapitre { display: flex; align-items: center; gap: 2px; border-radius: 10px; }
.chapitre.actif { background: var(--surface-2); }
.chapitre.actif .nom-chapitre { font-weight: 650; }
.chapitre.cible { outline: 2px dashed var(--texte); outline-offset: -2px; }
.nom-chapitre { flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px;
  padding: 0 10px; border: 0; background: none; color: var(--texte); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.nom-chapitre span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nom-chapitre small { color: var(--doux); font-size: 13px; }
.fleche-chapitre { width: 30px; height: 36px; flex: none; border: 0; border-radius: 8px; background: none; color: var(--doux); font: inherit; cursor: pointer; }
.fleche-chapitre:hover:not(:disabled) { background: var(--surface); color: var(--texte); }
.fleche-chapitre:disabled { opacity: .25; cursor: default; }
.form-chapitre { display: flex; gap: 6px; margin-top: 6px; }
.form-chapitre input { min-height: 40px; }
.titre-vue { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.titre-vue h2 { font-size: 22px; letter-spacing: -.02em; }
.barre-selection { position: sticky; top: calc(var(--haut-barre, 0px) + 8px); z-index: 3; align-self: flex-start; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 6px 6px 6px 16px; border-radius: 16px; background: var(--plein); color: var(--plein-texte); font-size: 14px; }
.barre-selection span { padding-right: 6px; }
.barre-selection select { width: auto; min-height: 38px; background: color-mix(in srgb, var(--plein-texte) 14%, transparent); color: var(--plein-texte); }
.barre-selection select option { color: #000; }
.bouton-sel { min-height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--plein-texte) 14%, transparent);
  color: var(--plein-texte); font: inherit; font-size: 14px; cursor: pointer; }
.bouton-sel.danger { color: #ff8a80; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tuile .coche { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 2px solid #fff; background: rgba(16, 16, 16, .35); box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.tuile .coche[aria-pressed="true"] { background: var(--plein); border-color: var(--plein-texte); }
.tuile .coche[aria-pressed="true"]::after { content: "✓"; display: block; color: var(--plein-texte); font-size: 14px; font-weight: 700; line-height: 22px; text-align: center; }
.tuile.choisie a, .tuile.choisie .attente-tuile { outline: 3px solid var(--texte); outline-offset: 2px; }
.tuile.glissee { opacity: .4; }
.tuile.avant a, .tuile.avant .attente-tuile { box-shadow: -5px 0 0 0 var(--texte); }
.tuile.apres a, .tuile.apres .attente-tuile { box-shadow: 5px 0 0 0 var(--texte); }
.tuile[draggable="true"] { cursor: grab; }
@media (hover: hover) {
  .tuile .coche { opacity: 0; transition: opacity .15s; }
  .tuile:hover .coche, .tuile .coche:focus-visible, .tuile .coche[aria-pressed="true"], .grille-admin:has(.choisie) .coche { opacity: 1; }
}

/* Galerie classique : accès et activité (C3) */
.choix-segment { margin: 0; padding: 0; border: 0; min-width: 0; }
.choix-segment legend { padding: 0 0 6px; font-weight: 600; font-size: 14px; }
.segment { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 12px;
  background: var(--surface-2); }
.formulaire .choix-segment label { position: relative; flex-direction: row; justify-content: center; align-items: center;
  min-height: 40px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--doux); cursor: pointer; }
.choix-segment input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choix-segment label:has(input:checked) { background: var(--surface); color: var(--texte); }
.choix-segment label:has(input:focus-visible) { outline: 2px solid var(--texte); }
.ligne-pin { display: flex; align-items: flex-end; gap: 8px; }
.champ-pin { font-family: var(--mono) !important; font-size: 20px !important; letter-spacing: .2em; max-width: 160px; }
.tuiles-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.tuiles-chiffres .bloc { gap: 2px; }
.tuiles-chiffres b { font-size: 30px; font-weight: 650; letter-spacing: -.02em; }
.activite { display: flex; flex-direction: column; gap: 16px; }
.activite-corps { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.tableau-visiteurs { flex: 3 1 520px; min-width: 0; overflow-x: auto; padding: 8px 0; }
.tableau-visiteurs table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau-visiteurs th { text-align: left; color: var(--doux); font-weight: 500; font-size: 13px; padding: 10px 16px; }
.tableau-visiteurs td { padding: 10px 16px; border-top: 1px solid var(--trait); }
.tableau-visiteurs .nb { text-align: right; }
.tableau-visiteurs .doux, .tableau-visiteurs tr.doux td { color: var(--doux); }
.lien-visiteur { padding: 0; border: 0; background: none; color: var(--texte); font: inherit; font-weight: 600; text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; min-height: 32px; }
.favoris-visiteur { flex: 2 1 340px; min-width: 0; }
.vignettes-favoris { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.vignettes-favoris img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; display: block; }
.noms-lightroom { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-family: var(--mono); font-size: 12.5px;
  color: var(--doux); overflow-wrap: anywhere; max-height: 120px; overflow-y: auto; }

/* Galerie classique : écrans Style et Envoi */
.ecran-style { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.choix-style { flex: 1 1 260px; max-width: 320px; }
.carte-style { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px; }
.carte-style.choisie { border: 2px solid var(--texte); background: #fbfaf7; color: #1b1a18; }
.carte-style.choisie .aide { color: #6e6a63; }
.carte-style.a-venir { border: 1.5px dashed var(--trait); }
.vignette-style { display: block; aspect-ratio: 16 / 10; border-radius: 8px; background: #5e574f; }
.cadrage { flex: 3 1 480px; min-width: 0; }
.zone-point { position: relative; align-self: flex-start; max-width: 100%; cursor: crosshair; line-height: 0; }
.zone-point img { max-width: 100%; max-height: 62vh; border-radius: 12px; display: block; user-select: none; }
.point-interet { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; pointer-events: none;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(0, 0, 0, .35); }
.point-interet::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px;
  border-radius: 50%; background: #fff; }
.apercus { flex: 2 1 300px; min-width: 0; }
.apercu-ecran { position: relative; overflow: hidden; border-radius: 10px; background: #5e574f; display: flex; align-items: flex-end;
  justify-content: center; }
.apercu-ecran.ordinateur { aspect-ratio: 16 / 10; }
.apercu-ecran.telephone { width: 140px; aspect-ratio: 9 / 19; border-radius: 16px; }
.apercu-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.apercu-titre { position: relative; padding-bottom: 14%; color: #fff; font-family: Georgia, serif; font-style: italic; font-size: 26px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .4); text-align: center; line-height: 1.1; }
.telephone .apercu-titre { font-size: 17px; padding: 0 8px 22%; }
.ecran-envoi { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; align-items: start; }
@media (max-width: 800px) { .ecran-envoi { grid-template-columns: 1fr; } }
.verifications ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.verifications li { display: flex; align-items: center; gap: 10px; min-height: 44px; border-top: 1px solid var(--trait); }
.verifications li:first-child { border-top: 0; }
.marque-verif { width: 22px; height: 22px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; }
.fait .marque-verif { color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, transparent); }
.a-voir .marque-verif { color: var(--attente); background: color-mix(in srgb, var(--attente) 18%, transparent); }
.verifications .quoi { flex: 1; }
.verifications .detail { color: var(--doux); font-size: 13.5px; text-align: right; }
.ligne-lien { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.adresse-envoi { flex: 1 1 300px; min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px;
  background: var(--surface-2); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
#message-client { width: 100%; padding: 12px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--texte);
  font: inherit; font-size: 14.5px; line-height: 1.5; resize: vertical; }
.actions-envoi { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

/* Style : mise en page et choix de la photo d'ouverture */
.mise-en-page { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--trait); }
.choix-segment.choix-deux .segment { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fenetre-choix { width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 16px; border: 0;
  border-radius: var(--rayon); background: var(--fond); color: var(--texte); }
.fenetre-choix::backdrop { background: rgba(0, 0, 0, .5); }
.grille-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.grille-choix button { padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 1 / 1; cursor: pointer; background: var(--surface-2); }
.grille-choix button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grille-choix button[aria-current="true"] { outline: 3px solid var(--texte); outline-offset: 2px; }
.grille-choix button:hover img { opacity: .85; }

/* Style : trois colonnes sur toute la largeur, aperçu de la galerie au centre */
.page-large main { max-width: none; }
.ecran-style { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(300px, 400px); align-items: start; }
.ecran-style .choix-style { max-width: none; }
.colonne-ouverture { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1200px) {
  .ecran-style { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); }
  .colonne-ouverture { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}
@media (max-width: 760px) { .ecran-style { grid-template-columns: 1fr; } }
.ligne-reglage-ecart output { float: right; font-weight: 400; color: var(--doux); font-family: var(--mono); }
.ligne-reglage-ecart input[type=range] { accent-color: var(--texte); }
.apercu-galerie { min-width: 0; }
.petit-segment { grid-template-columns: repeat(2, auto); }
.petit-segment button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: var(--doux);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.petit-segment button[aria-checked="true"] { background: var(--surface); color: var(--texte); }
.cadre-apercu { position: relative; margin: 0 auto; overflow-y: auto; overflow-x: hidden; border-radius: 12px;
  background: #fbfaf7; box-shadow: inset 0 0 0 1px var(--trait); scrollbar-width: thin; }
.cadre-apercu[data-ecran="ordinateur"] { width: 100%; aspect-ratio: 16 / 10; max-height: 72vh; }
.cadre-apercu[data-ecran="telephone"] { width: 300px; max-width: 100%; aspect-ratio: 9 / 19.5; max-height: 72vh; border-radius: 26px; }
.fond-apercu { position: relative; }
.fond-apercu img { position: absolute; object-fit: cover; display: block; background: #e2ddd5; }
.fond-apercu .titre-apercu { position: absolute; left: 0; right: 0; text-align: center; color: #1b1a18;
  font-family: Georgia, "Times New Roman", serif; line-height: 1; }

/* Choix en segments dans un formulaire : libellés centrés, une seule ligne, toute la case cliquable */
.formulaire .choix-segment .segment label { display: flex; flex-direction: row; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 8px; text-align: center; white-space: nowrap; gap: 0; }
.formulaire .choix-segment .segment label span { display: block; width: 100%; text-align: center; }
.deux-reglages { display: grid; grid-template-columns: 1fr; gap: 10px; }

/* Onglet Photos sur toute la largeur : chapitres à gauche, à l'écart ; photos au centre */
.galerie-photos { display: grid; grid-template-columns: 260px minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.galerie-photos .chapitres-admin { max-width: none; position: sticky; top: calc(var(--haut-barre, 0px) + 12px);
  max-height: calc(100vh - var(--haut-barre, 0px) - 24px); overflow-y: auto; }
@media (max-width: 1400px) { .galerie-photos { grid-template-columns: 240px minmax(0, 1fr); } }
@media (max-width: 760px) { .galerie-photos { grid-template-columns: 1fr; } .galerie-photos .chapitres-admin { position: static; } }
.groupe-photos + .groupe-photos { margin-top: 28px; }
.tete-groupe { display: flex; align-items: baseline; gap: 10px; padding: 14px 0 10px; border-top: 1px solid var(--trait); }
.tete-groupe h3 { font-size: 18px; letter-spacing: -.01em; }
.vide-groupe { display: none; margin: 0; min-height: 90px; align-items: center; justify-content: center; border-radius: 12px;
  border: 1.5px dashed color-mix(in srgb, var(--texte) 22%, transparent); color: var(--doux); font-size: 14px; }
.grille-photos:empty + .vide-groupe { display: flex; }
.grille-photos.mode-vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.grille-photos.mode-galerie { display: flex; flex-wrap: wrap; align-items: flex-start; }
.mode-galerie .tuile { flex: none; display: block; }
.mode-galerie .tuile a, .mode-galerie .attente-tuile { aspect-ratio: auto; width: 100%; height: 100%; border-radius: 3px; }
.coin-tuile { position: absolute; right: 6px; bottom: 6px; z-index: 2; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(16, 16, 16, .62); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.coin-tuile svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.coin-tuile:not(.restaurer):hover { background: #c62828; }
@media (hover: hover) {
  .coin-tuile:not(.restaurer) { opacity: 0; transition: opacity .15s; }
  .tuile:hover .coin-tuile, .coin-tuile:focus-visible { opacity: 1; }
}
.mode-vignettes .tuile { display: block; }
/* La grille contient maintenant des groupes (un par chapitre), les uns sous les autres */
.grille-admin { display: block; }
/* Le choix en segments prend toute la largeur du formulaire (sinon « Pleine largeur » déborde de sa case) */
.formulaire .choix-segment, .formulaire .choix-segment .segment { width: 100%; box-sizing: border-box; }

/* Menu « Trier », dans la barre des photos (avant : un panneau à droite) */
.galerie-photos { grid-template-columns: 260px minmax(0, 1fr); }
@media (max-width: 760px) { .galerie-photos { grid-template-columns: 1fr; } }
.tri-deroulant { position: relative; }
.tri-deroulant > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.tri-deroulant > summary::-webkit-details-marker { display: none; }
.tri-deroulant > summary .ic { width: 17px; height: 17px; }
.tri-deroulant[open] > summary { background: var(--plein); color: var(--plein-texte); }
.tri-admin { width: 290px; gap: 4px; }
.tri-admin > .aide { margin: 6px 10px; }
.liste-tris { display: flex; flex-direction: column; gap: 2px; }
.bouton-tri { display: flex; flex-direction: column; align-items: flex-start; min-height: 48px; padding: 6px 10px; border: 0; border-radius: 10px;
  background: none; color: var(--texte); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.bouton-tri small { color: var(--doux); font-size: 12.5px; }
.bouton-tri:hover { background: var(--surface-2); }

/* Visionneuse du tableau de bord : la photo en grand, dans la page */
.vis-admin { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: rgba(8, 8, 8, .94); color: #f4f4f4; }
.vis-admin:focus { outline: none; }
.vis-admin-haut { display: flex; align-items: center; gap: 16px; min-height: 60px; padding: 8px 12px 8px 20px; }
.vis-admin-nom { font-family: var(--mono); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vis-admin-position { flex: 1; color: #9a9a9a; font-size: 13px; }
.vis-admin-bouton, .vis-admin-nav { width: 48px; height: 48px; flex: none; border: 0; border-radius: 50%; background: none; color: #f4f4f4;
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.vis-admin-bouton:hover, .vis-admin-nav:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.vis-admin-nav:disabled { opacity: .2; cursor: default; }
.vis-admin-image { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; }
.vis-admin-image img { max-width: calc(100% - 128px); max-height: 100%; object-fit: contain; transform-origin: 0 0; user-select: none; }
.vis-admin-aide { margin: 0; padding: 10px 0 16px; text-align: center; color: #8e8e8e; font-size: 12.5px; }
body.vis-ouverte { overflow: hidden; }
.zoomable { touch-action: none; cursor: zoom-in; }
.zoomable.zoomee { cursor: grab; }
.zoomable.zoomee:active { cursor: grabbing; }
@media (max-width: 700px) {
  .vis-admin-nav, .vis-admin-aide { display: none; }
  .vis-admin-image { justify-content: center; padding: 0; }
  .vis-admin-image img { max-width: 100%; }
}
/* Zoom : la photo reste dans sa zone ; les boutons restent au-dessus */
.vis-admin-image { overflow: hidden; }
.vis-admin-nav { position: relative; z-index: 2; }


/* =====================================================================
   Tableau de bord : menu principal, accueil, page Galeries, Réglages
   ===================================================================== */

/* ---------- menu principal : en bas sur téléphone ---------- */
.menu-principal { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 6px max(8px, var(--droite)) calc(6px + var(--bas)) max(8px, var(--gauche));
  background: var(--surface); border-top: 1px solid var(--trait); }
.menu-principal.rail, .menu-marque, .menu-bas { display: none; }
.menu-liens { display: contents; }
.menu-liens a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px;
  color: var(--doux); text-decoration: none; font-size: 11.5px; font-weight: 500; border-radius: 12px; }
.menu-liens a[aria-current="page"] { color: var(--texte); font-weight: 600; }
.avec-menu:not(.menu-rail) main { padding-bottom: calc(96px + var(--bas)); }
.monogramme { width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--plein); color: var(--plein-texte);
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; letter-spacing: .02em; }

/* ---------- menu principal : à gauche sur ordinateur (une colonne d'icônes dans une galerie) ---------- */
@media (min-width: 900px) and (min-height: 501px) {
  body.avec-menu { padding-left: 248px; }
  body.avec-menu.menu-rail { padding-left: 72px; }
  .avec-menu:not(.menu-rail) main { padding-bottom: 48px; }
  .menu-principal, .menu-principal.rail { position: fixed; top: 0; bottom: 0; left: 0; right: auto; width: 248px;
    display: flex; flex-direction: column; gap: 28px; padding: 24px 16px; border-top: 0; border-right: 1px solid var(--trait);
    background: color-mix(in srgb, var(--surface) 40%, var(--fond)); overflow-y: auto; }
  .menu-marque { display: flex; align-items: center; gap: 12px; padding: 0 8px; text-decoration: none; }
  .menu-nom { display: flex; flex-direction: column; min-width: 0; }
  .menu-nom b { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .menu-nom small { color: var(--doux); font-size: 12.5px; }
  .menu-liens { display: flex; flex-direction: column; gap: 4px; }
  .menu-liens a { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px;
    color: var(--texte); font-size: 14.5px; }
  .menu-liens a:hover { background: var(--surface-2); }
  .menu-liens a svg.ic { width: 20px; height: 20px; }
  .menu-liens a[aria-current="page"] { background: var(--plein); color: var(--plein-texte); }
  .menu-bas { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: auto; padding: 0 8px; }
  .menu-bas .puce { min-height: 32px; font-size: 13px; border: 1px solid var(--trait); }
  .menu-sortie { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
  .menu-sortie svg.ic { width: 18px; height: 18px; }

  .menu-principal.rail { width: 72px; align-items: center; padding: 20px 0; gap: 24px; }
  .rail .menu-marque { padding: 0; }
  .rail .menu-nom, .rail .menu-liens span, .rail .menu-bas { display: none; }
  .rail .menu-liens { gap: 6px; }
  .rail .menu-liens a { width: 44px; padding: 0; justify-content: center; }
}

/* ---------- en-tête des rubriques ---------- */
.page-rubrique main { max-width: 1240px; padding-top: calc(20px + var(--haut)); }
.entete-rubrique { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 6px 0 20px; }
.entete-rubrique h1 { font-size: 28px; font-weight: 600; }
.actions-rubrique { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.titre-rubrique { font-size: 17px; font-weight: 600; }
.titre-rubrique .aide { display: inline; font-weight: 400; }
.etiquette-majuscules { margin: 0; color: var(--doux); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.titre-et-lien { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.lien-doux { color: var(--doux); text-decoration: none; font-size: 14px; }
.lien-doux:hover { color: var(--texte); }
.ton-ok { color: var(--ok); } .ton-attente { color: var(--attente); } .ton-ko { color: var(--ko); }
.ton-neutre { color: var(--doux); } .ton-fonce { color: var(--texte); }
.point.ton-ok { background: var(--ok); } .point.ton-attente { background: var(--attente); } .point.ton-ko { background: var(--ko); }

/* « Nouvelle galerie » : un menu qui s'ouvre (live ou client) */
.nouvelle-galerie { position: relative; }
.nouvelle-galerie > summary { list-style: none; }
.nouvelle-galerie > summary::-webkit-details-marker { display: none; }
.nouvelle-galerie .ic { width: 18px; height: 18px; }
.menu-deroulant { position: absolute; right: 0; top: calc(100% + 8px); z-index: 7; width: min(340px, calc(100vw - 32px)); display: flex; flex-direction: column;
  gap: 2px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--trait); box-shadow: 0 14px 36px rgba(0, 0, 0, .16); }
.menu-deroulant a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.menu-deroulant a:hover { background: var(--surface-2); }
.menu-deroulant b { font-weight: 600; }
.menu-deroulant small { color: var(--doux); font-size: 13px; }

/* ---------- accueil ---------- */
/* Accueil du portail : une section par bloc ; son titre n'apparaît que s'il y a plusieurs blocs */
.actions-entete { display: flex; flex-wrap: wrap; gap: 10px; }
.section-accueil + .section-accueil { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--trait); }
.titre-section-accueil { font-size: 20px; font-weight: 600; margin-bottom: 14px; }
.accueil-live { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; align-items: start; }
.accueil-colonnes { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.accueil-principal { flex: 2 1 560px; min-width: 0; gap: 26px; }
.accueil-cote { flex: 1 1 280px; min-width: 0; gap: 16px; }
.a-faire { gap: 0; padding: 18px 20px; }
.a-faire .etiquette-majuscules { margin-bottom: 6px; }
.tache { display: flex; align-items: center; gap: 14px; min-height: 56px; }
.tache + .tache { border-top: 1px solid var(--trait); }
.tache-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tache .tache-texte { display: block; }
.tache-texte b { font-weight: 600; }
.tache-texte small { color: var(--doux); font-size: 13px; }
.ligne-etat { display: flex; align-items: center; gap: 12px; }
.puce.gris { background: var(--surface-2); min-height: 32px; font-size: 13px; }
.ligne-info { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.ligne-info > :last-child { font-weight: 500; text-align: right; }

/* ---------- cartes des galeries (accueil et page Galeries) ---------- */
.cartes-galeries { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.accueil-principal .cartes-galeries { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
.carte-galerie { display: flex; flex-direction: column; border-radius: var(--rayon); overflow: hidden; background: var(--surface);
  text-decoration: none; transition: outline-color .15s; outline: 2px solid transparent; }
.carte-galerie:hover { outline-color: var(--trait); }
.couverture-carte { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; flex: none; background: var(--surface-2); }  /* overflow : une photo en hauteur est recadrée, sans agrandir la carte */
.couverture-carte img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge-live { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px;
  border-radius: 8px; background: rgba(16, 16, 16, .62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: #fff; font-size: 12px; font-weight: 600; }
.badge-live .point { width: 7px; height: 7px; background: #ff5a52; }
.carte-texte { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; min-width: 0; }
.carte-texte strong { font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-texte .chiffres { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-pied { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.etat-carte { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 13px; font-weight: 600; }
.etat-carte .point { width: 8px; height: 8px; background: currentColor; }
.suivi { font-size: 12.5px; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- page Galeries : recherche et filtres ---------- */
.recherche { display: flex; align-items: center; gap: 8px; width: 260px; max-width: 100%; min-height: 44px; padding: 0 12px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--trait); color: var(--doux); }
.recherche .ic { width: 18px; height: 18px; }
.recherche input { flex: 1; min-width: 0; min-height: 40px; border: 0; outline: none; background: none; color: var(--texte); font: inherit; font-size: 14.5px; }
.filtres-galeries { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filtre-galeries { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--trait); background: var(--surface); color: var(--texte); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.filtre-galeries span { color: var(--doux); font-weight: 500; }
.filtre-galeries[aria-pressed="true"] { background: var(--plein); border-color: var(--plein); color: var(--plein-texte); }
.filtre-galeries[aria-pressed="true"] span { color: inherit; opacity: .65; }

/* ---------- Réglages généraux ---------- */
.reglages-generaux { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.sommaire-reglages { flex: 0 0 180px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 20px; }
.sommaire-reglages a { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--doux);
  text-decoration: none; font-size: 14.5px; font-weight: 500; }
.sommaire-reglages a:hover { background: var(--surface); color: var(--texte); }
.sections-reglages { flex: 999 1 520px; min-width: 0; max-width: 860px; gap: 16px; }
.sections-reglages > .bloc { padding: 22px 24px; gap: 12px; scroll-margin-top: 16px; }
.sections-reglages h2 { font-size: 18px; font-weight: 600; }
.titre-et-puce { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.titre-et-puce.espace { justify-content: space-between; align-items: baseline; }
.fort { color: var(--texte); }
.puce-ton { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  background: color-mix(in srgb, currentColor 12%, transparent); }
.puce-ton .point { width: 7px; height: 7px; background: currentColor; box-shadow: none; }
.segment-theme { display: inline-flex; align-self: flex-start; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.segment-theme button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 9px; background: none; color: var(--doux);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.segment-theme button[aria-checked="true"] { background: var(--surface); color: var(--texte); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.tuiles-chiffres.petites b { font-size: 22px; }
.tuiles-chiffres.petites .bloc { background: var(--fond); }
.tuiles-chiffres .petit-chiffre { font-size: 16px; }
.barre-disque { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.part-clients { background: var(--texte); }
.part-live { background: color-mix(in srgb, var(--texte) 55%, var(--surface)); }
.part-reste { background: color-mix(in srgb, var(--texte) 28%, var(--surface)); }
.legende-disque { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; }
.legende-disque > span { display: inline-flex; align-items: center; gap: 6px; }
.carre { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.liste-lourdes { display: flex; flex-direction: column; }
.liste-lourdes .ligne-info { min-height: 40px; align-items: center; border-top: 1px solid var(--trait); }
.liste-lourdes .etiquette-bloc { padding-bottom: 6px; }
.compte-reglages { background: none !important; padding: 0 !important; }
@media (min-width: 900px) and (min-height: 501px) { .compte-reglages { display: none !important; } }
@media (max-width: 760px) { .sommaire-reglages { display: none; } }

/* ---------- barre d'une galerie (client ou live) : titre à gauche, menu centré, actions à droite ---------- */
.barre.barre-galerie { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "titre onglets actions"; align-items: center; gap: 10px 24px; }
.barre-galerie .titre-galerie { grid-area: titre; display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-width: 0; flex-wrap: nowrap; }
.barre-galerie .retour { min-height: 28px; font-size: 13px; }
.ligne-titre { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
.ligne-titre b { font-size: 19px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-titre .puce { flex: none; min-height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; }
.barre-galerie .onglets-galerie, .barre-galerie .onglets { grid-area: onglets; }
.barre-galerie .actions-galerie { grid-area: actions; justify-content: flex-end; flex-wrap: nowrap; }
.barre-galerie .actions-galerie .bouton { white-space: nowrap; }
.barre-galerie .actions-galerie .ic { width: 18px; height: 18px; }
.actions-galerie .bouton .point { width: 8px; height: 8px; }
.onglets-galerie { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.onglets-galerie a { flex: none; }
.onglets-galerie a:hover:not([aria-current]) { color: var(--texte); }
.envoyee-le { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Trop étroit pour trois zones : titre et actions sur une ligne, le menu centré dessous */
@media (max-width: 1279px) {
  .barre.barre-galerie { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "titre actions" "onglets onglets"; }
  .barre-galerie .onglets-galerie { justify-self: center; }
}
@media (max-width: 640px) {
  .barre.barre-galerie { grid-template-columns: minmax(0, 1fr); grid-template-areas: "titre" "actions" "onglets"; }
  .barre-galerie .actions-galerie { justify-content: flex-start; flex-wrap: wrap; }
  .barre-galerie .onglets-galerie { justify-self: stretch; }
}
/* Fiche live sur téléphone : les onglets restent le dock flottant du bas, la barre ne garde que le titre */
@media not all and (min-width: 900px) and (min-height: 501px) {
}
/* Fiche live sur ordinateur : les onglets ont la même pastille que ceux des galeries clients */
@media (min-width: 900px) and (min-height: 501px) {
  .barre-live .onglets { gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); }
  .barre-live .onglets a { min-height: 40px; padding: 0 16px; color: var(--doux); font-weight: 600; }
  .barre-live .onglets a:hover:not([aria-current]) { color: var(--texte); }
  .barre-live .onglets a[aria-current="page"] { background: var(--plein); color: var(--plein-texte); }
}
/* Téléphone : la fiche live garde l'état du PC dans l'onglet Direct, pas dans la barre ;
   les chiffres de l'accueil vont par deux */
@media not all and (min-width: 900px) and (min-height: 501px) {
  .accueil-principal .tuiles-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .accueil-principal .tuiles-chiffres b { font-size: 24px; }
  .entete-rubrique h1 { font-size: 24px; }
}

/* ---------- Réglages > Identité ---------- */
.logo-menu { width: 40px; height: 40px; flex: none; border-radius: 10px; background: #fff; display: flex; align-items: center;
  justify-content: center; padding: 4px; box-shadow: inset 0 0 0 1px var(--trait); }
.logo-menu img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.identite-colonnes { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.identite-champs { flex: 1 1 340px; min-width: 0; gap: 12px; }
.deux-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.ligne-logo { display: flex; align-items: center; gap: 16px; }
.ligne-logo .pile { gap: 6px; align-items: flex-start; }
.logo-actuel { width: 88px; height: 88px; flex: none; border-radius: 14px; background: #fff; display: flex; align-items: center;
  justify-content: center; padding: 8px; box-shadow: inset 0 0 0 1px var(--trait); }
.logo-actuel img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.monogramme.grand { width: 64px; height: 64px; font-size: 20px; }
.choisir-logo { cursor: pointer; flex-direction: row !important; font-weight: 600 !important; }
.apercu-pied { flex: 1 1 260px; min-width: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
/* L'aperçu garde les couleurs claires de la galerie client, même en mode sombre */
.pied-exemple { border-radius: 14px; background: #fbfaf7; color: #1b1a18; border: 1px solid var(--trait); padding: 28px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.pied-exemple .logo-pied { max-width: 150px; max-height: 56px; object-fit: contain; }
.nom-pied { letter-spacing: .32em; text-transform: uppercase; font-size: 11.5px; }
.pied-exemple .contacts-pied { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; color: #6e6a63; font-size: 12.5px; }
.actions-formulaire { display: flex; justify-content: flex-end; border-top: 1px solid var(--trait); padding-top: 14px; margin-top: 4px; }

/* =====================================================================
   R3 : une seule page par galerie (live, client, ou les deux)
   ===================================================================== */

/* Onglets : sur ordinateur, du texte dans une pastille ; sur téléphone, le dock flottant du bas (icônes) */
@media (min-width: 900px) and (min-height: 501px) {
  .barre-galerie .onglets { gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); }
  .barre-galerie .onglets a { width: auto; min-height: 40px; padding: 0 16px; border-radius: 10px; color: var(--doux); font-size: 14px; font-weight: 600; }
  .barre-galerie .onglets a svg { display: none; }
  .barre-galerie .onglets a:hover:not([aria-current]) { color: var(--texte); }
  .barre-galerie .onglets a[aria-current="page"] { background: var(--plein); color: var(--plein-texte); }
}
@media not all and (min-width: 900px) and (min-height: 501px) {
  .barre.barre-galerie .onglets { position: fixed; left: 50%; right: auto; bottom: calc(12px + var(--bas)); transform: translateX(-50%); z-index: 6;
    display: flex; gap: 2px; width: max-content; max-width: calc(100vw - 24px); padding: 6px; border-radius: 22px; overflow: visible;
    background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .18), inset 0 0 0 1px var(--trait); }
  .barre.barre-galerie .onglets a { flex: 1 1 0; width: auto; min-width: 46px; max-width: 66px; min-height: 52px; padding: 0;
    display: flex; align-items: center; justify-content: center; border-radius: 16px; color: var(--doux); background: none; }
  .barre.barre-galerie .onglets a span { display: none; }
  .barre.barre-galerie .onglets a svg { display: block; width: 25px; height: 25px; }
  .barre.barre-galerie .onglets a[aria-current="page"] { color: var(--texte); background: var(--surface-2); }
  .page-galerie main { padding-bottom: calc(96px + var(--bas)); }
  /* Pendant un live, sur téléphone : rien au-dessus du Direct que le titre (Page des invités : onglet Envoi) */
  .barre-live .actions-galerie { display: none; }
}

/* Organisateur : l'œil pour masquer une photo, à côté de la corbeille */
.oeil-tuile { right: 44px; }
.oeil-tuile:hover { background: rgba(16, 16, 16, .85) !important; }
.tuile.masquee img { opacity: .35; filter: grayscale(1); }
.tuile.masquee .oeil-tuile { opacity: 1; color: #ff8a84; }

/* Réglages : la galerie client et la page des invités côte à côte (l'une sous l'autre sur téléphone) */
.reglages-message { max-width: 1100px; margin: 0 auto 12px; }
.reglages-unifies { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 20px; align-items: start;
  max-width: 1100px; margin: 0 auto; }
.reglages-unifies .reglages-galerie { max-width: none; }
.reglages-unifies h2 { font-size: 18px; font-weight: 600; margin: 0; }
.reglages-unifies h3 { margin: 10px 0 0; font-size: 15px; font-weight: 600; }
.envoi-invites { max-width: 560px; margin-bottom: 20px; }
.envoi-invites h2 { font-size: 18px; font-weight: 600; margin: 0; }
.reglages-unifies:has(> :only-child) { max-width: 640px; grid-template-columns: minmax(0, 1fr); }
/* Téléphone couché, page du live : le dock reste petit, en bas à droite, en bulle sur la photo du Direct */
@media (orientation: landscape) and (max-height: 500px) {
  .avec-onglets .barre.barre-galerie .onglets { left: auto; right: max(12px, var(--droite)); transform: none; padding: 4px; border-radius: 16px; }
  .avec-onglets .barre.barre-galerie .onglets a { min-width: 46px; max-width: 50px; min-height: 44px; border-radius: 12px; }
  .avec-onglets .barre.barre-galerie .onglets a svg { width: 23px; height: 23px; }
  .vue-direct .barre.barre-galerie .onglets { background: var(--bulle); box-shadow: none; }
  .vue-direct .barre.barre-galerie .onglets a { color: rgba(255, 255, 255, .6); }
  .vue-direct .barre.barre-galerie .onglets a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .16); }
  .vue-direct.sans-bulles .barre.barre-galerie .onglets { opacity: 0; pointer-events: none; }
}

/* =====================================================================
   Statistiques (page Statistiques et onglet Activité)
   ===================================================================== */
.choix-periode { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 9px; color: var(--doux);
  text-decoration: none; font-size: 14px; font-weight: 500; }
.choix-periode[aria-current="page"] { background: var(--surface); color: var(--texte); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.statistiques { gap: 20px; }
.barres-visites { display: flex; align-items: flex-end; gap: 3px; height: 160px; border-bottom: 1px solid var(--trait); }
.barres-visites.mensuel { gap: 10px; }
.barre-jour { flex: 1 1 0; min-width: 0; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--texte); }
.barre-jour:hover { background: var(--doux); }
.axe-visites { display: flex; justify-content: space-between; color: var(--doux); font-size: 12px; }
.stats-colonnes { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.stats-galeries { flex: 2 1 520px; min-width: 0; }
.stats-cote { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.stats-cote.deux-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); align-items: start; }
.defile-tableau { overflow-x: auto; }
.tableau-stats { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; }
.tableau-stats th { padding: 8px; color: var(--doux); font-size: 12.5px; font-weight: 500; text-align: left; }
.tableau-stats td { padding: 10px 8px; border-top: 1px solid var(--trait); }
.tableau-stats .nb { text-align: right; }
.tableau-stats a { text-decoration: none; font-weight: 600; }
.tableau-stats a:hover { text-decoration: underline; }
.tableau-stats .doux { color: var(--doux); }
.grille-plus-vues { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grille-plus-vues figure { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.grille-plus-vues img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--surface-2); display: block; }
.grille-plus-vues figcaption { color: var(--doux); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapitre-vu { display: flex; flex-direction: column; gap: 4px; }
.jauge { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.jauge span { display: block; height: 100%; background: var(--texte); }
.dates-visites summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; list-style: none; }
.dates-visites summary::-webkit-details-marker { display: none; }
.dates-visites ul { margin: 6px 0 0; padding: 0; list-style: none; color: var(--doux); font-size: 12.5px; text-align: right; white-space: nowrap; }
.activite > .bloc, .activite > .stats-cote { margin-top: 16px; }
@media not all and (min-width: 900px) and (min-height: 501px) {
  .statistiques .tuiles-chiffres, .activite .tuiles-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .statistiques .tuiles-chiffres b, .activite .tuiles-chiffres b { font-size: 24px; }
  .barres-visites { height: 120px; gap: 2px; }
}
/* Page du live sur ordinateur : toute la largeur de l'écran (la photo du Direct en profite, moins de bandes noires) */
@media (min-width: 900px) and (min-height: 501px) {
  .page-evenement main { max-width: none; padding-left: 24px; padding-right: 24px; }
}
/* Direct sur ordinateur : la photo à sa vraie forme (horizontale ou verticale), coins arrondis, sans
   cadre noir autour ; elle prend toute la hauteur ou toute la largeur de la place, selon son format */
@media (min-width: 900px) and (min-height: 501px) {
  #direct .derniere-photo { display: flex; align-items: center; justify-content: center; background: none; border-radius: 0; overflow: visible; }
  #direct .derniere-photo img { width: auto; height: auto; max-width: 100%; max-height: 100%; border-radius: var(--rayon); }
  #direct .derniere-photo:has(.derniere-texte:not([hidden])) { background: var(--surface); border-radius: var(--rayon); }
  #direct .derniere-photo:focus-visible { outline: none; }
  #direct .derniere-photo:focus-visible img { outline: 2px solid var(--texte); outline-offset: 3px; }
}

/* Réglages du live : aperçu de la photo d'ambiance de la page des invités */
.apercu-ambiance { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; }

/* Live, onglet Photos : filtrer par personne (invités inscrits) */
.filtres-personnes { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: thin; }
.etiquette-personnes { flex: none; color: var(--doux); font-size: 13px; margin-right: 4px; }
.filtre-personne { flex: none; white-space: nowrap; }

/* Live devenu galerie client : filtrer par personne, sous les chapitres */
.bloc-personnes { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--trait); }

/* Réglages : supprimer la galerie (il faut taper SUPPRIMER) */
.zone-danger { display: flex; flex-direction: column; gap: 10px; max-width: 640px; margin: 24px auto 0; box-sizing: border-box; border: 1px solid color-mix(in srgb, var(--ko) 45%, var(--trait)); }
.zone-danger h2 { margin: 0; color: var(--ko); font-size: 17px; }
.zone-danger p { margin: 0; }
.liste-effacee { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.form-supprimer { max-width: 420px; }
.bouton.danger-plein { background: var(--ko); border-color: var(--ko); color: #fff; }
.bouton.danger-plein:disabled { opacity: .4; cursor: not-allowed; }

/* Segment aux libellés longs (« Tout, après le selfie ») : ils passent à la ligne */
.segment-long .segment span { white-space: normal; line-height: 1.2; text-align: center; padding-top: 4px; padding-bottom: 4px; }
