/* Convertisseur CSV ↔ JSON */
.o-csv-json [hidden] { display: none !important; }
.o-csv-json-sens { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.o-csv-json-sens .btn { min-height: 42px; flex: 1 1 140px; font-weight: 600; font-size: 1rem; }
.atelier .o-csv-json-sens .btn[aria-pressed="true"] { background: var(--marque); border-color: var(--marque); color: var(--sur-marque); }

.o-csv-json-barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0 8px; }
.o-csv-json-titre { margin: 0; font-size: 1rem; font-weight: 600; color: var(--texte); }
.o-csv-json-titre span { font-weight: 400; color: var(--texte-2); font-size: .9rem; }
.o-csv-json-outils { display: flex; flex-wrap: wrap; gap: 6px; }
.o-csv-json-outils .btn { min-height: 38px; padding-top: 4px; padding-bottom: 4px; }
.o-csv-json textarea { width: 100%; box-sizing: border-box; font-family: var(--mono); font-size: .9rem; line-height: 1.45; white-space: pre; overflow: auto; tab-size: 4; }
.o-csv-json-entree { min-height: 200px; }
.o-csv-json-sortie { min-height: 240px; background: var(--surface-2); }
.o-csv-json-entree.survol, .o-csv-json-boite.survol { outline: 3px dashed var(--marque); outline-offset: 2px; }
.o-csv-json textarea:focus-visible, .o-csv-json select:focus-visible, .o-csv-json input:focus-visible,
.o-csv-json button:focus-visible, .o-csv-json-defile:focus-visible { outline: 3px solid var(--marque); outline-offset: 1px; }

.o-csv-json-boite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; min-height: 120px;
  padding: 14px 16px; border: 2px dashed var(--bord); border-radius: var(--rayon-petit); background: var(--surface-2); }
.o-csv-json-boite p { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.o-csv-json-reglages { margin-top: 16px; }
.o-csv-json-reglages select { width: 100%; }
.o-csv-json-reglages label.case { align-self: center; }
.o-csv-json-reglages input:disabled { opacity: .5; }

.o-csv-json-etat { display: block; margin: 16px 0 8px; padding: 10px 14px; border-radius: var(--rayon-petit); background: var(--surface-2); color: var(--texte-2); font-weight: 600; }
.o-csv-json-etat.ok { background: var(--ok-fond); color: var(--ok-texte); }
.o-csv-json-etat.erreur { background: var(--erreur-fond); color: var(--erreur-texte); }
.o-csv-json-alertes { margin: 0 0 10px; padding: 10px 14px 10px 32px; border: 1px solid var(--bord); border-left: 4px solid var(--erreur-texte); border-radius: var(--rayon-petit); font-size: .92rem; }
.o-csv-json-alertes li + li { margin-top: 4px; }
.o-csv-json-message { display: block; min-height: 1.5em; margin: 6px 0; font-size: .95rem; color: var(--texte-2); }

.o-csv-json-apercu { margin-top: 10px; }
.o-csv-json-apercu .o-csv-json-titre { margin-bottom: 8px; }
.o-csv-json-defile { max-height: 420px; overflow: auto; border: 1px solid var(--bord); border-radius: var(--rayon-petit); }
.o-csv-json-defile table { border-collapse: collapse; font-size: .88rem; min-width: 100%; }
.o-csv-json-defile th, .o-csv-json-defile td { padding: 5px 10px; border-bottom: 1px solid var(--bord); border-right: 1px solid var(--bord); text-align: left; vertical-align: top;
  white-space: pre-wrap; max-width: 320px; overflow-wrap: anywhere; }
.o-csv-json-defile thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--texte); z-index: 1; }
.o-csv-json-defile tbody th { color: var(--texte-2); font-weight: 400; background: var(--surface); }

@media (max-width: 560px) {
  .o-csv-json-outils { width: 100%; }
  .o-csv-json-outils .btn { flex: 1 1 auto; padding-inline: 10px; }
}
