/* Console v3 — Bibliothèque › Looks. Cartes de console.css (avatar-card, avatar-visual) ; ici seulement
   ce qui est propre aux looks : carte « Créer un look », étapes de fabrication, échec, forfait, fond. */

.v3l svg, .v3l-settings svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.v3l .v3-silhouette svg { fill: currentColor; stroke: none; }
.v3l-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* Phrase de lecture seule, texte de limite sur la carte « Créer un look ». */
.v3l-plan { display: grid; gap: 10px; max-width: 660px; margin: 4px 0 28px; }
.v3l-limit-text { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.5; }
.v3l-readonly { margin: 0; }

/* Look en échec : pas de carte, une bannière en tête de page (explication, nouvel essai, « Masquer »). */
.v3l-banners { display: grid; gap: 8px; margin: 0 0 28px; }
.v3l-banner { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 32px; gap: 10px 12px; align-items: center;
  padding: 12px 10px 12px 16px; border: 1px solid var(--line-strong); border-left: 3px solid var(--warning); border-radius: 10px; background: var(--surface); color: var(--ink); }
.v3l-banner-icon { display: grid; align-self: start; padding-top: 1px; color: var(--warning); }
.v3l-banner-icon svg { width: 20px; height: 20px; }
.v3l-banner-text { min-width: 0; }
.v3l-banner-text p { margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.v3l-banner-text .v3l-banner-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0; }
.v3l-banner-title strong { color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.4; }
.v3l-banner-when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.v3l-banner-actions { display: flex; gap: 8px; align-items: center; }
.v3l-banner-actions:empty { display: none; }
.v3l-banner-dismiss { display: grid; width: 32px; height: 32px; place-items: center; padding: 0; border: 0; border-radius: 8px;
  color: var(--muted); background: none; cursor: pointer; }
