/* =====================================================================
   Sets des scripts (public/sets.js) — 09/11/2026
   Médias gratuits / payants d'une étape, rangés par message. Mêmes jetons que le reste : --surface, --line, --accent.
   ===================================================================== */
.vs { display: flex; flex-direction: column; gap: 10px; min-width: 0; container-type: inline-size; }
.vs-sum { font-size: 13px; font-weight: 600; color: var(--fg); padding: 8px 10px; border-radius: var(--r-md, 10px); background: var(--surface-2, var(--surface)); border: 1px solid var(--line); line-height: 1.45; }
.vs-issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.vs-issues:empty { display: none; }
.vs-issues li { font-size: 12.5px; padding: 6px 9px; border-radius: 8px; line-height: 1.4; }
.vs-issues li.bad { background: color-mix(in srgb, #e5484d 14%, transparent); color: var(--fg); }
.vs-issues li.warn { background: color-mix(in srgb, #e5a50a 14%, transparent); color: var(--fg); }
.vs-issues li.info { background: var(--surface-3); color: var(--muted); }
.vs-msg { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md, 10px); background: var(--surface); }
.vs-msg.over { border-color: var(--accent); }
.vs-mh { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.vs-mh b { font-size: 13px; }
.vs-mp { font-size: 12px; color: var(--muted); flex: 1; min-width: 0; }
.vs-hint { font-size: 11.5px; }
.vs-msg textarea { width: 100%; box-sizing: border-box; padding: 7px 9px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 13.5px; resize: vertical; }
.vs-cards { display: flex; flex-direction: column; gap: 6px; }
.vs-empty { margin: 0; padding: 10px; border: 1px dashed var(--line); border-radius: 9px; text-align: center; font-size: 12.5px; color: var(--muted); }
.vs-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto auto auto; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-left-width: 3px; border-radius: 9px; background: var(--bg); }
.vs-card.paid { border-left-color: var(--accent); }
.vs-card.free { border-left-color: #30a46c; }
.vs-card.drag { opacity: .45; }
.vs-card.over { box-shadow: 0 -2px 0 var(--accent); }
.vs-card[draggable="true"] { cursor: grab; }
.vs-th { width: 40px; height: 40px; border-radius: 7px; overflow: hidden; display: grid; place-items: center; background: var(--surface-3); cursor: pointer; }
.vs-th img { width: 100%; height: 100%; object-fit: cover; }
.vs-th .i { width: 16px; height: 16px; color: var(--muted); }
.vs-nm { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vs-nm b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-nm small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-ph { display: grid; grid-template-columns: 82px 52px minmax(0, 1fr); gap: 6px; }
.vs-ph select, .vs-ph input, .vs-msgsel, .vs-price input { min-width: 0; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-size: 13px; }
.vs-badge { min-width: 76px; height: 30px; padding: 0 9px; border-radius: 999px; border: 1px solid transparent; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .04em; cursor: pointer; }
.vs-badge[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.vs-badge[aria-pressed="false"] { background: color-mix(in srgb, #30a46c 16%, transparent); color: #3dd68c; border-color: color-mix(in srgb, #30a46c 40%, transparent); }
:root[data-theme="light"] .vs-badge[aria-pressed="false"] { color: #18794e; }
.vs-price { display: inline-flex; align-items: center; gap: 4px; }
.vs-price input { width: 74px; }
.vs-price em { font-style: normal; color: var(--muted); font-size: 12.5px; }
.vs-mv { display: inline-flex; gap: 2px; }
.vs-mv button { width: 30px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; }
.vs-mv button:hover:not(:disabled) { background: var(--surface-3); color: var(--fg); }
.vs-mv button:disabled { opacity: .3; cursor: default; }
.vs-add { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vs-add .btn-ghost { display: inline-flex; align-items: center; gap: 5px; }
.vs-add .btn-ghost .i { width: 15px; height: 15px; }
.vs-add small { margin-left: auto; }

/* téléphone : la carte passe sur deux lignes (aperçu + nom, puis réglages), cibles de 44 px */
@media (max-width: 720px) {
  .vs-card { display: flex; flex-wrap: wrap; gap: 6px 8px; }
  .vs-th { width: 44px; height: 44px; flex: none; }
  .vs-nm { flex: 1 1 calc(100% - 56px); }
  .vs-ph { grid-template-columns: 1fr 64px; }
  .vs-ph input[data-vs-f="vault"] { grid-column: 1 / -1; }
  /* (les formulaires des fenêtres fixent une hauteur de 40 px : ici 44 px, cibles tactiles) */
  html body .vs :is(.vs-badge, .vs-mv button, .vs-msgsel, .vs-price input, .vs-ph select, .vs-ph input) { min-height: 44px !important; height: auto !important; font-size: 16px; box-sizing: border-box; }
  html body .vs .vs-card .vs-msg-x input[data-vs-f][type], html body .vs .vs-card.vs-card .vs-price input[data-vs-f][type], html body .vs .vs-card.vs-card .vs-ph input[data-vs-f]:not([type=file]), html body .vs .vs-card.vs-card .vs-ph select[data-vs-f][aria-label], html body .vs .vs-card.vs-card select.vs-msgsel[data-vs-f] { min-height: 44px !important; }
  .vs-msgsel { flex: 1 1 110px; }
  .vs-mv { margin-left: auto; }
  .vs-mv button { width: 44px; }
  .vs-msg textarea { font-size: 16px; }
}

/* Bibliothèque (Velora IA) : prix calculé de l'étape, aperçu */
.bl-ptot { display: inline-flex; align-items: center; padding: 0 10px; height: 30px; border-radius: 8px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.bl-ptot.free { color: var(--muted); font-weight: 500; }
.bl-pvm span.free { color: #3dd68c; }
.bl-pvsum { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* Scripts et modèles : médias gratuits / payants dans la liste, résumé du set */
.sm-md span.free { color: #3dd68c; }
.lb-setsum { margin: 4px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--fg); }
.sm-setbox .lb-set { margin-top: 6px; }

/* Messages (téléphone et site) : la bande d'un set au-dessus de la zone d'écriture */
.mc-setbar { display: flex; flex-direction: column; gap: 6px; margin: 0 0 8px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-md, 10px); background: var(--surface); font-size: 13px; }
.mc-sb-h { display: flex; align-items: baseline; gap: 8px; }
.mc-sb-h small { color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-setbar ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.mc-setbar li { color: var(--muted); font-size: 12.5px; }
.mc-setbar li.on { color: var(--fg); }
.mc-setbar .btn-main, .mc-setbar .btn-ghost { align-self: flex-start; }
.mc-setbar small { font-size: 12px; }
@media (max-width: 720px) { .mc-setbar .btn-main, .mc-setbar .btn-ghost { min-height: 44px; align-self: stretch; } }

/* Telegram : choisir une étape de script dans la réponse */
.tg-scripts { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; margin: 0 0 8px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-md, 10px); background: var(--surface); }
.tg-scr { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--fg); font: inherit; text-align: left; cursor: pointer; min-height: 44px; }
.tg-scr:hover { background: var(--surface-3); }
.tg-scr small { color: var(--muted); font-size: 12px; }
.tg-scr em { font-style: normal; font-size: 12px; color: var(--accent); }
.tg-set-warn { color: #e5a50a; font-size: 12px; }

/* éditeur étroit (colonne de droite d'une fenêtre, téléphone) : la carte passe sur deux lignes */
@container (max-width: 560px) {
  .vs-card { display: flex; flex-wrap: wrap; gap: 6px 8px; }
  .vs-th { flex: none; }
  .vs-nm { flex: 1 1 calc(100% - 52px); }
  .vs-ph { grid-template-columns: 1fr 64px; }
  .vs-ph input[data-vs-f="vault"] { grid-column: 1 / -1; }
  .vs-msgsel { flex: 1 1 110px; min-width: 104px; }
  .vs-mv { margin-left: auto; }
  .vs-price { flex: none; }
}

/* le prix et son « $ » restent sur une ligne (les formulaires des fenêtres mettent les champs en colonne) */
html body .vs .vs-card label.vs-price { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 4px; margin: 0; }
html body .vs .vs-card label.vs-price[hidden] { display: none !important; }
html body .vs .vs-card label.vs-price input { width: 78px !important; flex: none; }
