@font-face { font-family: Inter; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/polices/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/polices/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --page: #111111; --carte: #1C1C1C; --bord: #2A2A2A; --bord-fort: #333333;
  --texte: #F2F2F2; --texte-2: #A3A3A3;
  --accent: #F0A43A; --sur-accent: #1A1200;
  --danger: #FF8A7A; --danger-fond: #2A1714;
  --succes: #B5F0A8; --succes-fond: #1F2A1C;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--texte);
  font: 400 16px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
.num { font-variant-numeric: tabular-nums; }
main { max-width: 640px; margin: 0 auto; padding: 16px; }
header.barre { display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--bord); position: sticky; top: 0; background: var(--page); z-index: 1; }
header.barre h1 { font-size: 18px; font-weight: 700; margin: 0; flex: 1; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; padding: 16px; margin: 16px 0; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
p.aide { color: var(--texte-2); font-size: 14px; margin: 4px 0 0; }
button, .bouton { min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--bord-fort);
  background: var(--carte); color: var(--texte); font: 600 15px Inter, system-ui, sans-serif; cursor: pointer; }
button.principal { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }
button:disabled { opacity: .45; cursor: default; }
button.discret { min-height: 44px; background: none; border-color: transparent; color: var(--texte-2); }
input[type=password] { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--bord-fort); background: #0B0B0B; color: var(--texte); font-size: 16px; }
label { display: block; font-size: 14px; color: var(--texte-2); margin-bottom: 6px; }
.erreur { background: var(--danger-fond); color: var(--danger); border-radius: 10px; padding: 10px 12px; margin: 12px 0; }

/* Jauge de quota */
.quota { font-size: 13px; color: var(--texte-2); min-width: 130px; }
.quota .piste { height: 6px; background: #0B0B0B; border: 1px solid var(--bord); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.quota .rempli { height: 100%; background: var(--texte-2); width: 0; }
.quota.alerte { color: var(--accent); }
.quota.alerte .rempli { background: var(--accent); }

/* Zone de dépôt */
.depot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 180px; border: 2px dashed var(--bord-fort); border-radius: 14px; text-align: center; padding: 16px; }
.depot.survol { border-color: var(--accent); background: rgba(240,164,58,.06); }
.depot svg { width: 36px; height: 36px; stroke: var(--texte-2); }
.depot input { display: none; }
.actions { display: flex; gap: 10px; margin-top: 12px; }
.actions button { flex: 1; }

