/* =========================================================
 * Bandeaux — styles de l'onglet 🎗️ (préfixe .bd-)
 * S'appuie sur les variables du design system d'index.html.
 * ========================================================= */
/* .wide (index.html, chargé après cette feuille) plafonne à 1180 px : on le surclasse */
.container.wide.editeur { max-width: min(1760px, 98vw); padding: 22px 22px 18px; }
#panel-bandeaux.active { display: block; }
.bd-app { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 150px); min-height: 640px; }

/* barre du haut */
.bd-barre { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bd-barre-groupe { display: flex; align-items: center; gap: 6px; }
.bd-barre-droite { margin-left: auto; }
.bd-nom { font: inherit; font-weight: 600; font-size: 1.02em; padding: 7px 10px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--text-primary); min-width: 260px; }
.bd-nom:hover, .bd-nom:focus { border-color: var(--border); background: var(--surface); outline: none; }
.bd-btn { font: inherit; font-size: .88em; font-weight: 500; padding: 7px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text-primary); cursor: pointer; line-height: 1.2; white-space: nowrap; transition: background .12s, border-color .12s; }
.bd-btn:hover { background: var(--background-tertiary); border-color: var(--border-strong); }
.bd-btn:disabled { opacity: .45; cursor: default; }
.bd-btn-principal { background: var(--accent); border-color: var(--accent); color: #fff; }
.bd-btn-principal:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.bd-btn-discret { background: var(--background-secondary); }
.bd-btn-ico { padding: 6px; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.bd-btn-ico svg { width: 17px; height: 17px; }
.bd-btn-large { width: 100%; margin-top: 6px; }
.bd-danger:hover { color: var(--error-text); background: var(--error-light); border-color: #fca5a5; }

/* trois colonnes */
.bd-corps { display: grid; grid-template-columns: 286px minmax(0, 1fr) 312px; gap: 12px; flex: 1; min-height: 0; }
.bd-gauche, .bd-droite { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.bd-gauche { padding: 4px 0; }
.bd-droite { padding: 12px; }
.bd-centre { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: #e6eaef; }
.bd-outils { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: .85em; flex-wrap: wrap; }
.bd-zoom { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.bd-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.bd-statut { margin-left: auto; color: var(--text-tertiary); font-size: .92em; }
.bd-scene { flex: 1; overflow: auto; position: relative; }
.bd-scene canvas { display: block; }

/* sections du rail gauche */
.bd-section { border-bottom: 1px solid var(--border-light); }
.bd-section > summary { cursor: pointer; padding: 10px 14px; font-size: .78em; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); list-style: none; display: flex; align-items: center; gap: 6px; }
.bd-section > summary::before { content: '▸'; font-size: .9em; color: var(--text-tertiary); transition: transform .15s; }
.bd-section[open] > summary::before { transform: rotate(90deg); }
.bd-section > summary::-webkit-details-marker { display: none; }
.bd-section-corps { padding: 2px 14px 14px; display: flex; flex-direction: column; gap: 8px; font-size: .86em; }
.bd-section-corps label, .bd-champ { display: flex; flex-direction: column; gap: 4px; color: var(--text-secondary); font-size: .95em; }
.bd-section-corps input[type="text"], .bd-section-corps input[type="number"], .bd-section-corps input[type="search"], .bd-section-corps select,
.bd-droite input[type="text"], .bd-droite input[type="number"], .bd-droite select, .bd-droite textarea {
    font: inherit; font-size: .95em; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-primary); width: 100%; min-width: 0;
}
.bd-droite textarea { resize: vertical; line-height: 1.4; }
.bd-section-corps input:focus, .bd-droite input:focus, .bd-droite select:focus, .bd-droite textarea:focus { outline: none; border-color: var(--accent-light); box-shadow: var(--ring); }
.bd-coche { flex-direction: row !important; align-items: center; gap: 6px !important; cursor: pointer; }
.bd-coche input { width: auto; margin: 0; }
.bd-ligne2, .bd-ligne3, .bd-ligne4 { display: grid; gap: 8px; }
.bd-ligne2 { grid-template-columns: 1fr 1fr; }
.bd-ligne3 { grid-template-columns: 1fr 1fr 1fr; }
.bd-ligne4 { grid-template-columns: repeat(4, 1fr); }
.bd-info { font-size: .9em; color: var(--text-tertiary); line-height: 1.45; }
.bd-erreur { color: var(--error-text); }
.bd-aide { font-size: .85em; color: var(--text-tertiary); font-weight: 400; }
.bd-grille-ajout { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.bd-logo-ville { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.bd-logo-ville-corps, .bd-image-info { display: flex; align-items: center; gap: 8px; font-size: .9em; color: var(--text-secondary); min-height: 40px; }
.bd-logo-ville-corps img, .bd-image-info img { width: 56px; height: 40px; object-fit: contain; background: repeating-conic-gradient(#e5e7eb 0 25%, #fff 0 50%) 0 0 / 12px 12px; border: 1px solid var(--border); border-radius: 4px; }
.bd-champ-titre { font-size: .78em; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-tertiary); }

/* panneau de propriétés */
.bd-prop-vide { font-size: .88em; color: var(--text-secondary); line-height: 1.5; }
.bd-prop-vide p { margin-top: 10px; }
.bd-prop-tete { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.bd-prop-nom { flex: 1; font-weight: 600; }
.bd-prop-actions { display: flex; gap: 4px; }
.bd-droite .bd-champ, .bd-droite .bd-champ-inline { margin-bottom: 10px; font-size: .84em; color: var(--text-secondary); display: flex; flex-direction: column; gap: 4px; }
.bd-droite .bd-ligne2 .bd-champ-inline, .bd-droite .bd-ligne3 .bd-champ-inline, .bd-droite .bd-ligne4 .bd-champ-inline { margin-bottom: 8px; }
.bd-droite .bd-coche { font-size: .86em; margin-bottom: 8px; }
.bd-nuancier { display: flex; flex-wrap: wrap; gap: 5px; }
.bd-nuance { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,.12); cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.bd-nuance.actif { outline: 2px solid var(--accent); outline-offset: 1px; }
.bd-cmjn { display: grid; grid-template-columns: repeat(4, 1fr) 24px; gap: 4px; align-items: end; }
.bd-cmjn label { font-size: .8em; display: flex; flex-direction: column; gap: 2px; }
.bd-cmjn input { padding: 4px 5px !important; }
.bd-pastille { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,.12); margin-bottom: 4px; }

/* calques */
.bd-calques { display: flex; flex-direction: column; gap: 2px; }
.bd-calque { display: grid; grid-template-columns: 18px 1fr 22px 22px 22px 22px; align-items: center; gap: 2px; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: .9em; }
.bd-calque:hover { background: var(--background-tertiary); }
.bd-calque.actif { background: var(--accent-50); }
.bd-calque.cache .bd-calque-nom { opacity: .45; }
.bd-calque-type { font-size: .8em; color: var(--text-tertiary); text-align: center; }
.bd-calque-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-calque button { border: none; background: transparent; padding: 2px; cursor: pointer; color: var(--text-tertiary); display: inline-flex; border-radius: 4px; }
.bd-calque button:hover { color: var(--accent); background: rgba(18,54,185,.08); }
.bd-calque button svg { width: 15px; height: 15px; }

/* Edgar */
.bd-edgar-projets { display: flex; flex-direction: column; gap: 3px; max-height: 240px; overflow: auto; }
.bd-edgar-projet { text-align: left; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 5px 8px; cursor: pointer; font: inherit; font-size: .9em; display: flex; flex-direction: column; color: var(--text-primary); }
.bd-edgar-projet span { color: var(--text-tertiary); font-size: .85em; }
.bd-edgar-projet:hover { background: var(--background-tertiary); }
.bd-edgar-projet.actif { background: var(--accent-50); border-color: var(--accent-100); }
.bd-edgar-tete { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; font-size: .92em; }
.bd-edgar-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bd-edgar-fichier { display: flex; flex-direction: column; gap: 4px; font-size: .8em; }
.bd-edgar-fichier > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.bd-edgar-vignette { height: 64px; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#e5e7eb 0 25%, #fff 0 50%) 0 0 / 12px 12px; border: 1px solid var(--border); border-radius: 6px; color: var(--text-tertiary); font-weight: 600; overflow: hidden; }
.bd-edgar-vignette img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bd-edgar-boutons { display: flex; gap: 4px; }
.bd-edgar-boutons .bd-btn { padding: 4px 6px; font-size: .95em; flex: 1; }

/* modale */
.bd-voile { position: fixed; inset: 0; background: rgba(16,24,40,.45); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 24px; }
.bd-voile[hidden] { display: none; }
.bd-modal { background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-elevated); max-width: min(1500px, 96vw); max-height: 92vh; overflow: auto; padding: 22px 26px; position: relative; width: 100%; }
.bd-modal h3 { font-size: 1.15em; margin-bottom: 10px; }
.bd-modal h4 { margin: 18px 0 8px; font-size: 1em; }
.bd-modal h4 small { font-weight: 400; color: var(--text-tertiary); margin-left: 6px; }
.bd-modal-fermer { position: absolute; top: 12px; right: 12px; border: none; background: transparent; cursor: pointer; color: var(--text-tertiary); padding: 6px; border-radius: 6px; }
.bd-modal-fermer:hover { background: var(--background-tertiary); color: var(--text-primary); }
.bd-modal-fermer svg { width: 18px; height: 18px; }
.bd-modeles-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.bd-modele { text-align: left; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 10px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 4px; color: var(--text-primary); }
.bd-modele:hover { border-color: var(--accent-light); box-shadow: var(--shadow-card-hover); }
.bd-modele canvas { width: 100%; height: auto; border: 1px solid var(--border-light); border-radius: 6px; background: #fff; }
.bd-modele b { font-size: .95em; }
.bd-modele span { font-size: .82em; color: var(--text-secondary); }
.bd-modele small { font-size: .8em; color: var(--text-tertiary); line-height: 1.35; }
.bd-apercu-outils { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .88em; margin-bottom: 12px; color: var(--text-secondary); }
.bd-apercu-outils .bd-champ-inline { flex-direction: row; align-items: center; gap: 6px; }
.bd-apercu-outils input[type="number"] { width: 72px; font: inherit; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; }
.bd-apercu-canvas { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); display: block; }
.bd-apercu-actions { display: flex; gap: 8px; margin-top: 12px; }
.bd-fautes { display: flex; flex-direction: column; gap: 8px; }
.bd-faute { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: .92em; }
.bd-faute-avant { color: var(--error-text); text-decoration: line-through; }
.bd-faute-apres { color: var(--success-text); font-weight: 600; }
.bd-faute small { color: var(--text-tertiary); }

/* toast */
.bd-toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 12px); background: #1a202c; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .9em; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 70; max-width: min(560px, 90vw); text-align: center; box-shadow: var(--shadow-elevated); }
.bd-toast.visible { opacity: 1; transform: translate(-50%, 0); }
.bd-toast.erreur { background: #991b1b; }

@media (max-width: 1100px) {
    .bd-corps { grid-template-columns: 240px minmax(0, 1fr); }
    .bd-droite { grid-column: 1 / -1; max-height: 40vh; }
    .bd-app { height: auto; }
    .bd-scene { height: 60vh; }
}
