:root {
  --encre: #1f2937;
  --gris: #6b7280;
  --filet: #e5e7eb;
  --fond: #f8fafc;
  --accent: #1e3a8a;
  --vert: #166534;
  --vert-fond: #ecfdf3;
  --rouge: #b91c1c;
  --rouge-fond: #fef2f2;
  --ambre: #92400e;
  --ambre-fond: #fffbeb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--encre);
  background: var(--fond);
  line-height: 1.5;
  font-size: 15px;
}

main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; }

h1 { font-size: 1.7rem; margin: 4px 0 10px; line-height: 1.25; }
h2 { font-size: 1.2rem; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h3 { font-size: 1rem; margin: 18px 0 8px; }

.entete { padding: 8px 0 18px; }
.surtitre { color: var(--accent); font-weight: 600; font-size: 0.85rem; margin: 0; text-transform: uppercase; letter-spacing: 0.03em; }
.accroche { font-size: 1.05rem; max-width: 820px; margin: 0 0 8px; }
.action { font-weight: 600; margin: 0 0 6px; }
.discret { color: var(--gris); font-size: 0.85rem; margin: 0; }

.bloc { background: #fff; border: 1px solid var(--filet); border-radius: 10px; padding: 20px; margin-bottom: 18px; }
.num { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; align-items: center; justify-content: center; font-size: 0.9rem; }

.petit { font-size: 0.82rem; color: var(--gris); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; }
.champ { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.72rem; color: var(--accent); font-weight: 400; }

.cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.carte { text-align: left; border: 1px solid var(--filet); background: #fff; border-radius: 8px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; font: inherit; color: inherit; }
.carte:hover { border-color: var(--accent); }
.carte.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.15); }
.badge-exemple { align-self: flex-start; font-size: 0.7rem; background: var(--ambre-fond); color: var(--ambre); border: 1px solid #fde68a; border-radius: 99px; padding: 1px 8px; }

.grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
@media (max-width: 860px) { .grille { grid-template-columns: 1fr; } }

.editeur fieldset { border: 1px solid var(--filet); border-radius: 8px; padding: 10px 12px 12px; margin: 0 0 12px; }
.editeur legend { font-weight: 600; font-size: 0.9rem; padding: 0 4px; }
.editeur label { display: block; font-size: 0.82rem; font-weight: 600; margin-top: 8px; }
.editeur label.case { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 0.88rem; flex-wrap: wrap; }
.editeur input[type="text"], .editeur select, .ajout select { width: 100%; padding: 7px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; font-size: 0.9rem; margin-top: 3px; background: #fff; }
.editeur input.ecart { border-color: var(--rouge); background: var(--rouge-fond); }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trois { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .deux, .trois { grid-template-columns: 1fr; } }
.ligne-titre { display: flex; justify-content: space-between; align-items: baseline; }
.ligne-titre h3 { margin-top: 0; }
.ligne-article { border-top: 1px dashed var(--filet); padding-top: 8px; margin-top: 8px; }
.ligne-entete { display: flex; justify-content: space-between; }
.ajout { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.ajout select { margin-top: 0; }

button, a.secondaire { font: inherit; border-radius: 6px; cursor: pointer; }
.principal { background: var(--accent); color: #fff; border: none; padding: 11px 20px; font-weight: 600; font-size: 1rem; }
.principal:disabled { opacity: 0.6; cursor: wait; }
.secondaire { background: #fff; color: var(--accent); border: 1px solid var(--accent); padding: 8px 14px; text-decoration: none; display: inline-block; font-size: 0.9rem; }
.secondaire:disabled { opacity: 0.5; cursor: not-allowed; }
.lien { background: none; border: none; color: var(--accent); text-decoration: underline; padding: 0; font-size: 0.82rem; }

.circuit { border-radius: 8px; padding: 14px; border: 1px solid #bfdbfe; background: #eff6ff; }
.circuit.e_reporting_b2c, .circuit.e_reporting_international { border-color: #fde68a; background: var(--ambre-fond); }
.circuit p { margin: 0 0 4px; }
.circuit-titre { font-weight: 700; font-size: 1.08rem; }
.etapes { display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 8px 0; list-style: none; font-size: 0.8rem; }
.etapes li { background: #fff; border: 1px solid var(--filet); border-radius: 4px; padding: 2px 8px; }
.etapes li:not(:last-child)::after { content: " →"; color: var(--gris); }

.ereporting { border: 1px solid var(--filet); border-radius: 8px; padding: 4px 14px 10px; margin-top: 12px; }
dl { margin: 0; }
dl > div { display: grid; grid-template-columns: 44% 1fr; gap: 8px; border-bottom: 1px solid var(--filet); padding: 4px 0; font-size: 0.86rem; }
dt { color: var(--gris); }
dd { margin: 0; word-break: break-word; }

table { border-collapse: collapse; width: 100%; font-size: 0.84rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--filet); vertical-align: top; }
th { background: var(--fond); font-weight: 600; }
table.mini { margin-top: 8px; }
.defilement { overflow-x: auto; border: 1px solid var(--filet); border-radius: 8px; }
.correspondance td { word-break: break-word; }
.correspondance td.mono { min-width: 210px; }
.bt { color: var(--accent); font-weight: 600; white-space: nowrap; }
.origine { font-size: 0.75rem; color: var(--gris); white-space: nowrap; }
.origine.ajouter { color: var(--ambre); font-weight: 600; }

.controles { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.controles li { display: flex; gap: 10px; border: 1px solid var(--filet); border-left-width: 4px; border-radius: 6px; padding: 8px 10px; background: #fff; }
.controles li p { margin: 2px 0 0; font-size: 0.86rem; }
.controles li strong { margin-right: 6px; }
.controles li .mono { display: block; }
.controles li.ok { border-left-color: var(--vert); }
.controles li.manquant { border-left-color: var(--rouge); background: var(--rouge-fond); }
.controles li.na, .controles li.info { border-left-color: #cbd5e1; }
.pastille { flex: 0 0 82px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; padding-top: 2px; }
.ok .pastille { color: var(--vert); }
.manquant .pastille { color: var(--rouge); }
.na .pastille, .info .pastille { color: var(--gris); }
.nouveau { font-size: 0.68rem; background: #eef2ff; color: var(--accent); border-radius: 99px; padding: 1px 7px; white-space: nowrap; }

.generer { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.generer .petit { flex: 1 1 300px; margin: 0; }
.verdict { border-radius: 8px; padding: 14px; margin-top: 14px; }
.verdict p { margin: 0 0 4px; }
.verdict.conforme { background: var(--vert-fond); border: 1px solid #bbf7d0; }
.verdict.non-conforme { background: var(--rouge-fond); border: 1px solid #fecaca; }
.verdict-titre { font-weight: 700; font-size: 1.1rem; }
.conforme .verdict-titre { color: var(--vert); }
.non-conforme .verdict-titre { color: var(--rouge); }
.regles { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.regles li { display: flex; gap: 12px; border: 1px solid #fecaca; border-radius: 6px; padding: 8px 10px; background: #fff; }
.regles li p { margin: 0 0 2px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; color: var(--rouge); white-space: nowrap; }
.telechargements { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }

details { margin-top: 12px; }
summary { cursor: pointer; color: var(--accent); font-size: 0.9rem; }
pre { background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 8px; overflow: auto; max-height: 420px; font-size: 0.76rem; }

.depot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 10px 0 4px; }
.resultat-ia { margin-top: 10px; }
.erreur { color: var(--rouge); background: var(--rouge-fond); border-radius: 6px; padding: 8px 10px; }
.avis { color: var(--ambre); background: var(--ambre-fond); border-radius: 6px; padding: 8px 10px; }

.pied { color: var(--gris); font-size: 0.82rem; padding: 6px 4px; }
.pied p { margin: 0 0 6px; }

[x-cloak] { display: none !important; }
