[hidden] { display: none !important; }
:root {
  --fond: #f6f3ee; --carte: #fff; --texte: #2b2723; --doux: #6b635a; --ligne: #e3ddd3;
  --orange: #d77300; --orange-fonce: #b45f00; --dore: #b88a2e; --noir: #151311; --vert: #4f7a28; --rouge: #a73a2b;
  --rayon: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
h1, h2, h3 { font-family: Georgia, 'Times New Roman', serif; font-weight: 600; margin: 0 0 .5em; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid rgba(215, 115, 0, .45); outline-offset: 2px; }

.bouton { border: 1px solid var(--ligne); background: #fff; border-radius: 8px; padding: 10px 16px; cursor: pointer; min-height: 44px; font-weight: 500; }
.bouton:hover { border-color: var(--orange); }
.bouton.plein { background: var(--orange); border-color: var(--orange); color: #fff; }
.bouton.plein:hover { background: var(--orange-fonce); }
.bouton.discret { background: transparent; border-color: transparent; color: var(--doux); }
.bouton.discret:hover { color: var(--texte); border-color: var(--ligne); }
.bouton.danger { color: var(--rouge); border-color: #e7c4bd; }
.bouton.danger:hover { background: var(--rouge); color: #fff; }
.bouton.publier { background: var(--noir); color: #f3d38a; border-color: var(--noir); }
.bouton.publier.a-publier { box-shadow: 0 0 0 3px rgba(243, 211, 138, .5); }
.bouton.petit { min-height: 34px; padding: 4px 10px; font-size: .9rem; }
.bouton:disabled { opacity: .55; cursor: wait; }
.aide { color: var(--doux); font-size: .93rem; margin: 0 0 12px; }
.erreur { color: var(--rouge); font-weight: 500; margin: 0; }

/* connexion */
.ecran-connexion { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--noir); }
.boite-connexion { background: #fff; padding: 32px 28px; border-radius: 14px; width: 100%; max-width: 380px; display: grid; gap: 14px; }
.boite-connexion img { margin: 0 auto 4px; filter: invert(1); }
.boite-connexion h1 { text-align: center; font-size: 1.6rem; margin: 0; }
.boite-connexion .aide { text-align: center; }
label { display: grid; gap: 5px; font-weight: 500; font-size: .95rem; }
input, select, textarea { border: 1px solid #cfc7bb; border-radius: 8px; padding: 10px 12px; background: #fff; min-height: 44px; width: 100%; }
input:focus, select:focus, textarea:focus, .riche:focus { border-color: var(--orange); outline: 3px solid rgba(215, 115, 0, .18); }

/* barre */
.barre { position: sticky; top: 0; z-index: 10; background: var(--noir); color: #fff; display: flex; align-items: center; gap: 16px; padding: 8px 16px; flex-wrap: wrap; }
.barre-titre { display: flex; align-items: center; gap: 10px; font-family: Georgia, serif; font-size: 1.15rem; color: #f3d38a; }
.onglets { display: flex; gap: 4px; flex: 1; }
.onglet { background: none; border: 0; color: #cfc6b8; padding: 10px 14px; border-radius: 8px; cursor: pointer; min-height: 44px; }
.onglet.actif { background: #2c2824; color: #fff; }
.barre-actions { display: flex; gap: 8px; }
.barre .discret { color: #cfc6b8; }
.bandeau { margin: 0; padding: 12px 16px; background: #fff7e6; border-bottom: 1px solid #f0dcb0; }
.bandeau.ok { background: #eef6e7; border-color: #cfe3bd; color: #34511a; }
.bandeau.ko { background: #fbecea; border-color: #f0c9c2; color: #7d2a1e; }

.contenu { max-width: 1100px; margin: 0 auto; padding: 20px 16px 80px; }
.outils { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 10px; }
.champ-court { min-width: 220px; flex: 1; }
.outils .bouton.plein { margin-left: auto; }

/* listes */
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ligne { display: flex; align-items: center; gap: 14px; background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 8px; }
.ligne.masquee { opacity: .62; background: repeating-linear-gradient(-45deg, #fff, #fff 10px, #f7f4ef 10px, #f7f4ef 20px); }
.ligne img { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: #eee; }
.ligne .infos { flex: 1; min-width: 0; }
.ligne .nom { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne .details { color: var(--doux); font-size: .88rem; }
.badge { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: #eee; color: #555; margin-left: 6px; vertical-align: 2px; }
.badge.masque { background: #f3e2c4; color: #7a5313; }
.badge.boutique { background: #e3eed8; color: #3f6220; }
.ligne .actions { display: flex; gap: 6px; flex-shrink: 0; }
.fleches { display: flex; flex-direction: column; gap: 2px; }
.fleches .bouton { min-height: 30px; padding: 0 10px; }
@media (max-width: 640px) {
  .ligne { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
  .ligne:has(.fleches) { grid-template-columns: auto auto minmax(0, 1fr); }
  .ligne img { width: 72px; height: 54px; }
  .ligne .details { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ligne .actions { grid-column: 1 / -1; }
  .ligne .actions .bouton { flex: 1; }
  .barre-titre strong { display: none; }
  .outils .bouton.plein { width: 100%; }
}

/* éditeur */
dialog { border: 0; border-radius: 14px; padding: 0; box-shadow: 0 20px 70px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(20, 17, 14, .55); }
.editeur { width: min(980px, 100vw); max-height: 100dvh; height: min(940px, 100dvh); }
.editeur form { display: flex; flex-direction: column; height: 100%; }
.editeur-entete, .editeur-pied { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--ligne); background: #fff; }
.editeur-pied { border-top: 1px solid var(--ligne); border-bottom: 0; flex-wrap: wrap; }
.editeur-entete h2 { flex: 1; margin: 0; font-size: 1.35rem; }
.editeur-corps { flex: 1; overflow: auto; padding: 20px; background: var(--fond); display: grid; gap: 18px; align-content: start; }
.espace { flex: 1; }
.bloc { background: #fff; border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 16px; display: grid; gap: 12px; }
.bloc h3 { font-size: 1.1rem; margin: 0; }
.deux { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
@media (max-width: 640px) { .editeur { border-radius: 0; height: 100dvh; width: 100vw; max-width: 100vw; margin: 0; } .editeur-entete h2 { font-size: 1.1rem; } .deux { grid-template-columns: 1fr; } .editeur-corps { padding: 12px; } }
.series { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.series .groupe { grid-column: 1 / -1; font-weight: 600; color: var(--doux); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; margin-top: 6px; }
.coche { display: flex; align-items: center; gap: 10px; font-weight: 400; min-height: 40px; cursor: pointer; }
.coche input { width: 22px; height: 22px; min-height: 0; accent-color: var(--orange); }

.barre-riche { display: flex; gap: 4px; flex-wrap: wrap; }
.barre-riche button { min-width: 40px; min-height: 36px; border: 1px solid var(--ligne); background: #faf8f5; border-radius: 6px; cursor: pointer; }
.riche { min-height: 220px; max-height: 520px; overflow: auto; border: 1px solid #cfc7bb; border-radius: 8px; padding: 12px 14px; background: #fff; line-height: 1.6; }
.riche p { margin: 0 0 .8em; }

.photo-principale { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.photo-principale img { width: 260px; max-width: 100%; aspect-ratio: 3/2; object-fit: cover; border-radius: 8px; background: #eee; }
.vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.vignette { background: #f4f1ec; border-radius: 8px; overflow: hidden; border: 1px solid var(--ligne); }
.vignette img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.vignette .gestes { display: flex; justify-content: space-between; padding: 4px; gap: 2px; }
.vignette .gestes button { flex: 1; min-height: 34px; border: 0; background: #fff; border-radius: 5px; cursor: pointer; font-size: .95rem; }
.vignette .gestes button:hover { background: #fde9cf; }
.depot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.depot .bouton { position: relative; overflow: hidden; }
.depot input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.progression { font-size: .9rem; color: var(--doux); }
.fichier-joint { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fichier-joint a { color: var(--orange-fonce); }
.interrupteur { display: flex; align-items: center; gap: 12px; font-weight: 500; }

.petit { width: min(460px, 94vw); }
.petit form { padding: 22px; }
.petit .boutons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.versions, .journal { list-style: none; padding: 0; margin: 0 0 30px; display: grid; gap: 6px; font-size: .92rem; }
.versions li, .journal li { background: #fff; border: 1px solid var(--ligne); border-radius: 8px; padding: 8px 12px; display: flex; gap: 10px; align-items: center; }
.versions li span, .journal li span { flex: 1; }
.journal .erreur, .journal .refus { color: var(--rouge); }
