/* Lanppart Studio — interface de l'éditeur, à la charte de lanppart.fr (site-common.css). */
@font-face {
  font-family: 'Talina';
  src: url('assets/Talina.otf') format('opentype');
  font-weight: 400 900;
  font-display: swap;
}
:root {
  --bg-void: #05070d;
  --bg-panel: #0b111e;
  --bg-panel-raised: #0f1729;
  --line: #1c2740;
  --line-bright: #2c3c60;
  --ink: #e8ecf5;
  --ink-dim: #8c98b8;
  --ink-faint: #545f80;
  --accent: #35e6ff;
  --accent-2: #8b6bff;
  --win: #35e6a0;
  --danger: #ff4470;
  --font-display: 'Talina', 'Bahnschrift', 'Segoe UI Semibold', sans-serif;
  --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
  --topbar-h: 56px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg-void); color: var(--ink);
  font-family: var(--font-body); font-size: 13.5px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; font-weight: 700; }
svg { width: 16px; height: 16px; flex-shrink: 0; }
[hidden] { display: none !important; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px; border: 1px solid var(--line-bright); background: transparent;
  color: var(--ink-dim); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
}
.btn:hover, .btn:focus-visible { border-color: var(--accent); color: var(--ink); outline: none; }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.icone { width: 34px; padding: 0; font-size: 17px; }
.btn.primaire { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 0; color: #05070d; font-weight: 700; }
.btn.primaire:hover { box-shadow: 0 0 18px rgba(53,230,255,.35); color: #05070d; }
.btn.danger { border-color: rgba(255,68,112,.6); color: var(--danger); }
.btn.danger:hover { background: rgba(255,68,112,.12); border-color: var(--danger); }
.btn.large { width: 100%; }
.btn.actif { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* ---------- Cartes HUD (coins en flèche du site) ---------- */
.hud { position: relative; background: var(--bg-panel); border: 1px solid var(--line); }
.hud-corner { position: absolute; width: 14px; height: 14px; pointer-events: none; }
.hud-corner.tl { top: -1px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.hud-corner.br { bottom: -1px; right: -1px; border-bottom: 2px solid var(--accent-2); border-right: 2px solid var(--accent-2); }

/* ---------- Barre du haut ---------- */
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: rgba(5,7,13,.9); border-bottom: 1px solid var(--line); position: relative; z-index: 30;
}
.tb-logo img { height: 28px; display: block; }
.tb-badge {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .18em; color: var(--accent);
  border: 1px solid rgba(53,230,255,.4); padding: 3px 7px; margin-right: 6px;
}
.tb-nom {
  background: transparent; border: 1px solid transparent; height: 34px; padding: 0 10px;
  min-width: 120px; width: 280px; color: var(--ink); font-weight: 600;
}
.tb-nom:hover { border-color: var(--line); }
.tb-nom:focus { border-color: var(--accent); outline: none; background: var(--bg-panel); }
.tb-etat { font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
.tb-etat.erreur { color: var(--danger); }
.tb-espace { flex: 1; }
.tb-export { position: relative; }
.tb-user { display: flex; align-items: center; gap: 8px; color: var(--ink-dim); font-size: 12.5px; margin-left: 4px; }
.tb-user img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-bright); }

/* ---------- Mise en page ---------- */
.app { display: grid; grid-template-columns: 272px 1fr 300px; height: calc(100vh - var(--topbar-h)); }
.gauche, .droite { background: var(--bg-panel); overflow-y: auto; overflow-x: hidden; }
.gauche { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.droite { border-left: 1px solid var(--line); }
.centre { display: flex; flex-direction: column; min-width: 0; position: relative; }

.onglets { display: flex; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-panel); z-index: 2; }
.onglets button {
  flex: 1; height: 42px; background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--ink-dim); cursor: pointer; letter-spacing: .02em;
}
.onglets button:hover { color: var(--ink); }
.onglets button.actif { color: var(--accent); border-bottom-color: var(--accent); }
.onglet { padding: 14px; display: flex; flex-direction: column; gap: 8px; }

.groupe-titre, .section-titre {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint); display: flex; align-items: center; gap: 8px; margin-top: 6px;
}
.groupe-titre::before, .section-titre::before { content: ""; width: 14px; height: 1px; background: var(--accent); }
.aide { margin: 0; font-size: 12px; color: var(--ink-faint); }

