/* Onglet « Templates » (#/template, static/template.js) : tuiles des modèles en haut, panneau du modèle choisi dessous */
.tp-entete { margin: 4px 0 14px; }
.tp-titre { margin: 0 0 4px; }
.tp-note { color: var(--sourd, #9a9aa6); font-size: 13px; font-weight: 400; margin: 0; }
.tp-erreur { color: var(--rouge, #e5534b); }

/* tuiles */
.tp-tuiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.tp-tuile { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 44px 14px 14px; border-radius: 14px; cursor: pointer;
  background: var(--carte); border: 1px solid var(--bord, #34333c); transition: border-color .15s, transform .15s, box-shadow .15s; outline: none; }
.tp-tuile:hover, .tp-tuile:focus-visible { border-color: var(--accent, #d8a24a); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.tp-tuile.choisie { border-color: var(--accent, #d8a24a); background: linear-gradient(160deg, rgba(216,162,74,.16), rgba(216,162,74,.03)) , var(--carte);
  box-shadow: 0 0 0 1px var(--accent, #d8a24a) inset; }
.tp-tuile-icone { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; background: rgba(0,0,0,.25); }
.tp-tuile-corps { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tp-tuile-corps b { font-size: 15px; }
.tp-tuile-corps > span { color: var(--sourd, #9a9aa6); font-size: 12.5px; line-height: 1.35; }
.tp-puces { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.tp-puce { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--sourd, #9a9aa6); }
.tp-puce.or { background: rgba(216,162,74,.18); color: var(--accent, #d8a24a); }
.tp-creer { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; text-decoration: none;
  font-weight: 700; color: #1a1208; background: var(--accent, #d8a24a); opacity: .85; }
.tp-creer:hover { opacity: 1; }

@media (max-width: 1000px) { .tp-tuiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tp-tuiles { grid-template-columns: 1fr; } }

/* panneau du modèle choisi */
.tp-panneau { background: var(--carte); border: 1px solid var(--bord, #34333c); border-radius: 14px; padding: 16px 18px; }
.tp-panneau-tete { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--bord, #34333c); }
.tp-panneau-tete h3 { margin: 0 0 2px; }
.tp-panneau-tete > div:nth-child(2) { flex: 1; min-width: 220px; }
.tp-grosse-icone { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 30px; background: rgba(216,162,74,.14); }
.tp-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tp-bouton { display: inline-block; padding: 7px 14px; border-radius: 9px; border: 1px solid var(--bord, #34333c); background: rgba(255,255,255,.04); color: inherit; text-decoration: none; }
.tp-bouton:hover { border-color: var(--accent, #d8a24a); }
.tp-primaire { background: var(--accent, #d8a24a); color: #1a1208; border-color: var(--accent, #d8a24a); font-weight: 700; }
.tp-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 6px; }
.tp-colonnes h4 { margin: 14px 0 8px; }
.tp-colonnes h4 small { color: var(--sourd, #9a9aa6); font-weight: 400; margin-left: 4px; }
@media (max-width: 900px) { .tp-colonnes { grid-template-columns: 1fr; } }

/* brouillons (cartes) */
.tp-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.tp-carte { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--bord, #34333c); border-radius: 10px; color: inherit; text-decoration: none; background: rgba(0,0,0,.12); }
.tp-carte:hover { border-color: var(--accent, #d8a24a); }
.tp-carte img, .tp-sans-image { width: 44px; height: 58px; object-fit: cover; border-radius: 6px; flex: none; display: grid; place-items: center; background: rgba(0,0,0,.3); font-size: 22px; }
.tp-carte span { display: flex; flex-direction: column; min-width: 0; }
.tp-carte b, .tp-carte small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-carte small { color: var(--sourd, #9a9aa6); }
/* ✕ : supprimer le brouillon de ce navigateur (en haut à droite de la carte) */
.tp-carte-boite { position: relative; min-width: 0; }
.tp-carte-boite .tp-carte { padding-right: 30px; height: 100%; box-sizing: border-box; }
.tp-suppr { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; padding: 0; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--sourd, #9a9aa6); font: 13px/1 system-ui, sans-serif; cursor: pointer; opacity: .65; }
.tp-carte-boite:hover .tp-suppr, .tp-suppr:focus-visible { opacity: 1; }
.tp-suppr:hover { color: #e06c6c; border-color: #e06c6c; background: rgba(224,108,108,.12); }

/* sur le site (liste) */
.tp-q { width: 100%; margin: 0 0 8px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--bord, #34333c); background: rgba(0,0,0,.25); color: inherit; font: inherit; }
.tp-q[hidden] { display: none; }
.tp-liste { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.tp-ligne { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--bord, #34333c);
  border-radius: 10px; color: inherit; text-decoration: none; background: rgba(0,0,0,.12); }
.tp-ligne:hover { border-color: var(--accent, #d8a24a); }
.tp-ligne > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.tp-ligne small { color: var(--sourd, #9a9aa6); }
.tp-ouvrir { color: var(--accent, #d8a24a); font-size: 13px; white-space: nowrap; }

/* vide */
.tp-vide { text-align: center; padding: 22px 12px; border: 1px dashed var(--bord, #34333c); border-radius: 12px; color: var(--sourd, #9a9aa6); }
.tp-vide > div { font-size: 30px; opacity: .6; }
.tp-vide p { margin: 6px 0 10px; }
.tp-vide.petit { padding: 14px; }
.tp-vide.petit p { margin: 0; }
