/**
 * Shared icon + format-row styling for all downloader tools.
 * Each tool keeps its own prefixed classes; these tsf-* hooks sit on top so
 * every tool gets the same icons, spacing and truncation behaviour.
 */

.tsf-i {
  flex-shrink: 0;
  display: block;
}

/* ── Format row: icon badge ──────────────────────────── */
.tsf-badge {
  display: inline-flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  width: 2.9rem;
  min-height: 2.9rem;
  padding: .35rem .3rem !important;
  border-radius: 12px !important;
  font-size: .6rem !important;
  line-height: 1.1;
  text-transform: none !important;
}
.tsf-badge-tier {
  display: block !important;
  margin-top: 0 !important;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  opacity: .95;
}
.tsf-badge[data-kind="image"] { color: #c4b5fd; background: rgba(139, 92, 246, .16); }
.tsf-badge[data-kind="audio"] { color: #6ee7b7; background: rgba(16, 185, 129, .16); }
.tsf-badge[data-kind="video"] { color: #7dd3fc; background: rgba(56, 189, 248, .16); }
.tsf-badge[data-kind="file"]  { color: #cbd5e1; background: rgba(148, 163, 184, .16); }

/* ── Format row: label column (replaces the old inline reset) ── */
.tsf-pick {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tsf-pick-label {
  display: flex !important;
  align-items: center;
  gap: .4rem;
  min-width: 0;
  font-size: .9rem;
  font-weight: 700;
  color: #f1f5f9;
}
.tsf-pick-label > :first-child { min-width: 0; }
/* !important throughout: 48 per-tool stylesheets carry rules like
   `.xx-format span { display: block }` that would otherwise win on specificity. */
.tsf-pick-meta {
  display: block !important;
  margin-top: .18rem !important;
  font-size: .75rem !important;
  font-weight: 600;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tsf-tag {
  display: inline-flex !important;
  margin-top: 0 !important;
  align-items: center;
  gap: .18rem;
  flex-shrink: 0;
  padding: .12rem .42rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, .18);
  border: 1px solid rgba(34, 197, 94, .4);
  color: #86efac;
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* ── Format row: download button ─────────────────────── */
.tsf-dl {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Icons inside the tools' own buttons ─────────────── */
.tsf-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
.tsf-btn > .tsf-i { margin: 0; }

/* Icon-only control: keep an accessible label without showing it. */
.tsf-only .tsf-btn-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.tsf-only {
  padding-left: .5rem !important;
  padding-right: .5rem !important;
}

/* ── Empty preview placeholder ────────────────────────── */
.tsf-empty {
  position: relative;
}
.tsf-empty::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(148, 163, 184, .1), transparent 62%),
    repeating-linear-gradient(135deg, rgba(148, 163, 184, .05) 0 8px, transparent 8px 16px);
  pointer-events: none;
}
.tsf-empty-note {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  color: #64748b;
  text-align: center;
  padding: .8rem;
  pointer-events: none;
}
.tsf-empty-note em {
  display: block !important;
  font-style: normal;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.tsf-btn-text { display: inline !important; margin-top: 0 !important; }

@media (max-width: 560px) {
  /* Row gets tight on phones — the arrow icon carries the meaning. */
  .tsf-dl .tsf-dl-text { display: none; }
  .tsf-dl {
    width: 2.4rem;
    height: 2.4rem;
    padding: 0 !important;
    border-radius: 11px !important;
  }
  .tsf-badge {
    width: 2.5rem;
    min-height: 2.5rem;
  }
  .tsf-pick-label { font-size: .84rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tsf-i { transition: none !important; }
}