.v3l-banner-dismiss svg { width: 16px; height: 16px; }
.v3l-banner-dismiss:hover { color: var(--ink); background: var(--surface-muted); }
.v3l-banner-dismiss:focus-visible { outline: 3px solid var(--blue, #2454de); outline-offset: 2px; }
@media (max-width: 640px) {
  .v3l-banner { grid-template-columns: 20px minmax(0, 1fr) 32px; align-items: start; }
  .v3l-banner-actions { grid-column: 2; grid-row: 2; }
  .v3l-banner-dismiss { grid-column: 3; grid-row: 1; margin-top: -6px; }
}

/* Groupes repliables : le titre est le bouton, la grille se masque. */
.v3l-fold { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 4px 10px 4px 0; border: 0; border-radius: 8px;
  color: inherit; background: none; font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }
.v3l-fold svg { flex: none; width: 18px; height: 18px; transition: transform .15s ease; }
.v3l-fold[aria-expanded="false"] svg { transform: rotate(-90deg); }
.v3l-fold:focus-visible { outline: 3px solid var(--blue, #2454de); outline-offset: 2px; }
.v3l-fold-count { color: var(--muted); font-size: 14px; font-weight: 600; }
.v3l-grid[hidden] { display: none; }
.v3l-section:has(.v3l-fold[aria-expanded="false"]) .avatar-section-heading { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .v3l-fold svg { transition: none; } }

/* Cartes : le menu « … » déborde de la carte (console.css la coupe), le visuel garde ses coins arrondis. */
.v3l-card { position: relative; overflow: visible; }
.v3l-card > .avatar-visual { overflow: hidden; border-top-left-radius: inherit; border-top-right-radius: inherit; }
.v3l-card:has(details[open]) { z-index: 6; }
.v3l-card .v3l-usage { min-height: 0; margin: 4px 0 12px; }
.v3l-card .avatar-card-body h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v3l-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.v3l-card .avatar-actions-list { min-width: 220px; }
.v3l-menu-hint { max-width: 240px; margin: 2px 8px 6px; font-size: 12px; white-space: normal; }
.v3l-empty { padding: 8px 0; }
.v3l-silhouette { position: absolute; inset: 0; }

/* « Créer un look » : silhouette + signe plus ; grisée quand la limite est atteinte. */
.v3l-create-visual { display: block; width: 100%; padding: 0; border: 0; cursor: pointer; font: inherit; color: inherit; }
.v3l-create-visual::after { display: none; }
.v3l-create-plus { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--ink); color: var(--surface); transform: translate(-50%, -50%); box-shadow: 0 8px 24px rgba(20, 20, 30, .18);
  transition: transform .15s ease; }
.v3l-create-plus svg { width: 26px; height: 26px; }
.v3l-create-visual:not(:disabled):hover .v3l-create-plus { transform: translate(-50%, -50%) scale(1.06); }
.v3l-create-visual:disabled { cursor: not-allowed; }
.v3l-create-visual:disabled .v3l-create-plus { background: var(--muted); box-shadow: none; }
.v3l-create .v3l-limit-text { min-height: 0; margin: 4px 0 12px; color: var(--ink); }

/* Fabrication : les étapes à la place du visuel. */
.v3l-build, .v3l-failed { display: grid; place-items: center; background: var(--surface-muted, #F8F7F4); }
.v3l-build::after, .v3l-failed::after { display: none; }
.v3l-build-inner, .v3l-failed-inner { display: grid; justify-items: center; gap: 10px; width: 100%; padding: 18px; text-align: center; }
.v3l-build .v3l-step { position: static; }
.v3l-build-label { font-size: 15px; line-height: 1.4; }
/* La carte a la couleur de la piste par défaut : sans fond propre, on ne voyait que le début rempli. */
.v3l-track { width: min(100%, 220px); background: rgba(21, 21, 21, .14); background: color-mix(in srgb, var(--ink) 14%, transparent); }
.v3l-track span { display: block; height: 100%; border-radius: inherit; background: var(--ink); transition: width .6s ease; }
.v3l-build-meta { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.v3l-build-late { margin: 0; max-width: 240px; color: var(--ink); font-size: 12px; line-height: 1.45; }

/* Échec : message simple + « Réessayer ». */
.v3l-failed-inner svg { width: 28px; height: 28px; color: var(--danger, #B42318); }
.v3l-failed-inner p { max-width: 240px; margin: 0; color: var(--ink); font-size: 14px; line-height: 1.5; }

.v3l-error { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.v3l-error p { margin: 0; }

/* Fenêtres : renommer, supprimer, fond d'un look. */
.v3l-modal { display: grid; gap: 12px; }
.v3l-modal-error { margin: 0; color: var(--danger, #B42318); font-size: 14px; }
.v3l-field { display: grid; gap: 6px; }
.v3l-field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; }
.v3l-field input[type="text"] { width: 100%; min-height: 40px; }
.v3l-field .field-hint { margin: 0; }
.v3l-settings { display: grid; gap: 22px; }

/* Module du fond (avatar-background.js) : il apporte sa propre feuille, on l'accorde à la console. */
.v3l-bg { display: grid; gap: 4px; font-size: 14px; }
.v3l-bg .avs-intro, .v3l-bg .avs-note, .v3l-bg .avbg-current { margin: 0 0 6px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.v3l-bg .avs-note { padding: 10px 12px; border-radius: 10px; background: var(--surface-muted, #F8F7F4); color: var(--ink); }
.v3l-bg .avs-note[hidden], .v3l-bg [hidden] { display: none !important; }
.v3l-bg .avbg-choice { margin: 6px 0 10px; }
.v3l-bg .avbg-choice label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.v3l-bg .avbg-color { height: 40px; }
.v3l-bg .avbg-drop { border-color: var(--line, #E4E5E1); }
.v3l-bg .avbg-drop.is-dragging { border-color: var(--ink); background: var(--surface-muted, #F8F7F4); }
.v3l-bg .avbg-actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
.v3l-bg .avs-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--line, #E4E5E1);
  border-radius: 999px; background: var(--surface, #fff); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.v3l-bg .avs-btn.is-primary { border-color: var(--ink); background: var(--ink); color: var(--surface, #fff); }
.v3l-bg .avs-btn:disabled { opacity: .5; cursor: not-allowed; }
.v3l-bg .avs-btn:focus-visible, .v3l-bg .avbg-drop:focus-visible { outline: 3px solid var(--blue, #2454de); outline-offset: 2px; }
.v3l-bg .avbg-progress { flex: 1 0 100%; accent-color: var(--ink); }
.v3l-bg .avbg-status { flex: 1 0 100%; margin: 0; color: var(--muted); font-size: 13px; }
.v3l-bg .avbg-status:empty { display: none; }

.v3l .button:focus-visible, .v3l summary:focus-visible, .v3l-create-visual:focus-visible { outline: 3px solid var(--blue, #2454de); outline-offset: 2px; }
.v3l-create-visual:focus-visible { outline-offset: -3px; }

@media (max-width: 600px) {
  .v3l-plan { margin-bottom: 22px; }
  .v3l .header-actions .button { width: 100%; justify-content: center; }
  .v3l-grid .v3l-card { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .v3l-track span, .v3l-create-plus { transition: none; }
}

/* Look tout juste envoyé : la page descend jusqu'à sa carte, un liseré bref la signale. */
.v3l-card.is-new { animation: v3l-new 2.4s ease-out 1; }
@keyframes v3l-new {
  0%, 40% { box-shadow: 0 0 0 3px var(--accent, #2454de); }
  100% { box-shadow: 0 0 0 3px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .v3l-card.is-new { animation: none; box-shadow: 0 0 0 3px var(--accent, #2454de); }
}

/* Nom du look ≠ nom de l'avatar : petit libellé « Look » sur la carte, ligne d'aide dans « Renommer ». */
.v3l-card .avatar-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.v3l-card .avatar-name-row h3 { min-width: 0; }
.v3l-kind { flex: none; padding: 2px 7px; border: 1px solid var(--line, rgba(21, 21, 21, .14)); border-radius: 999px;
  color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.4; letter-spacing: .02em; cursor: help; }
.v3l-name-hint { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.v3l-name-hint svg { flex: none; width: 16px; height: 16px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