/* Liste des fichiers */
ul.fichiers { list-style: none; margin: 0; padding: 0; }
ul.fichiers li { padding: 10px 0; border-top: 1px solid var(--bord); }
ul.fichiers li:first-child { border-top: 0; }
.ligne { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.ligne .nom { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etat { color: var(--texte-2); white-space: nowrap; }
.etat.ok { color: var(--succes); }
.etat.ko { color: var(--danger); }
.progression { height: 4px; background: #0B0B0B; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.progression div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.resume { font-size: 14px; color: var(--texte-2); margin-top: 8px; }
#form-connexion { margin-top: 20vh; }

.champ-mdp { position: relative; }
.champ-mdp input { padding-right: 52px; }
.champ-mdp button { position: absolute; right: 0; top: 0; width: 48px; padding: 0; }
.champ-mdp svg { width: 22px; height: 22px; stroke: var(--texte-2); vertical-align: middle; }
.champ-mdp button[aria-pressed=true] svg { stroke: var(--accent); }

[hidden] { display: none !important; }
a.retour { display: inline-flex; align-items: center; min-height: 44px; color: var(--texte-2); text-decoration: none; font-weight: 600; }

/* ---------- Galerie ---------- */
body.sans-defilement { overflow: hidden; }
.entete { position: sticky; top: 0; z-index: 5; background: var(--page); padding: 16px 16px 12px;
  display: flex; flex-direction: column; gap: 14px; max-width: 1100px; margin: 0 auto; }
.entete-haut { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.marque { display: flex; align-items: center; gap: 10px; color: var(--texte); text-decoration: none; min-height: 44px; }
.marque h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.logo svg { width: 16px; height: 16px; fill: none; stroke: var(--sur-accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.entete-actions { display: flex; align-items: center; gap: 10px; }
.bouton-icone { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 10px; border: 1px solid var(--bord);
  background: var(--carte); color: var(--texte); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.bouton-icone:disabled { opacity: .35; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bouton-icone svg { width: 20px; height: 20px; }
.galerie .quota { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 0; font-size: 12px; font-weight: 500; }
.galerie .quota .piste { width: 112px; height: 6px; border-radius: 3px; background: #2A2A2A; border: 0; margin: 0; display: block; }
.galerie .quota .rempli { display: block; background: var(--accent); }
.galerie .quota.alerte .rempli { background: var(--danger); }
.galerie .quota.alerte { color: var(--danger); }

.onglets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--carte); border-radius: 12px; padding: 4px; }
.onglets button { height: 40px; min-height: 40px; padding: 0 6px; border: 0; border-radius: 9px; font-size: 13px; font-weight: 600;
  background: transparent; color: #D4D4D4; }
.onglets button[aria-pressed=true] { background: var(--accent); color: var(--sur-accent); }
.onglets .compte { opacity: .7; margin-left: 2px; }

.galerie-main { max-width: 1100px; padding: 4px 16px calc(16px + env(safe-area-inset-bottom)); }
.grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .grille { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.carte-photo { background: var(--carte); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.carte-photo.est-rejetee .vignette img { opacity: .45; }
.vignette { position: relative; display: block; width: 100%; aspect-ratio: 3 / 2; padding: 0; border: 0; border-radius: 0;
  min-height: 0; background: #0B0B0B; cursor: zoom-in; overflow: hidden; }
.vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vignette-attente { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; color: var(--texte-2); }
.badge { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.badge-gardee { background: var(--accent); color: var(--sur-accent); }
.badge-rejetee { background: #3A1F1C; color: #FFB4AA; }
.badge-a_trier { background: #2A2A2A; color: var(--texte); }
.badge-publiee { background: var(--succes-fond); color: var(--succes); }
.infos { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.infos .nom { font-size: 13px; font-weight: 600; }
.infos .meta { font-size: 11px; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions-photo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--bord); margin-top: auto; }
.actions-photo button { height: 44px; min-height: 44px; border: 0; border-radius: 0; background: none; padding: 0;
  display: flex; align-items: center; justify-content: center; }
.actions-photo button svg { width: 20px; height: 20px; stroke-width: 2.2; }
.actions-photo .rejeter { color: var(--danger); border-right: 1px solid var(--bord); }
.actions-photo .garder { color: var(--accent); }
.actions-photo .rejeter[aria-pressed=true] { background: var(--danger-fond); }
.actions-photo .garder[aria-pressed=true] { background: var(--accent); color: var(--sur-accent); }

.bandeau-rejetees { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 600; }
.bandeau-rejetees button { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px 0 0; }
.bandeau-rejetees svg { width: 20px; height: 20px; }
.nouvelles { width: 100%; margin-bottom: 12px; background: var(--carte); border-color: var(--accent); color: var(--accent); }
.vide { text-align: center; color: var(--texte-2); padding: 48px 16px; }
.sentinelle { height: 1px; }
.pied { text-align: center; font-size: 12px; color: var(--texte-2); margin-top: 18px; }
.pied p { margin: 0 0 4px; }
.pied-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pied-actions button { font-size: 13px; }

/* ---------- Visionneuse ---------- */
.visionneuse { position: fixed; inset: 0; z-index: 20; background: #0B0B0B; display: flex; flex-direction: column; }
.v-barre, .v-bas { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--page); }
.v-barre { padding-top: calc(8px + env(safe-area-inset-top)); border-bottom: 1px solid var(--bord); }
.v-bas { padding-bottom: calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--bord); justify-content: center; }
.v-titre { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.v-titre strong { font-size: 15px; }
.v-titre span { font-size: 12px; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-zoom { min-width: 72px; padding: 0 12px; }
.v-zoom[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }
.v-scene { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.v-scene img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.v-scene.zoom { display: block; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.v-scene.zoom img { max-width: none; max-height: none; width: auto; height: auto; cursor: grab; }
.v-badge { top: 12px; left: 12px; position: absolute; }
.v-scene.zoom .v-badge { position: fixed; top: calc(76px + env(safe-area-inset-top)); }
.v-attente { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(17,17,17,.85);
  padding: 8px 14px; border-radius: 10px; font-size: 13px; color: var(--texte-2); }
.v-scene.zoom .v-attente { position: fixed; }
.action { display: inline-flex; align-items: center; gap: 8px; flex: 1; max-width: 180px; justify-content: center; }
.action svg { width: 20px; height: 20px; stroke-width: 2.2; }
.action.rejeter { color: var(--danger); }
.action.rejeter[aria-pressed=true] { background: var(--danger-fond); border-color: #5A2A24; }
.action.garder { color: var(--accent); }
.action.garder[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 30;
  background: var(--carte); border: 1px solid var(--bord-fort); border-radius: 10px; padding: 10px 14px; font-size: 14px; max-width: calc(100% - 32px); }
.toast.erreur { background: var(--danger-fond); color: var(--danger); border-color: #5A2A24; }

/* ---------- Retouche ---------- */
body.retouche { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.sans-bord { border-color: transparent; background: none; }
.r-barre { height: 56px; flex-shrink: 0; display: flex; align-items: center; gap: 4px; padding: 0 8px;
  padding-top: env(safe-area-inset-top); border-bottom: 1px solid var(--bord); }
.r-titre { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.r-titre strong { font-size: 15px; font-weight: 600; }
.r-titre span { font-size: 11px; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.publier { min-height: 36px; height: 36px; padding: 0 14px; border-radius: 18px; background: var(--accent); border-color: var(--accent);
  color: var(--sur-accent); font-size: 13px; font-weight: 700; margin-left: 4px; }

.r-apercu { position: relative; flex-shrink: 0; height: min(62vw, 46dvh); background: #0B0B0B;
  display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: manipulation; }
.r-scene { position: relative; width: 100%; height: 100%; }
.r-scene > img, .r-scene > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.r-scene.choix-loupe { cursor: crosshair; outline: 2px dashed var(--accent); outline-offset: -2px; }
.r-etat { position: absolute; top: 10px; left: 10px; max-width: calc(100% - 20px); padding: 4px 8px; border-radius: 7px;
  background: rgba(17,17,17,.82); font-size: 11px; color: #D4D4D4; pointer-events: none; }
.r-etat.erreur { color: var(--danger); }
.r-histo { position: absolute; left: 10px; bottom: 10px; width: 132px; height: 62px; min-height: 0; padding: 5px 6px; border-radius: 8px;
  background: rgba(17,17,17,.82); border: 1px solid transparent; display: flex; flex-direction: column; gap: 2px; }
.r-histo canvas { width: 120px; height: 52px; display: block; }
.r-histo[aria-pressed=true] { border-color: var(--accent); }
.r-ecretage { position: absolute; left: 6px; right: 6px; top: -18px; font-size: 10px; font-weight: 600; color: #FF8A7A; text-align: left;
  text-shadow: 0 1px 2px #000; white-space: nowrap; }
.r-outils-apercu { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 8px; }
.r-rond { height: 44px; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 12px; border: 0;
  background: rgba(17,17,17,.82); color: var(--texte); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.r-rond svg { width: 20px; height: 20px; }
.r-rond[aria-pressed=true] { background: var(--accent); color: var(--sur-accent); }
.r-avant { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.r-marque-loupe { position: absolute; border: 2px solid var(--accent); border-radius: 4px; pointer-events: none; min-width: 10px; min-height: 10px; }
.r-cadre { position: absolute; border: 2px solid var(--accent); box-shadow: 0 0 0 9999px rgba(0,0,0,.55); cursor: move; touch-action: none; }
.r-cadre::before, .r-cadre::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(to right, transparent 33.2%, rgba(255,255,255,.35) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,.35) 66.6%, transparent 66.8%); }
.r-cadre::after { background-image: linear-gradient(to bottom, transparent 33.2%, rgba(255,255,255,.35) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,.35) 66.6%, transparent 66.8%); }
.poignee { position: absolute; width: 28px; height: 28px; }
.poignee::after { content: ''; position: absolute; width: 14px; height: 14px; background: var(--accent); border-radius: 3px; left: 7px; top: 7px; }
.poignee[data-coin=nw] { left: -14px; top: -14px; cursor: nwse-resize; } .poignee[data-coin=ne] { right: -14px; top: -14px; cursor: nesw-resize; }
.poignee[data-coin=sw] { left: -14px; bottom: -14px; cursor: nesw-resize; } .poignee[data-coin=se] { right: -14px; bottom: -14px; cursor: nwse-resize; }
.r-loupe { position: absolute; inset: 0; background: #0B0B0B; display: flex; flex-direction: column; z-index: 2; }
.r-loupe-barre { display: flex; align-items: center; gap: 8px; padding: 0 4px 0 12px; height: 44px; font-size: 12px; color: var(--texte-2); }
.r-loupe-barre span { flex: 1; }
.r-loupe-vue { flex: 1; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.r-loupe-vue img { display: block; width: 800px; height: 800px; max-width: none; margin: auto; image-rendering: auto; }

.r-onglets { display: flex; gap: 6px; padding: 12px 12px 8px; overflow-x: auto; flex-shrink: 0; scrollbar-width: none; }
.r-onglets button { flex-shrink: 0; height: 36px; min-height: 36px; padding: 0 14px; border-radius: 18px; font-size: 13px;
  border: 1px solid var(--bord); background: var(--carte); color: #D4D4D4; }
.r-onglets button[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }
/* Le panneau occupe toute la largeur (pas le max-width de main) : les côtés font partie de la zone qui défile */
.r-panneau { max-width: none; width: 100%; margin: 0; box-sizing: border-box; flex: 1; overflow-y: auto; padding: 4px 16px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
/* Téléphone : marges de 28 px pour défiler. Les cartes restent limitées à 640 px et centrées ;
   le reste de la largeur défile aussi. Les curseurs ne réagissent qu'à un glissement horizontal (relatif, sans saut) ;
   un glissement vertical n'importe où fait défiler, un simple appui ne change rien. */
@media (max-width: 899px) {
  .r-panneau > * { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
  .r-panneau { padding-left: 28px; padding-right: 28px; overscroll-behavior: contain; }
  .r-carte { padding-left: 12px; padding-right: 12px; }
}
@media (pointer: coarse) {
  .r-curseur { touch-action: pan-y; }
  .r-curseur input[type=range] { pointer-events: none; }
}
.r-curseur.glisse input[type=range] { filter: brightness(1.25); }
.r-carte { background: var(--carte); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.r-carte-tete { display: flex; align-items: center; justify-content: space-between; }
.r-carte-tete h2 { margin: 0; font-size: 13px; font-weight: 600; }
button.petit { min-height: 32px; height: 32px; padding: 0 8px; font-size: 12px; font-weight: 500; }
.r-curseur { display: flex; flex-direction: column; margin: 0; color: #D4D4D4; }
.r-ligne { display: flex; justify-content: space-between; font-size: 12px; }
.r-valeur { color: var(--texte); font-weight: 600; cursor: pointer; }
.r-curseur.modifie .r-ligne > span:first-child { color: var(--accent); }
.eteint { opacity: .5; }
input[type=range] { width: 100%; height: 32px; margin: 0; accent-color: var(--accent); background: none; touch-action: pan-y; }
.r-sous-titre { font-size: 12px; color: #D4D4D4; }
.r-choix { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 4px; }
.r-puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { min-height: 36px; height: 36px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--bord-fort); background: transparent;
  color: #D4D4D4; font-size: 12px; font-weight: 500; }
.puce[aria-pressed=true] { background: #3A2C15; border-color: var(--accent); color: var(--accent); }
.r-interrupteur { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin: 0; font-size: 13px; color: #D4D4D4; cursor: pointer; }
.r-interrupteur.modifie > span { color: var(--accent); }
.r-interrupteur input { width: 22px; height: 22px; accent-color: var(--accent); }
.r-courbe { position: relative; height: 140px; border-radius: 10px; background: #151515; touch-action: none; }
.r-courbe svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.r-courbe .grille { stroke: #2A2A2A; stroke-width: 1; vector-effect: non-scaling-stroke; fill: none; }
.r-courbe .diagonale { stroke: #333; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; fill: none; }
.r-courbe .trace { stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; fill: none; }
.r-point { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; cursor: grab; }
.r-point::after { content: ''; position: absolute; left: 8px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); pointer-events: none; }
.r-actions { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.r-actions button { background: #232323; font-weight: 500; font-size: 13px; }

dialog.feuille { background: var(--carte); color: var(--texte); border: 1px solid var(--bord-fort); border-radius: 14px; padding: 16px;
  width: min(420px, calc(100% - 24px)); }
dialog.feuille::backdrop { background: rgba(0,0,0,.6); }
dialog.feuille h2 { font-size: 16px; margin: 0 0 8px; }
dialog.feuille fieldset { border: 0; padding: 0; margin: 8px 0; }
dialog.feuille legend { font-size: 13px; color: var(--texte-2); padding: 0; }
dialog.feuille input[type=text] { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--bord-fort);
  background: #0B0B0B; color: var(--texte); font-size: 16px; }

@media (min-width: 900px) {
  body.retouche { display: grid; grid-template-columns: 1fr 380px; grid-template-rows: 56px 1fr auto; }
  .r-barre { grid-column: 1 / -1; }
  .r-apercu { grid-column: 1; grid-row: 2 / 4; height: auto; }
  .r-onglets { grid-column: 2; grid-row: 2; align-self: start; flex-wrap: wrap; border-left: 1px solid var(--bord); }
  .r-panneau { grid-column: 2; grid-row: 2 / 4; margin-top: 56px; border-left: 1px solid var(--bord); }
}
.action.retoucher { color: var(--texte); }
@media (max-width: 440px) {
  .v-bas { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .v-bas .action { padding: 0 8px; font-size: 13px; }
  .v-bas .action svg { display: none; }
}

/* Chargement d'un rendu */
.r-etat { display: inline-flex; align-items: center; gap: 6px; }
.r-etat.erreur { color: var(--danger); }
.r-roue { display: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(240,164,58,.3);
  border-top-color: var(--accent); animation: r-tourne .8s linear infinite; flex-shrink: 0; }
.r-etat.charge .r-roue { display: inline-block; }
.r-etat.charge { color: var(--texte); }
.r-roue.grande { position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px; border-width: 3px; }
.r-loupe .r-loupe-vue { position: relative; }
/* Roue de la loupe posée sur le cadre fixe (pas dans la zone qui défile, sinon elle sort du champ) */
.r-loupe.charge::after { content: ''; position: absolute; left: 50%; top: calc(50% + 22px); z-index: 4; width: 44px; height: 44px;
  margin: -22px 0 0 -22px; box-sizing: border-box; border-radius: 50%; border: 4px solid rgba(240,164,58,.3);
  border-top-color: var(--accent); background: rgba(0,0,0,.55); box-shadow: 0 0 0 8px rgba(0,0,0,.55);
  animation: r-tourne .8s linear infinite; pointer-events: none; }
.r-loupe.charge .r-loupe-vue img { opacity: .45; }
.r-barre-chargement { position: absolute; left: 0; right: 0; top: 0; height: 4px; overflow: hidden; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .2s; }
.r-barre-chargement::after { content: ''; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--accent); animation: r-glisse 1.2s ease-in-out infinite; }
.r-apercu.charge .r-barre-chargement { opacity: 1; }
/* Grande roue au centre de l'aperçu (pseudo-élément : ne dépend pas du HTML), sur une pastille sombre */
.r-apercu.charge::after { content: ''; position: absolute; left: 50%; top: 50%; z-index: 4; width: 44px; height: 44px;
  margin: -22px 0 0 -22px; box-sizing: border-box; border-radius: 50%; border: 4px solid rgba(240,164,58,.3);
  border-top-color: var(--accent); background: rgba(0,0,0,.55); box-shadow: 0 0 0 8px rgba(0,0,0,.55);
  animation: r-tourne .8s linear infinite; pointer-events: none; }
.r-apercu.charge #img-exact, .r-apercu.charge #approx { filter: brightness(.7); transition: filter .3s; }
#img-exact, #approx { transition: filter .3s; }
@keyframes r-tourne { to { transform: rotate(360deg); } }
@keyframes r-glisse { from { left: -35%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .r-roue, .r-apercu.charge::after, .r-loupe.charge::after { animation-duration: 2.4s; }
  .r-barre-chargement::after { animation: none; left: 0; width: 100%; opacity: .6; }
}

/* --- Publication vers Drupal ------------------------------------------------------------ */
body.publication .r-barre { position: sticky; top: 0; z-index: 5; background: var(--page); }
.p-titre { margin: 0 0 0 4px; font-size: 17px; font-weight: 600; flex: 1; }
.p-corps { display: flex; flex-direction: column; gap: 16px; padding: 12px 16px 24px; }
.p-photo { display: flex; gap: 12px; align-items: center; }
.p-vignette { position: relative; width: 120px; height: 80px; border-radius: 10px; background: #1C1C1C; flex-shrink: 0; overflow: hidden; }
.p-vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-vignette .r-roue.grande { display: block; width: 24px; height: 24px; margin: -12px 0 0 -12px; }
.p-vignette.chargee .r-roue { display: none; }
.p-infos { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.p-infos strong { font-size: 14px; font-weight: 600; }
.p-infos span { font-size: 12px; color: var(--texte-2); }
.p-export { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 12px; }
.p-export dt { color: var(--texte-2); }
.p-export dd { margin: 0; }
#formulaire { display: flex; flex-direction: column; gap: 18px; }
.p-champ { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.p-champ > label, .p-champ > legend { font-size: 13px; font-weight: 500; color: var(--texte); margin: 0; padding: 0; }
.p-champ > legend { margin-bottom: 6px; }
.p-requis { color: var(--accent); font-weight: 500; }
.p-champ input[type=text], .p-champ textarea { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--bord-fort); background: var(--carte); color: var(--texte); font: 400 16px/1.4 Inter, system-ui, sans-serif; resize: vertical; }
.p-champ input[type=text]:focus, .p-champ textarea:focus { outline: none; border-color: var(--accent); }
.p-champ .invalide, .p-champ.invalide .p-arbre { border-color: var(--danger) !important; }
.p-champ.invalide .p-arbre { border: 1px solid; border-radius: 12px; padding: 8px; }
.p-aide { margin: 0; font-size: 12px; color: var(--texte-2); }
.p-compteur { font-weight: 600; color: var(--danger); margin-right: 4px; }
.p-compteur.ok { color: var(--succes); }
.p-err { margin: 0; font-size: 13px; color: var(--danger); }
.p-arbre { display: flex; flex-direction: column; gap: 10px; }
.p-groupe { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--bord); }
.p-groupe:last-child { border-bottom: 0; padding-bottom: 0; }
.puce.parent { font-weight: 700; color: var(--texte); }
.puce.petit-enfant { font-size: 11px; }
.p-case { background: var(--carte); border-radius: 12px; padding: 8px 14px; gap: 12px; }
.p-case small { display: block; font-size: 12px; color: var(--texte-2); }
.p-visible:has(input:checked) { outline: 1px solid var(--accent); }
.p-message { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; font-size: 13px;
  background: var(--carte); border: 1px solid var(--bord-fort); color: #D4D4D4; }
.p-message strong { font-size: 14px; color: var(--texte); }
.p-message a { font-weight: 600; min-height: 32px; display: flex; align-items: center; color: var(--accent); }
.p-message.succes { background: var(--succes-fond); border-color: #4E7A45; }
.p-message.succes strong { color: var(--succes); }
.p-message.erreur { background: var(--danger-fond); border-color: #6B3129; color: var(--danger); }
.p-pied { position: sticky; bottom: 0; background: var(--page); border-top: 1px solid #222; padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; }
.p-pied > * { width: 100%; max-width: 608px; margin: 0 auto; }
.p-envoyer { height: 52px; border-radius: 14px; font-size: 15px; font-weight: 700; }
.p-progression { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--texte); }
.p-progression .r-roue { display: inline-block; width: 16px; height: 16px; }

/* --- Galerie et retouche sur ordinateur (C4) ----------------------------------------------- */
kbd { font: 500 11px/1.4 Inter, system-ui, sans-serif; padding: 1px 6px; border-radius: 4px; border: 1px solid #3A3A3A;
  background: #1C1C1C; color: var(--texte); white-space: nowrap; }
button.principal kbd, .principal kbd { background: #FFD08A; border-color: #E0962F; color: var(--sur-accent); }
.g-outils, .g-panneau { display: none; }
.g-raccourcis { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 8px 0; font-size: 14px; align-items: center; }
.g-raccourcis dt { white-space: nowrap; }
.g-raccourcis dd { margin: 0; color: #D4D4D4; }
@media (min-width: 1024px) {
  body.galerie { --panneau: 340px; }
  body.galerie .entete, body.galerie .galerie-main { max-width: none; margin: 0 var(--panneau) 0 0; padding-left: 20px; padding-right: 20px; }
  .entete { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px; border-bottom: 1px solid #222; }
  .entete .onglets { display: flex; order: 1; }
  .entete .onglets button { padding: 0 16px; height: 36px; min-height: 36px; }
  .entete-haut { display: contents; }   /* logo, onglets, actions sur une seule ligne */
  .entete-haut .marque { order: -1; }
  .entete-actions { order: 3; margin-left: auto; }
  .g-outils { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; }
  .g-aide { margin: 0; font-size: 13px; color: var(--texte-2); }
  .g-filtres { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
  .g-filtres label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--texte-2); }
  .g-filtres select { height: 36px; border-radius: 8px; border: 1px solid var(--bord-fort); background: var(--carte); color: var(--texte);
    padding: 0 8px; font: 400 13px Inter, system-ui, sans-serif; }
  .g-filtres input[type=range] { width: 120px; height: 24px; }
  .grille { grid-template-columns: repeat(auto-fill, minmax(var(--vignette, 220px), 1fr)); gap: 14px; }
  .vignette { cursor: pointer; }
  .carte-photo { outline: 2px solid transparent; outline-offset: 0; }
  .carte-photo.selectionnee { outline-color: var(--accent); }
  .pied-tactile { display: none; }
  .g-panneau { display: flex; flex-direction: column; gap: 14px; position: fixed; top: 0; right: 0; bottom: 0; width: var(--panneau);
    overflow-y: auto; border-left: 1px solid #222; background: var(--page); padding: 16px 20px; z-index: 6; }
  .g-panneau-vide { color: var(--texte-2); font-size: 13px; margin: 40px 0 0; text-align: center; }
  #g-detail { display: flex; flex-direction: column; gap: 14px; }
  #g-detail[hidden] { display: none; }
  .g-apercu { padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #0B0B0B; aspect-ratio: 3 / 2; min-height: 0; cursor: zoom-in; }
  .g-apercu img { width: 100%; height: 100%; object-fit: contain; display: block; }
  #g-nom { margin: 0; font-size: 17px; font-weight: 700; }
  .g-date { font-size: 12px; color: var(--texte-2); margin-top: -12px; }
  .g-infos { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 13px; }
  .g-infos dt { color: var(--texte-2); }
  .g-infos dd { margin: 0; overflow-wrap: anywhere; }
  .g-boutons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .g-boutons[hidden] { display: none; }
  .g-rejeter { background: var(--danger-fond); border-color: #5A2A24; color: #FFB4AA; }
  .g-rejeter[aria-pressed=true], #g-garder[aria-pressed=true] { box-shadow: inset 0 0 0 2px var(--texte); }
  .g-publier { display: flex; align-items: center; justify-content: center; text-decoration: none; }
  .g-publier[hidden] { display: none; }
}
.r-bureau, .r-statut, .r-pellicule { display: none; }
.r-etiquette { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 6px; background: rgba(17,17,17,.85);
  font-size: 11px; color: var(--texte); pointer-events: none; z-index: 1; }
.r-etiquette-vue { left: auto; right: 8px; }
.r-cote { position: relative; flex-shrink: 0; }
.r-cote img { width: 100%; height: 100%; object-fit: contain; display: block; }
.r-apercu.cote-a-cote { gap: 12px; }
.r-apercu.cote-a-cote .r-outils-apercu, .r-apercu.cote-a-cote .r-histo { display: none; }
.r-apercu.cote-a-cote .r-etiquette-vue { left: 8px; right: auto; }
@media (min-width: 900px) {
  .r-bureau { display: inline-flex; }
  .r-vues { gap: 2px; background: var(--carte); border-radius: 10px; padding: 3px; margin-right: 8px; }
  .r-vues button { height: 32px; min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; font-size: 12px; font-weight: 600;
    background: transparent; color: var(--texte-2); }
  .r-vues button[aria-pressed=true] { background: #333; color: var(--texte); }
  #aide { font-size: 16px; font-weight: 700; }
  .r-titre { flex: 1; }
  .r-apercu { grid-row: 2; }
  .r-statut { display: flex; gap: 16px; grid-column: 1; grid-row: 3; padding: 8px 16px; border-top: 1px solid #1E1E1E;
    font-size: 12px; color: var(--texte-2); background: #0B0B0B; }
  .r-statut #st-historique { margin-left: auto; }
}
@media (min-width: 1200px) {
  body.retouche { grid-template-columns: 112px 1fr 380px; }
  .r-pellicule { display: flex; flex-direction: column; gap: 10px; grid-column: 1; grid-row: 2 / 4; overflow-y: auto; padding: 12px;
    border-right: 1px solid #222; scrollbar-width: thin; }
  .r-apercu, .r-statut { grid-column: 2; }
  .r-onglets, .r-panneau { grid-column: 3; }
  .r-film { position: relative; flex-shrink: 0; width: 88px; height: 59px; min-height: 0; padding: 0; border-radius: 8px;
    border: 2px solid transparent; background: #1C1C1C; overflow: hidden; }
  .r-film img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .r-film span { position: absolute; left: 4px; bottom: 2px; font-size: 10px; color: #E5E5E5; text-shadow: 0 1px 2px #000; }
  .r-film[aria-current=page] { border-color: var(--accent); }
  .r-film:hover { border-color: #555; }
}
/* Sections dépliables du panneau (ordinateur) */
@media (min-width: 900px) {
  .r-onglets { display: none; }
  .r-panneau { grid-row: 2 / 4; margin-top: 0; padding: 14px 16px 24px; gap: 12px; }
  .r-depliant { background: #1A1A1A; border-radius: 12px; overflow: hidden; flex-shrink: 0; border-left: 3px solid transparent; }
  .r-depliant.actif { border-left-color: var(--accent); }
  .r-depliant-tete { width: 100%; height: 44px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 0; background: none;
    display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--texte); text-align: left; }
  .r-depliant-tete:hover { background: #202020; }
  .r-depliant-titre { flex: 1; }
  .r-depliant-compte { font-size: 11px; font-weight: 600; color: var(--accent); }
  .r-depliant-etat { font-size: 12px; font-weight: 500; color: var(--texte-2); }
  .r-depliant-corps { display: flex; flex-direction: column; padding: 0 0 6px; }
  .r-depliant-corps .r-carte { background: none; border-radius: 0; border-top: 1px solid #262626; padding: 10px 14px; }
  .r-depliant-corps .r-carte-tete h2 { text-transform: uppercase; letter-spacing: .4px; font-size: 12px; color: #D4D4D4; }
}
