/* Bouton « Pour le voyage » : anneau de progression autour de l'icône, coche à l'arrivée. */
.dl-btn { gap: 10px; }
.dl-ring { position: relative; width: 28px; height: 28px; flex: none; display: flex; align-items: center; justify-content: center; }
.dl-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.dl-ring circle { fill: none; stroke-width: 3; }
.dl-ring .track { stroke: rgba(255, 255, 255, 0.14); }
/* Circonférence de r = 12,5 : 78,54 ; l'offset est posé par offline.js (transition de 0,6 s). */
.dl-ring .arc { stroke: var(--ink-2); stroke-linecap: round; stroke-dasharray: 78.54; stroke-dashoffset: 78.54; transition: stroke-dashoffset 0.6s ease, stroke 0.3s ease; }
.dl-btn.is-xfer .dl-ring .arc { stroke: var(--accent); }
.dl-btn.is-idle .dl-ring svg { display: none; }
.dl-ring .dl-ico, .dl-ring .dl-pct, .dl-ring .dl-check { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.dl-ring .dl-ico { font-size: 17px; }
.dl-ring .dl-pct { font-size: 9px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dl-ring .dl-check { color: var(--ok); }
.dl-ring .dl-check svg { position: static; width: 18px; height: 18px; transform: none; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.dl-btn:not(.is-idle):not(.is-done) .dl-ico, .dl-btn.is-idle .dl-pct, .dl-btn.is-done .dl-pct, .dl-btn:not(.is-done) .dl-check, .dl-btn.is-done .dl-ico { display: none; }
.dl-btn.is-done .dl-ring .arc { stroke: var(--ok); stroke-dashoffset: 0; }
.dl-btn.is-done .dl-check { animation: dl-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.dl-btn.is-paused .dl-ring .arc { stroke: var(--ink-2); }
.dl-btn.is-live .dl-ring { animation: dl-beat 1.6s ease-in-out infinite; }
@keyframes dl-pop { from { transform: scale(0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dl-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* Pastille de l'onglet Plus : bat tant qu'un transfert tourne. */
.tabs a.has-dot span { position: relative; }
.tabs a.has-dot span::after { content: ""; position: absolute; top: -2px; right: -10px; width: 8px; height: 8px; border-radius: 4px; background: var(--accent); }
.tabs a.has-dot.is-xfer span::after { animation: dl-blink 1.4s ease-in-out infinite; }
@keyframes dl-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Écran Téléchargements */
.dl-storage { margin: 4px 0 14px; }
.dl-storage .bar { height: 6px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.dl-storage .bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.6s ease; }
.dl-storage span { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.dl-banner { padding: 12px 14px; border-radius: var(--radius); background: var(--fill-2); color: var(--ink); font-size: 14px; margin-bottom: 12px; }
.dl-group { font-size: 13px; color: var(--ink-2); margin: 10px 0 4px; font-weight: 600; }
.dl-list { display: flex; flex-direction: column; gap: 8px; }
.dl-row { position: relative; overflow: hidden; border-radius: var(--radius); touch-action: pan-y; }
/* Fond opaque : le bouton « Supprimer » vit sous la rangée et transparaîtrait à travers --fill. */
.dl-row .inner { position: relative; z-index: 1; display: flex; gap: 12px; align-items: center; transition: transform 0.18s ease; background: #1D1E23; padding: 10px; border-radius: var(--radius); }
.dl-row.is-open .inner { transform: translateX(-88px); }
.dl-row .thumb { width: 96px; aspect-ratio: 16 / 9; flex: none; border-radius: 8px; background: #23262F; overflow: hidden; }
.dl-row .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dl-row .t { flex: 1; min-width: 0; }
.dl-row .t b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-row .state { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.dl-row .state.is-err { color: var(--accent); }
.dl-row .bar { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.15); overflow: hidden; margin-top: 6px; }
.dl-row .bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.9s linear; }
.dl-row .bar.is-prep i { background: var(--ink-2); transition-duration: 0.6s; }
.dl-row .bar.is-paused i { background: var(--ink-3); }
.dl-row .act { width: 40px; height: 40px; border-radius: 20px; background: var(--fill-2); display: flex; align-items: center; justify-content: center; flex: none; font-size: 15px; }
.dl-row .act:active { opacity: 0.7; }
.dl-row .swipe-del { position: absolute; top: 0; right: 0; bottom: 0; width: 88px; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; border-radius: 0 var(--radius) var(--radius) 0; }
.dl-foot { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.toast.has-action { display: flex; gap: 14px; align-items: center; }
.toast.has-action button { color: var(--accent); font-weight: 800; }

@media (prefers-reduced-motion: reduce) {
  .dl-btn.is-live .dl-ring, .tabs a.has-dot.is-xfer span::after { animation: none; }
  .dl-btn.is-done .dl-check { animation-duration: 0.01s; }
}
