/* Notices — styles de l'appli (même famille que Qarto et le PIM). */
:root {
  --fond: #f6f6f4; --carte: #ffffff; --encre: #1d2329; --doux: #5b6670; --filet: #e2e4e6;
  --accent: #173b4f; --accent-encre: #ffffff; --erreur: #b3261e; --r: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .04);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #15191c; --carte: #1e2428; --encre: #e8eaec; --doux: #9aa4ad; --filet: #2e353a; --accent: #6dd8d6; --accent-encre: #0f2430; }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "DM Sans", system-ui, sans-serif; background: var(--fond); color: var(--encre); font-size: 15px; line-height: 1.5; }
h1 { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; margin: 0; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: var(--accent); color: var(--accent-encre); font-weight: 700; }
.connexion { max-width: 380px; margin: 12vh auto 0; padding: 0 16px; }
.connexion form { display: flex; flex-direction: column; gap: 6px; background: var(--carte); padding: 20px; border-radius: var(--r); box-shadow: var(--shadow); }
.connexion label { font-weight: 600; font-size: .875rem; margin-top: 8px; }
.connexion input { font: inherit; padding: 10px 12px; border: 1px solid var(--filet); border-radius: 8px; background: var(--fond); color: var(--encre); }
.sous, .note { color: var(--doux); }
.note { font-size: .875rem; }
.erreur { color: var(--erreur); font-weight: 600; margin: 8px 0 0; }
.bouton { margin-top: 14px; font: inherit; font-weight: 600; padding: 10px 14px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-encre); cursor: pointer; }
.lien { font: inherit; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }
.entete { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 16px; background: var(--carte); box-shadow: var(--shadow); }
.qui { display: flex; gap: 12px; align-items: center; color: var(--doux); font-size: .875rem; }
.contenu { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
.bandeau { background: var(--carte); border-radius: var(--r); padding: 12px 16px; box-shadow: var(--shadow); }
.carte { background: var(--carte); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 12px; }
.carte h3 { margin: 0 0 4px; }
.carte small { color: var(--doux); font-weight: 500; }
.carte p { margin: 0 0 8px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8rem; background: var(--fond); padding: 12px; border-radius: 8px; }

/* ---------- Éditeur ---------- */
.entete h1 a.accueil { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.entete h1 small { color: var(--doux); font-weight: 500; font-size: .8rem; }
.fil { color: var(--doux); font-weight: 400; }
.carte h3 a { color: inherit; }
.page-editeur { height: 100dvh; display: flex; flex-direction: column; }
.editeur { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(360px, 460px) minmax(0, 1fr); }
.panneau { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; border-right: 1px solid var(--filet); }
.apercu { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.apercu iframe { flex: 1; width: 100%; border: 0; background: #d9dde1; min-height: 0; }
.lecture-seule { background: var(--carte); border-radius: var(--r); padding: 10px 12px; box-shadow: var(--shadow); margin: 0; font-weight: 600; }
.pages { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { font: inherit; font-size: .85rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 0; background: var(--carte); color: var(--encre); box-shadow: var(--shadow); cursor: pointer; }
.puce.active { background: var(--accent); color: var(--accent-encre); }
.puce.deborde { box-shadow: inset 0 0 0 2px var(--erreur); }
.carte-page, .bloc, .volet { background: var(--carte); border-radius: var(--r); box-shadow: var(--shadow); }
.carte-page { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.carte-page h2 { margin: 0; font-size: 1rem; }
.blocs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bloc-tete { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; min-width: 0; }
.bloc-tete:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r); }
.poignee { color: var(--doux); cursor: grab; letter-spacing: -2px; }
.bloc-type { font-weight: 700; white-space: nowrap; }
.bloc-largeur { font-size: .75rem; color: var(--doux); background: var(--fond); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.bloc-resume { color: var(--doux); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.actions { display: flex; gap: 2px; margin-left: auto; }
.icone { font: inherit; width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--encre); cursor: pointer; }
.icone:hover:not(:disabled) { background: var(--fond); }
.icone:disabled { opacity: .3; cursor: default; }
.bloc.ouvert { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.bloc.glisse { opacity: .5; }
.bloc.cible { box-shadow: 0 -3px 0 var(--accent), var(--shadow); }
.bloc-corps { padding: 4px 12px 14px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--filet); }
.reglages { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding-top: 10px; }
.reglage { display: flex; align-items: center; gap: 8px; }
.reglage label, .champ label { font-weight: 600; font-size: .85rem; }
.case { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; cursor: pointer; }
.champ { display: flex; flex-direction: column; gap: 4px; }
.champ label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cle { margin-left: auto; color: var(--doux); font-weight: 400; font-size: .75rem; font-family: ui-monospace, monospace; }
.champ textarea, .champ input, .reglage select, .champ select, .ligne-ajout select, .depot input, .depot select {
  font: inherit; font-size: .95rem; padding: 8px 10px; border: 1px solid var(--filet); border-radius: 8px; background: var(--fond); color: var(--encre); width: 100%; min-width: 0;
}
.reglage select { width: auto; }
.champ textarea { resize: vertical; line-height: 1.45; }
.champ-image { flex-direction: row; align-items: center; gap: 10px; }
.champ-image img { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--filet); flex: none; }
.champ-image > div { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.badge { font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; background: var(--fond); color: var(--doux); white-space: nowrap; }
.badge.attente { background: #f0ff00; color: #173b4f; }
.badge.completer { background: transparent; color: var(--encre); box-shadow: inset 0 0 0 1px var(--encre); }
.ajouter .ligne-ajout { display: flex; gap: 8px; }
.ajouter .note { margin: 6px 0 0; }
.bouton.secondaire { margin-top: 0; background: var(--fond); color: var(--encre); box-shadow: inset 0 0 0 1px var(--filet); white-space: nowrap; }
.volet summary { padding: 12px 14px; font-weight: 700; cursor: pointer; }
.volet-corps { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.galerie { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.galerie li { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; text-align: center; overflow-wrap: anywhere; }
.galerie img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--filet); }
.galerie small { color: var(--doux); }
.depot { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--filet); padding-top: 10px; }
.depot label { font-weight: 600; font-size: .85rem; }
.barre { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 16px; background: var(--carte); border-bottom: 1px solid var(--filet); }
.bascule { display: inline-flex; background: var(--fond); border-radius: 999px; padding: 3px; }
.bascule button { font: inherit; font-size: .85rem; font-weight: 600; border: 0; background: transparent; color: var(--encre); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.bascule button[aria-pressed="true"] { background: var(--accent); color: var(--accent-encre); }
.etat { font-size: .85rem; color: var(--doux); }
.etat.ok { color: #1a7f37; }
.etat.erreur { color: var(--erreur); font-weight: 600; }
.rapport { background: var(--carte); border-bottom: 1px solid var(--filet); max-height: 18vh; overflow-y: auto; flex: none; }
.rapport summary { padding: 8px 16px; font-weight: 700; cursor: pointer; }
.rapport.bloque summary { color: var(--erreur); }
.rapport-corps { padding: 0 16px 10px; font-size: .85rem; }
.rapport-corps h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); margin: 8px 0 4px; }
.rapport-corps ul { margin: 0; padding-left: 18px; }
.rapport-corps li { margin: 2px 0; overflow-wrap: anywhere; }
.rapport-corps .lien { font-size: inherit; }

@media (max-width: 1100px) {
  .page-editeur { height: auto; display: block; }
  .editeur { display: flex; flex-direction: column; }
  .panneau { border-right: 0; overflow: visible; }
  .apercu { position: relative; }
  .apercu iframe { height: 80vh; flex: none; }
}
@media (max-width: 480px) {
  .bloc-resume { display: none; }
  .entete h1 { font-size: 1.05rem; flex-wrap: wrap; }
  .ajouter .ligne-ajout { flex-direction: column; }
}

/* ---------- Onglets Décisions, Fabriquer et BAT, Historique ---------- */
.onglets { display: flex; flex-wrap: wrap; gap: 4px; background: var(--carte); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.onglets [role=tab] { flex: 1 1 auto; font: inherit; font-size: .85rem; font-weight: 600; border: 0; background: transparent; color: var(--encre); padding: 7px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.onglets [role=tab][aria-selected="true"] { background: var(--accent); color: var(--accent-encre); }
.onglets .compte:not(:empty) { display: inline-block; min-width: 18px; font-size: .7rem; border-radius: 999px; padding: 0 5px; background: #f0ff00; color: #173b4f; margin-left: 2px; }
.onglet { display: flex; flex-direction: column; gap: 14px; }
.onglet[hidden] { display: none; }
.titre-onglet { font-size: 1rem; margin: 6px 0 0; }
.statut { font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; background: var(--fond); color: var(--doux); white-space: nowrap; }
.statut[data-statut="relecture"] { background: #e5f8f7; color: #173b4f; }
.statut[data-statut="bat"] { background: #f0ff00; color: #173b4f; }
.statut[data-statut="imprimee"] { background: #173b4f; color: #fff; }
.decisions, .versions, .historique { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.decision, .versions > li, .modif { background: var(--carte); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.decision p, .versions p, .modif p { margin: 0; }
.decision-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.decision-tete .badge { margin-left: auto; }
.decision.tranchee { opacity: .85; }
.badge.ok { background: #e6f4ea; color: #1a7f37; }
.endroits { font-size: .85rem; overflow-wrap: anywhere; }
.endroits .lien { font-size: inherit; }
.fabrication { display: flex; flex-direction: column; gap: 8px; border-radius: 8px; padding: 10px 12px; background: var(--fond); }
.fabrication p { margin: 0; }
.fabrication.bloque strong { color: var(--erreur); }
.fabrication.ok strong { color: #1a7f37; }
.avertissement { margin: 0; font-weight: 600; color: var(--erreur); }
.telechargements { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.telechargements a { color: var(--accent); }
.ligne-boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.ligne-boutons .bouton { margin-top: 0; }
.bouton.petit { align-self: flex-start; padding: 6px 12px; font-size: .85rem; }
.bouton:disabled { opacity: .45; cursor: not-allowed; }
.carte-page .bouton { align-self: flex-start; }
.comparaison ul { margin: 0; padding-left: 18px; font-size: .85rem; overflow-wrap: anywhere; }
.diff { font-size: .85rem; overflow-wrap: anywhere; }
del { color: var(--erreur); }
ins { color: #1a7f37; text-decoration: none; }
.modif-tete { overflow-wrap: anywhere; }
@media (prefers-color-scheme: dark) { .badge.ok { background: #16351f; color: #7ee2a0; } ins { color: #7ee2a0; } .telechargements a { color: #6dd8d6; } }
