/* Format « boîte alpha » : /format, /format/importer, export. Téléphone d'abord, variables de panneaux.css
   (thèmes clair et sombre). Aucune couleur en dur hors des pastilles de couleur des liens (celles du tableau). */

.fmt-main h1 { font-size: 30px; }
.pn .fmt-fil { margin-bottom: 10px; font-size: 14px; color: var(--texte-doux); }
.pn .fmt-chapeau { max-width: 46em; }
.fmt-ico { width: 18px; height: 18px; flex: none; }
.pn code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }
.pn p code, .pn li code, .pn td code, .pn th code { padding: 1px 5px; border-radius: 5px; background: var(--accent-doux); color: var(--navy); }

/* Sections */
.fmt-section { margin-top: 24px; padding: 18px 16px; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--carte); box-shadow: var(--ombre); min-width: 0; }
@media (min-width: 720px) { .fmt-section { padding: 22px 26px; } }
.fmt-section h2 { display: flex; align-items: center; gap: 8px; font-size: 21px; }
.fmt-section h2 .fmt-ico { color: var(--accent); width: 20px; height: 20px; }
.fmt-section h3 { margin-top: 20px; font-size: 16px; }
.fmt-section > p, .fmt-section .fmt-intro { margin-top: 8px; }
.pn .fmt-intro { color: var(--texte-doux); max-width: 50em; }
.fmt-deux { display: grid; gap: 0 20px; }
@media (min-width: 1000px) { .fmt-deux { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; } }

/* Le format en dix lignes */
.pn .fmt-dix { list-style: none; counter-reset: fmt; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.fmt-dix li { counter-increment: fmt; position: relative; padding-left: 34px; line-height: 1.5; }
.fmt-dix li::before {
  content: counter(fmt); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent-doux); color: var(--accent);
}

/* Onglets (YAML, JSON ; français, anglais) */
.fmt-onglets { display: inline-flex; gap: 4px; margin-top: 14px; padding: 3px; border: 1px solid var(--bord); border-radius: 999px; background: var(--fond); }
.fmt-onglets button {
  padding: 5px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--texte-doux);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.fmt-onglets button[aria-selected="true"] { background: var(--btn-fond); color: var(--btn-texte); }
.fmt-onglets button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Blocs de code */
.fmt-code { position: relative; margin-top: 12px; }
.fmt-code[hidden] { display: none; }
.fmt-code pre {
  margin: 0; padding: 14px 16px; overflow: auto; border: 1px solid var(--bord); border-radius: 12px; background: var(--fond2);
  font: 13px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--texte); tab-size: 2;
}
.fmt-code pre code { font-size: inherit; background: none; padding: 0; color: inherit; }
.fmt-code-prompt pre { max-height: 440px; white-space: pre-wrap; word-break: break-word; }
.fmt-code-export pre { max-height: 70vh; }
.fmt-k { color: var(--accent); font-weight: 600; }
.fmt-v { color: var(--texte); }
.fmt-copier {
  position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border: 1px solid var(--bord); border-radius: 8px; background: var(--carte); color: var(--navy);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.fmt-copier:hover { border-color: var(--accent); color: var(--accent); }
.fmt-copier .fmt-ico { width: 15px; height: 15px; }
.fmt-copier.fmt-fait, .pn-btn.fmt-fait { border-color: var(--accent); }
.fmt-ligne { margin: 8px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--fond2); border: 1px solid var(--bord); overflow-x: auto; font-size: 13px; }

/* Le prompt */
.fmt-prompt-barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.fmt-prompt-barre .fmt-onglets { margin-top: 12px; }
.fmt-copier-prompt { margin-top: 12px; }

/* Appel à importer */
.fmt-appel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; background: var(--accent-doux); }
.fmt-appel .fmt-intro { color: var(--texte); }
.fmt-appel-btn { font-size: 16px; padding: 11px 20px; }

/* Spécification */
.fmt-table-porteur { margin-top: 14px; overflow-x: auto; }
.fmt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fmt-table th, .fmt-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--bord); }
.fmt-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-doux); }
.fmt-table tbody th { white-space: nowrap; font-weight: 400; }
.fmt-oblig { font-weight: 700; color: var(--navy); }
.fmt-facult { color: var(--texte-doux); }
.pn .fmt-puces { list-style: disc; padding-left: 20px; margin-top: 8px; display: grid; gap: 4px; }

