/* ════════════════════════════════════════════════════════════════════════
   Liseuse v2 — audiolivre.css : vue « Audiolivres » (création + générations)
   Tokens :root de v2.css uniquement. Réutilise .vhead / .vbody / .vstate /
   .vskel / .btn / .iconbtn de views.css. Tout est préfixé .ab- (aucun effet
   sur les autres vues).
   ════════════════════════════════════════════════════════════════════════ */

.ab .visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ───────────── carte de création ───────────── */
.ab-card {
  display: flex; flex-direction: column; gap: 16px;
  padding: 22px; border-radius: var(--r-l);
  background: var(--glass-2); border: 1px solid var(--stroke);
  backdrop-filter: var(--blur-1); -webkit-backdrop-filter: var(--blur-1);
  box-shadow: var(--shadow-1); max-width: 760px;
}
.ab-card__title { font-family: var(--display); font-size: 20px; font-weight: 600; margin: 0; }

/* choix de la source (radiogroup) */
.ab-seg {
  display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; align-self: flex-start;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--stroke); max-width: 100%;
}
.ab-seg__btn {
  min-height: 44px; padding: 0 16px; border-radius: 10px; font-weight: 500; font-size: 14px;
  color: var(--text-2); transition: all .18s var(--ease);
}
.ab-seg__btn:hover { color: var(--text); }
.ab-seg__btn.is-active {
  background: var(--glass-2); color: #fff; font-weight: 600;
  border: 1px solid var(--stroke-lit); box-shadow: var(--shadow-1);
}

.ab-pane { display: flex; flex-direction: column; gap: 12px; }
.ab-pane[hidden] { display: none !important; }

/* champs */
.ab-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ab-field__lbl {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3);
}
.ab-input, .ab-select { width: 100%; min-height: 44px; }
.ab-input {
  padding: 0 15px; background: rgba(0, 0, 0, .28); border: 1px solid var(--stroke);
  border-radius: 13px; color: var(--text); font-size: 14.5px;
}
.ab-input::placeholder { color: var(--text-3); }
.ab-input:focus { border-color: var(--acc); outline: none; box-shadow: 0 0 0 3px var(--acc-soft); }
.ab-textarea { padding: 13px 15px; min-height: 160px; resize: vertical; line-height: 1.55; }
.ab-select { color: var(--text); font-size: 14px; background-color: rgba(0, 0, 0, .28); }
.ab-select option { color: var(--text); background: #14111e; }
.ab-select:focus-visible { border-color: var(--acc); outline: none; box-shadow: 0 0 0 3px var(--acc-soft); }

.ab-row { display: flex; gap: 14px; flex-wrap: wrap; }
.ab-field--grow { flex: 1 1 260px; }
.ab-field--fmt { flex: 0 1 200px; min-width: 160px; }
.ab-hint { margin: 0; font-size: 13px; color: var(--text-3); min-height: 1.2em; }

.ab-voicestate {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: var(--r-m); font-size: 13.5px; color: var(--text-2);
  background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .3);
}
.ab-voicestate[hidden] { display: none !important; }
.ab-voicestate__ico { display: inline-flex; color: var(--warn); }
.ab-voicestate__ico svg { width: 20px; height: 20px; }
.ab-voicestate .btn { min-height: 40px; margin-left: auto; }

.ab-go { align-self: flex-start; justify-content: center; min-height: 48px; font-size: 15px; }
.ab-go svg { width: 19px; height: 19px; }
.ab-go:disabled { opacity: .55; cursor: progress; transform: none; box-shadow: none; }
.ab-status { margin: 0; min-height: 1.4em; font-size: 14px; color: var(--text-2); }
.ab-status.is-ok { color: var(--ok); }
.ab-status.is-err { color: var(--err); }
.ab-status.is-busy { color: var(--acc-3); }
.ab-note { margin: 0; font-size: 13px; line-height: 1.6; color: var(--text-3); }

/* ───────────── liste des générations ───────────── */
.ab-jobs { max-width: 760px; }
.ab-joblist { display: grid; gap: 14px; }
.ab-job {
  display: flex; flex-direction: column; gap: 10px; padding: 16px 18px;
  border-radius: var(--r-l); background: var(--glass-2); border: 1px solid var(--stroke);
  box-shadow: var(--shadow-1);
}
.ab-job--err { border-color: rgba(248, 113, 113, .32); }
.ab-job--ok { border-color: rgba(52, 211, 153, .28); }
.ab-job__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ab-job__title {
  font-family: var(--display); font-size: 17px; font-weight: 600; margin: 0; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ab-job__voice { flex-shrink: 0; font-size: 12.5px; color: var(--text-3); }
.ab-job__state { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; }
.ab-job__blocks { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }

.ab-pill {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; border: 1px solid transparent;
}
.ab-pill--wait { background: var(--glass-2); color: var(--text-2); border-color: var(--stroke-lit); }
.ab-pill--run { background: var(--acc-soft); color: #d6c9ff; border-color: rgba(139, 92, 246, .45); }
.ab-pill--ok { background: rgba(52, 211, 153, .13); color: var(--ok); border-color: rgba(52, 211, 153, .35); }
.ab-pill--warn { background: rgba(251, 191, 36, .13); color: var(--warn); border-color: rgba(251, 191, 36, .35); }
.ab-pill--err { background: rgba(248, 113, 113, .13); color: var(--err); border-color: rgba(248, 113, 113, .35); }

.ab-bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.ab-bar i {
  display: block; height: 100%; border-radius: 999px; background: var(--grad-acc);
  box-shadow: 0 0 10px rgba(139, 92, 246, .3); transition: width .6s var(--ease);
}
.ab-job__audio { width: 100%; height: 44px; color-scheme: dark; }
.ab-job__dl, .ab-job__retry { align-self: flex-start; text-decoration: none; }
.ab-job__dl svg, .ab-job__retry svg { width: 18px; height: 18px; }
.ab-job__err { margin: 0; font-size: 13px; color: var(--err); word-break: break-word; }

/* ───────────── mobile ───────────── */
@media (max-width: 640px) {
  .ab-card { padding: 16px; gap: 14px; }
  .ab-seg { display: flex; align-self: stretch; }
  .ab-seg__btn { flex: 1; padding: 0 8px; font-size: 13.5px; line-height: 1.2; }
  .ab-field--fmt { flex: 1 1 100%; }
  .ab-go { align-self: stretch; }
  .ab-job { padding: 14px; }
  .ab-job__top { flex-direction: column; gap: 2px; align-items: flex-start; }
  .ab-job__dl, .ab-job__retry { align-self: stretch; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .ab-bar i { transition: none; }
}