.ajout {
  text-align: left; background: var(--bg-panel-raised); border: 1px solid var(--line); color: var(--ink);
  padding: 10px 12px; cursor: pointer; transition: border-color .15s, background .15s;
}
.ajout:hover { border-color: var(--accent); background: #121c33; }
.ajout-texte.titre { font-family: var(--font-display); font-size: 20px; letter-spacing: .02em; }
.ajout-texte.soustitre { font-family: 'Bahnschrift', sans-serif; font-size: 16px; color: var(--ink-dim); }
.ajout-texte.corps { font-size: 13px; }
.ajout-texte.etiquette { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .14em; color: var(--accent); }
.grille-ajout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tuile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  aspect-ratio: 1; background: var(--bg-panel-raised); border: 1px solid var(--line); color: var(--ink-dim);
  font-size: 11.5px; cursor: pointer; transition: border-color .15s, color .15s;
}
.tuile:hover { border-color: var(--accent); color: var(--ink); }
.tuile img { width: 56px; height: 26px; object-fit: contain; }
.ico-encadre { position: relative; width: 38px; height: 26px; background: #0b111e; border: 1px solid var(--line-bright); }
.ico-encadre i { position: absolute; width: 9px; height: 9px; }
.ico-encadre .tl { left: -1px; top: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.ico-encadre .br { right: -1px; bottom: -1px; border-bottom: 2px solid var(--accent-2); border-right: 2px solid var(--accent-2); }
.ico-forme { width: 30px; height: 26px; display: block; }
.ico-forme.rect { background: var(--accent); }
.ico-forme.ellipse { width: 26px; border-radius: 50%; background: var(--accent-2); }
.ico-forme.ligne { height: 4px; margin: 11px 0; border-radius: 2px; background: var(--accent); }
.ico-forme.image { border: 1.5px solid var(--ink-dim); background: linear-gradient(135deg, transparent 55%, rgba(53,230,255,.5) 55%); }

/* Médiathèque */
.depot { cursor: pointer; }
.depot.survol { border-color: var(--accent); background: rgba(53,230,255,.08); }
.medias { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.media {
  position: relative; aspect-ratio: 1; background: #070b14 center/contain no-repeat; border: 1px solid var(--line);
  cursor: pointer; overflow: hidden;
}
.media:hover { border-color: var(--accent); }
.media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.media .media-nom {
  position: absolute; left: 0; right: 0; bottom: 0; font-size: 10.5px; padding: 3px 6px;
  background: rgba(5,7,13,.8); color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media .media-suppr {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; background: rgba(5,7,13,.85);
  color: var(--ink-dim); cursor: pointer; display: none; font-size: 14px; line-height: 1;
}
.media:hover .media-suppr { display: block; }
.media .media-suppr:hover { color: var(--danger); }
.media.envoi { display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-size: 11px; }

/* Calques */
.calques { display: flex; flex-direction: column; gap: 3px; }
.calque-ligne {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 8px;
  background: var(--bg-panel-raised); border: 1px solid var(--line); cursor: pointer; user-select: none;
}
.calque-ligne:hover { border-color: var(--line-bright); }
.calque-ligne.sel { border-color: var(--accent); background: rgba(53,230,255,.08); }
.calque-ligne.masque .cl-nom { opacity: .45; text-decoration: line-through; }
.calque-ligne.cible-avant { box-shadow: 0 -2px 0 var(--accent); }
.calque-ligne.cible-apres { box-shadow: 0 2px 0 var(--accent); }
.cl-type { width: 18px; text-align: center; color: var(--ink-faint); font-family: var(--font-mono); font-size: 11px; }
.cl-nom { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-nom input { width: 100%; background: var(--bg-void); border: 1px solid var(--accent); padding: 2px 4px; }
.cl-btn { width: 24px; height: 24px; border: 0; background: none; color: var(--ink-faint); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cl-btn:hover { color: var(--ink); }
.cl-btn.on { color: var(--accent); }
.vide-liste { color: var(--ink-faint); font-size: 12px; padding: 10px 0; }

/* ---------- Centre ---------- */
.barre-centre {
  height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 14px;
  border-bottom: 1px solid var(--line); background: rgba(11,17,30,.6);
}
#btnFormat { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; }
.zoom { display: flex; gap: 4px; }
#zoomValeur { min-width: 70px; font-family: var(--font-mono); font-size: 12px; }
.zone {
  flex: 1; overflow: auto; position: relative;
  background:
    linear-gradient(rgba(53,230,255,.035) 1px, transparent 1px) 0 0/24px 24px,
    linear-gradient(90deg, rgba(53,230,255,.035) 1px, transparent 1px) 0 0/24px 24px,
    #070a12;
  display: grid; place-items: center;
}
.plan { position: relative; margin: 40px; flex-shrink: 0; box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 1px var(--line-bright); }
#stage { position: absolute; left: 0; top: 0; }
#stage .lps-calque { cursor: move; }
#stage .lps-calque.verrou { cursor: default; }
.surcouche { position: absolute; inset: 0; pointer-events: none; }
.sel-boite { position: absolute; border: 1.5px solid var(--accent); transform-origin: 50% 50%; pointer-events: none; }
.sel-boite.secondaire { border-style: solid; border-color: rgba(53,230,255,.7); }
.sel-boite.verrou { border-style: dashed; border-color: var(--ink-faint); }
.sel-groupe { position: absolute; border: 1px dashed rgba(53,230,255,.6); pointer-events: none; }
.poignee {
  position: absolute; width: 11px; height: 11px; background: #fff; border: 1.5px solid var(--accent);
  margin: -5.5px 0 0 -5.5px; pointer-events: auto; z-index: 2;
}
.poignee[data-p="n"], .poignee[data-p="s"] { width: 18px; height: 7px; margin: -3.5px 0 0 -9px; border-radius: 3px; }
.poignee[data-p="e"], .poignee[data-p="w"] { width: 7px; height: 18px; margin: -9px 0 0 -3.5px; border-radius: 3px; }
.poignee-rot {
  position: absolute; left: 50%; top: -34px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%;
  background: var(--bg-panel-raised); border: 1.5px solid var(--accent); pointer-events: auto; cursor: grab;
  display: flex; align-items: center; justify-content: center; color: var(--accent);
}
.poignee-rot svg { width: 12px; height: 12px; }
.sel-taille {
  position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 11px; background: var(--accent); color: #05070d; padding: 2px 6px; white-space: nowrap;
}
.guide { position: absolute; background: #ff4fd8; pointer-events: none; }
.guide.v { width: 1px; top: 0; bottom: 0; }
.guide.h { height: 1px; left: 0; right: 0; }
.lasso { position: absolute; border: 1px solid var(--accent); background: rgba(53,230,255,.08); pointer-events: none; }
.edition-texte { outline: 1.5px dashed var(--accent) !important; outline-offset: 4px; }

/* ---------- Propriétés ---------- */
.droite { padding: 0 0 30px; }
.p-entete {
  position: sticky; top: 0; z-index: 2; background: var(--bg-panel); padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px;
}
.p-entete h3 { font-size: 15px; letter-spacing: .02em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-section { padding: 10px 14px 4px; display: flex; flex-direction: column; gap: 8px; }
.p-section + .p-section { border-top: 1px solid rgba(28,39,64,.6); }
.p-ligne { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.p-ligne > label, .p-label { width: 92px; flex-shrink: 0; color: var(--ink-dim); font-size: 12.5px; }
.p-ligne .p-champ { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.p-grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.p-grille2 .p-ligne > label { width: 18px; font-family: var(--font-mono); color: var(--ink-faint); }
input.p-input, select.p-input, textarea.p-input {
  width: 100%; min-width: 0; height: 30px; background: var(--bg-void); border: 1px solid var(--line-bright);
  padding: 0 8px; color: var(--ink);
}
textarea.p-input { height: auto; min-height: 76px; padding: 7px 8px; resize: vertical; line-height: 1.4; }
input.p-input:focus, select.p-input:focus, textarea.p-input:focus { border-color: var(--accent); outline: none; }
input.p-input[type="number"] { font-family: var(--font-mono); font-size: 12px; padding-right: 2px; }
input.p-input:disabled { opacity: .5; }
select.p-input option { background: var(--bg-panel); }
input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); }
.p-num-court { width: 64px !important; flex: none; }
.p-unite { color: var(--ink-faint); font-size: 11.5px; font-family: var(--font-mono); }
.pastille {
  width: 30px; height: 30px; border: 1px solid var(--line-bright); cursor: pointer; flex-shrink: 0;
  background-clip: padding-box; position: relative;
}
.pastille:hover { border-color: var(--accent); }
.pastille-hex { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-dim); }
.interrupteur { position: relative; width: 34px; height: 18px; flex-shrink: 0; }
.interrupteur input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.interrupteur span { position: absolute; inset: 0; background: var(--line-bright); border-radius: 9px; transition: background .15s; }
.interrupteur span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink-dim); transition: transform .15s, background .15s; }
.interrupteur input:checked + span { background: rgba(53,230,255,.35); }
.interrupteur input:checked + span::after { transform: translateX(16px); background: var(--accent); }
.seg { display: flex; border: 1px solid var(--line-bright); }
.seg button { flex: 1; height: 30px; padding: 0 8px; background: none; border: 0; color: var(--ink-dim); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.seg button + button { border-left: 1px solid var(--line-bright); }
.seg button:hover { color: var(--ink); }
.seg button.actif { background: rgba(53,230,255,.14); color: var(--accent); }
.seg.petit button { height: 28px; }
.p-boutons { display: flex; flex-wrap: wrap; gap: 6px; }
.p-boutons .btn { height: 30px; padding: 0 9px; font-size: 12.5px; }
.p-boutons .btn.icone { width: 30px; }
.p-boutons svg { width: 15px; height: 15px; }
.p-vide { padding: 30px 18px; color: var(--ink-faint); text-align: center; }
.apercu-media { width: 100%; height: 90px; object-fit: contain; background: #070b14; border: 1px solid var(--line); }

/* ---------- Pop-ups ---------- */
.pop {
  position: absolute; z-index: 60; background: var(--bg-panel-raised); border: 1px solid var(--line-bright);
  box-shadow: 0 20px 50px rgba(0,0,0,.55); padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
#popExport { right: 0; top: calc(100% + 8px); width: 290px; }
.pop-titre { font-family: var(--font-display); font-size: 15px; }
.pop .ligne { display: flex; align-items: center; gap: 10px; color: var(--ink-dim); }
.pop .dim { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); margin-left: auto; }
.ex-resultat { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.ex-resultat img { width: 100%; max-height: 180px; object-fit: contain; background: #070b14; border: 1px solid var(--line); }
.ex-resultat .ex-infos { font-size: 12px; color: var(--ink-dim); font-family: var(--font-mono); }
.chargement { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(5,7,13,.35); border-top-color: #05070d; border-radius: 50%; animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

.pop-couleur { position: fixed; width: 236px; }
.pc-titre { font-size: 11px; color: var(--ink-faint); font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.pc-palette { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.pc-palette button { aspect-ratio: 1; border: 1px solid var(--line-bright); cursor: pointer; padding: 0; }
.pc-palette button:hover { transform: scale(1.12); border-color: #fff; }
.pc-palette button.actif { outline: 2px solid var(--accent); outline-offset: 1px; }
.pc-libre { display: flex; gap: 8px; align-items: center; }
.pc-libre input[type="color"] { flex: none; width: 40px; height: 32px; padding: 0; border: 1px solid var(--line-bright); background: none; cursor: pointer; }
.pc-libre input[type="text"] { flex: 1; height: 32px; background: var(--bg-void); border: 1px solid var(--line-bright); padding: 0 8px; font-family: var(--font-mono); }

/* ---------- Modales ---------- */
.modale { position: fixed; inset: 0; z-index: 80; background: rgba(3,5,10,.72); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 30px; }
.modale-boite { background: var(--bg-panel); border: 1px solid var(--line); max-height: 100%; overflow: auto; position: relative; }
.modale-boite.large { width: min(1100px, 100%); }
.modale-boite.petite { width: min(420px, 100%); padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.modale-tete { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-panel); z-index: 2; }
.modale-tete h2 { font-size: 20px; flex: 1; }
.modale-actions { display: flex; justify-content: flex-end; gap: 8px; }
.filtre { display: flex; align-items: center; gap: 6px; color: var(--ink-dim); font-size: 12.5px; cursor: pointer; }

.projets, .exports { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; padding: 20px; }
.carte-projet { background: var(--bg-panel-raised); border: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; position: relative; transition: border-color .15s; }
.carte-projet:hover { border-color: var(--accent); }
.carte-projet.courant { border-color: var(--accent-2); }
.cp-apercu { height: 170px; display: flex; align-items: center; justify-content: center; background: #070b14; overflow: hidden; position: relative; }
.cp-mini { position: relative; overflow: hidden; box-shadow: 0 0 0 1px var(--line-bright); }
.cp-mini .lps-stage { position: absolute; left: 0; top: 0; pointer-events: none; }
.cp-mini img.cp-export { width: 100%; height: 100%; object-fit: contain; }
.cp-infos { padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; }
.cp-nom { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-meta { font-size: 11.5px; color: var(--ink-faint); font-family: var(--font-mono); }
.cp-actions { position: absolute; top: 6px; right: 6px; display: none; gap: 4px; z-index: 2; }
.carte-projet:hover .cp-actions { display: flex; }
.cp-actions button { height: 26px; padding: 0 8px; background: rgba(5,7,13,.9); border: 1px solid var(--line-bright); color: var(--ink-dim); cursor: pointer; font-size: 11.5px; }
.cp-actions button:hover { color: var(--ink); border-color: var(--accent); }
.cp-actions button.suppr:hover { color: var(--danger); border-color: var(--danger); }
.vide-modale { grid-column: 1/-1; text-align: center; color: var(--ink-faint); padding: 40px; }

.formats { padding: 10px 20px 20px; }
.formats-groupe { margin-top: 14px; }
.formats-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.tuile-format { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 8px 10px; background: var(--bg-panel-raised); border: 1px solid var(--line); cursor: pointer; color: var(--ink); }
.tuile-format:hover { border-color: var(--accent); }
.tuile-format.actif { border-color: var(--accent-2); box-shadow: inset 0 0 0 1px var(--accent-2); }
.tf-cadre { height: 64px; display: flex; align-items: center; justify-content: center; }
.tf-forme { border: 1.5px solid var(--accent); background: rgba(53,230,255,.06); position: relative; }
.tf-forme::before { content: ""; position: absolute; left: -1.5px; top: -1.5px; width: 7px; height: 7px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.tf-forme::after { content: ""; position: absolute; right: -1.5px; bottom: -1.5px; width: 7px; height: 7px; border-bottom: 2px solid var(--accent-2); border-right: 2px solid var(--accent-2); }
.tf-nom { font-size: 12.5px; text-align: center; }
.tf-dim { font-size: 11px; color: var(--ink-faint); font-family: var(--font-mono); }
.format-perso { display: flex; align-items: center; gap: 8px; padding: 14px 20px 20px; border-top: 1px solid var(--line); color: var(--ink-dim); flex-wrap: wrap; }
.format-perso input { width: 90px; height: 34px; background: var(--bg-void); border: 1px solid var(--line-bright); padding: 0 8px; font-family: var(--font-mono); }

.carte-export img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Accès refusé ---------- */
.refus { position: fixed; inset: 0; z-index: 100; background: var(--bg-void); display: flex; align-items: center; justify-content: center; padding: 20px; }
.refus-carte { width: min(440px, 100%); padding: 34px 30px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.refus-logo { height: 40px; }
.refus-carte h1 { font-size: 28px; letter-spacing: .04em; }
.refus-carte p { color: var(--ink-dim); margin: 0; }
.refus-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* ---------- Toast / dépôt ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120;
  background: var(--bg-panel-raised); border: 1px solid var(--line-bright); border-left: 3px solid var(--accent);
  padding: 10px 16px; box-shadow: 0 14px 40px rgba(0,0,0,.5); max-width: 520px;
}
.toast.erreur { border-left-color: var(--danger); }
.depot-ecran { position: fixed; inset: 0; z-index: 110; background: rgba(5,7,13,.75); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.depot-ecran div { font-family: var(--font-display); font-size: 28px; padding: 40px 60px; border: 2px dashed var(--accent); color: var(--accent); }

@media (max-width: 1100px) {
  .app { grid-template-columns: 230px 1fr 270px; }
  .tb-nom { width: 180px; }
}

/* ---------- Modèles ---------- */
.onglets button { font-size: 12.5px; }
.modeles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.carte-modele {
  position: relative; background: var(--bg-panel-raised); border: 1px solid var(--line); cursor: pointer;
  display: flex; flex-direction: column; transition: border-color .15s;
}
.carte-modele:hover { border-color: var(--accent); }
.cm-apercu { height: 112px; display: flex; align-items: center; justify-content: center; background: #070b14; overflow: hidden; }
.cm-nom { font-size: 11.5px; padding: 5px 7px; line-height: 1.3; color: var(--ink-dim); }
.carte-modele:hover .cm-nom { color: var(--ink); }
.cm-suppr {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; background: rgba(5,7,13,.85);
  color: var(--ink-dim); cursor: pointer; display: none; font-size: 14px; line-height: 1; z-index: 2;
}
.carte-modele:hover .cm-suppr { display: block; }
.cm-suppr:hover { color: var(--danger); }

.modele-corps { display: grid; grid-template-columns: 360px 1fr; min-height: 520px; }
.modele-form { padding: 16px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: calc(100vh - 150px); }
.modele-form .p-ligne { align-items: flex-start; }
.modele-form .p-ligne > label { padding-top: 6px; }
.modele-form textarea.p-input { min-height: 120px; font-family: var(--font-mono); font-size: 12px; }
.modele-form .champ-aide { font-size: 11px; color: var(--ink-faint); margin-top: 3px; }
.modele-form .p-champ { flex-direction: column; align-items: stretch; }
.champ-equipe { display: flex; gap: 6px; align-items: center; }
.champ-equipe .pastille { width: 22px; height: 22px; cursor: default; }
.modele-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.modele-apercu { display: flex; align-items: center; justify-content: center; padding: 20px; background: #070a12; min-height: 0; }

/* ---------- Animation / vidéo ---------- */
.timeline {
  height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border-top: 1px solid var(--line); background: rgba(11,17,30,.85); flex-shrink: 0;
}
.timeline .btn.icone { width: 34px; height: 34px; }
.timeline .ico-pause { display: none; }
.timeline.lecture .ico-pause { display: block; }
.timeline.lecture .ico-lecture { display: none; }
.timeline.lecture #tlLecture { border-color: var(--accent); color: var(--accent); }
#tlBoucle.actif { border-color: var(--accent-2); color: var(--accent-2); }
#tlCurseur { flex: 1; min-width: 80px; }
.tl-temps { font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); min-width: 92px; text-align: right; }
.tl-duree { display: flex; align-items: center; gap: 6px; color: var(--ink-dim); font-size: 12.5px; }
.tl-duree input { width: 58px; height: 30px; background: var(--bg-void); border: 1px solid var(--line-bright); padding: 0 6px; font-family: var(--font-mono); font-size: 12px; }
.tl-musique { font-size: 12px; color: var(--ink-faint); max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-musique.on { color: var(--accent-2); }
.timeline.vide .tl-musique::after { content: none; }
.ex-progression { display: flex; flex-direction: column; gap: 6px; }
.ex-barre { height: 8px; background: var(--bg-void); border: 1px solid var(--line-bright); overflow: hidden; }
.ex-barre i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
#exProgTexte { font-size: 12px; color: var(--ink-dim); font-family: var(--font-mono); }
.ex-resultat video { width: 100%; max-height: 220px; background: #070b14; border: 1px solid var(--line); }
.media.audio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: linear-gradient(135deg, rgba(139,107,255,.18), rgba(53,230,255,.08)); }
.media.audio .media-note { font-size: 30px; color: var(--accent-2); line-height: 1; }
.media.audio .media-duree { font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim); }
.media.audio.choisie { border-color: var(--accent-2); box-shadow: inset 0 0 0 1px var(--accent-2); }
.carte-export video { width: 100%; height: 100%; object-fit: contain; }
.cp-badge { position: absolute; left: 6px; top: 6px; font-family: var(--font-mono); font-size: 10.5px; padding: 2px 6px; background: var(--accent-2); color: #05070d; font-weight: 700; z-index: 2; }
.anim-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.modeles .cm-groupe { grid-column: 1 / -1; margin-top: 8px; }

.ico-qr { width: 26px; height: 26px; display: block; background:
  linear-gradient(90deg, var(--ink) 0 30%, transparent 30% 70%, var(--ink) 70%) 0 0 / 100% 30% no-repeat,
  linear-gradient(90deg, var(--ink) 0 30%, transparent 30%) 0 100% / 100% 30% no-repeat,
  linear-gradient(var(--ink), var(--ink)) 60% 60% / 25% 25% no-repeat; outline: 2px solid var(--ink-dim); outline-offset: 2px; }

.palettes-rapides .btn.icone.pastille-palette { width: 30px; height: 30px; border: 1px solid var(--line-bright); }
.palettes-rapides .btn.icone.pastille-palette.actif { outline: 2px solid #fff; outline-offset: 1px; }

/* ---------- Mes projets : outils, mosaïque, liste ---------- */
.projets-outils {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 20px;
  border-bottom: 1px solid var(--line); position: sticky; top: 67px; z-index: 2; background: var(--bg-panel);
}
.projets-outils .seg button { gap: 6px; padding: 0 12px; }
.po-taille { display: flex; align-items: center; gap: 8px; color: var(--ink-dim); }
.po-taille input { width: 140px; }
.po-tri { display: flex; align-items: center; gap: 8px; color: var(--ink-dim); font-size: 12.5px; }
.po-tri select { width: auto; }
.po-recherche { width: 200px !important; }
.po-compte { color: var(--ink-faint); font-family: var(--font-mono); font-size: 12px; margin-left: auto; }
.projets.en-mosaique { grid-template-columns: repeat(auto-fill, minmax(var(--taille-carte, 200px), 1fr)); }
.projets.en-liste { display: flex; flex-direction: column; gap: 4px; }
.pl-ligne {
  display: grid; grid-template-columns: 76px minmax(160px, 2fr) minmax(140px, 1.2fr) minmax(130px, 1fr) minmax(130px, 1fr) 170px;
  align-items: center; gap: 12px; padding: 6px 10px; background: var(--bg-panel-raised); border: 1px solid var(--line); cursor: pointer;
}
.pl-ligne:hover { border-color: var(--accent); }
.pl-ligne.courant { border-color: var(--accent-2); }
.pl-tete { background: none; border-color: transparent; cursor: default; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); padding-top: 0; padding-bottom: 0; }
.pl-tete:hover { border-color: transparent; }
.pl-col.triable { cursor: pointer; }
.pl-col.triable:hover, .pl-col.actif { color: var(--accent); }
.pl-apercu { width: 64px; height: 48px; display: flex; align-items: center; justify-content: center; background: #070b14; overflow: hidden; }
.pl-nom { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; flex-direction: column; }
.pl-modele { font-weight: 400; font-size: 11.5px; color: var(--ink-faint); }
.pl-meta { font-size: 12px; color: var(--ink-dim); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-actions { display: flex; gap: 6px; justify-content: flex-end; }
.pl-actions button { height: 28px; padding: 0 9px; background: rgba(5,7,13,.9); border: 1px solid var(--line-bright); color: var(--ink-dim); cursor: pointer; font-size: 12px; }
.pl-actions button:hover { color: var(--ink); border-color: var(--accent); }
.pl-actions button.suppr:hover { color: var(--danger); border-color: var(--danger); }

/* ---------- Mes projets : sélection multiple ---------- */
.projets-selection {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 20px;
  background: rgba(53,230,255,.08); border-bottom: 1px solid rgba(53,230,255,.35);
  position: sticky; top: 125px; z-index: 2;
}
.projets-selection #selCompte { font-weight: 600; color: var(--accent); }
.projets-selection #selSupprimer { margin-left: auto; }
.po-aide { font-size: 11.5px; color: var(--ink-faint); }
.sel-case { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sel-case input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.carte-projet .sel-case {
  position: absolute; top: 6px; left: 6px; z-index: 3; width: 30px; height: 30px;
  background: rgba(5,7,13,.85); border: 1px solid var(--line-bright); opacity: 0; transition: opacity .12s;
}
.carte-projet:hover .sel-case, .mode-selection .carte-projet .sel-case, .carte-projet.coche .sel-case { opacity: 1; }
.carte-projet.coche { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.carte-projet.coche .cp-apercu { opacity: .85; }
.pl-ligne { grid-template-columns: 28px 76px minmax(160px, 2fr) minmax(140px, 1.2fr) minmax(130px, 1fr) minmax(130px, 1fr) 170px; }
.pl-ligne.coche { border-color: var(--accent); background: rgba(53,230,255,.07); }