/* ---------- Import ---------- */
.fmt-import { display: grid; gap: 20px; margin-top: 18px; }
@media (min-width: 1000px) { .fmt-import { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.fmt-saisie { min-width: 0; }
.fmt-zone-label { display: block; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.fmt-zone { position: relative; }
.fmt-zone textarea {
  display: block; width: 100%; min-height: 360px; resize: vertical; padding: 12px 14px; border: 1px solid var(--bord); border-radius: 12px;
  background: var(--carte); color: var(--texte); font: 13px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; tab-size: 2;
}
.fmt-zone textarea { white-space: pre; overflow-x: auto; }
.fmt-zone textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.fmt-zone.fmt-depot-actif textarea { border-style: dashed; border-color: var(--accent); background: var(--accent-doux); }
.fmt-zone.fmt-depot-actif::after {
  content: attr(data-deposer); position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-weight: 700; color: var(--accent);
}
.fmt-fichier { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--texte-doux); }
.fmt-fichier input { font: inherit; font-size: 13px; max-width: 100%; }

.fmt-apercu { min-width: 0; padding: 16px; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--carte); box-shadow: var(--ombre); }
@media (min-width: 1000px) { .fmt-apercu { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; } }
.fmt-apercu h2 { font-size: 19px; }
.pn .fmt-apercu-vide { margin-top: 10px; color: var(--texte-doux); }
.pn .fmt-resume { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fmt-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #5a6a75; color: #fff; font-size: 12px; font-weight: 700; }
.fmt-format { display: inline-block; padding: 1px 7px; border: 1px solid var(--bord); border-radius: 6px; font-size: 11px; font-weight: 700; color: var(--texte-doux); letter-spacing: .05em; }

.fmt-erreurs, .fmt-avis { margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.fmt-erreurs { border-left: 4px solid var(--danger); background: rgba(180, 64, 47, .08); }
.fmt-avis { border-left: 4px solid var(--neutre); background: var(--fond2); }
.fmt-erreurs h3, .fmt-avis h3 { font-size: 14px; }
.fmt-erreurs h3 { color: var(--danger); }
.pn .fmt-erreurs ul, .pn .fmt-avis ul { list-style: disc; padding-left: 18px; margin-top: 4px; display: grid; gap: 3px; }
.pn .fmt-erreur-ligne { margin-top: 12px; padding: 10px 14px; border-left: 4px solid var(--danger); border-radius: 10px; background: rgba(180, 64, 47, .08); }

.fmt-boites { display: grid; gap: 12px; margin-top: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.fmt-boite { min-width: 0; padding: 10px 12px 8px; border: 1px solid var(--bord); border-top: 3px solid var(--bord); border-radius: 10px; background: var(--fond); }
.fmt-bc1 { border-top-color: #636363; } .fmt-bc2 { border-top-color: #0bb573; } .fmt-bc3 { border-top-color: #079bd9; }
.fmt-bc4 { border-top-color: #c707c5; } .fmt-bc5 { border-top-color: #e38e08; }
.fmt-boite header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--bord); }
.fmt-boite h3 { font-size: 15px; overflow-wrap: anywhere; }
.fmt-compte { flex: none; font-size: 12px; color: var(--texte-doux); }
.pn .fmt-liens, .pn .fmt-sous { list-style: none; margin: 0; padding: 0; }
.pn .fmt-sous { margin: 2px 0 2px 8px; padding-left: 10px; border-left: 1px solid var(--bord); }
.fmt-l { display: flex; flex-direction: column; padding: 4px 6px 4px 0; border-right: 3px solid transparent; font-size: 13.5px; line-height: 1.35; }
.fmt-l > .fmt-sous { margin-top: 4px; }
.fmt-c1 { border-right-color: #636363; } .fmt-c2 { border-right-color: #0bb573; } .fmt-c3 { border-right-color: #079bd9; }
.fmt-c4 { border-right-color: #c707c5; } .fmt-c5 { border-right-color: #e38e08; }
.fmt-l-titre { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--navy); overflow-wrap: anywhere; }
.fmt-l-dom { font-size: 12px; color: var(--texte-doux); overflow-wrap: anywhere; }
.fmt-l-note { font-size: 12px; color: var(--texte-doux); font-style: italic; }
.fmt-l-refuse .fmt-l-titre { color: var(--texte-doux); text-decoration: line-through; }
.fmt-l-refuse .fmt-l-titre .fmt-ico { width: 14px; height: 14px; color: var(--danger); }
.fmt-l-refus { font-size: 12px; color: var(--danger); }

.fmt-valider { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--bord); border-radius: 12px; background: var(--accent-doux); }
.fmt-dest { display: grid; gap: 4px; font-size: 14px; font-weight: 600; color: var(--navy); flex: 1 1 220px; }
.fmt-dest select { padding: 9px 10px; border: 1px solid var(--bord); border-radius: 10px; background: var(--carte); color: var(--texte); font: inherit; font-weight: 400; }
.fmt-importer { font-size: 16px; padding: 11px 22px; }
.pn .fmt-meta { width: 100%; font-size: 13px; color: var(--texte-doux); }
.pn .fmt-visiteur { width: 100%; }

/* Export */
.pn .fmt-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.fmt-main > .fmt-meta { margin-top: 10px; }
.fmt-main > .fmt-meta code { overflow-wrap: anywhere; }

@media (max-width: 520px) {
  .fmt-main h1 { font-size: 25px; }
  .fmt-copier span { display: none; }
  .fmt-importer, .fmt-appel-btn { width: 100%; }
}
