/* AdinDownloader — dark, clean, platform-neutral */

:root {
  --bg: #070a11;
  --bg-soft: #0b1020;
  --panel: rgba(16, 22, 39, 0.78);
  --panel-solid: #101627;
  --panel-raised: rgba(255, 255, 255, 0.035);
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f2f5ff;
  --muted: #98a3bd;
  --muted-2: #68738e;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --pink: #fb7185;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
  --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: rgba(167, 139, 250, 0.45);
  color: #fff;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  flex: 0 0 auto;
}

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

.is-hidden {
  display: none !important;
}

/* ---------- Background ---------- */

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite alternate;
}

.orb-a {
  width: 640px;
  height: 640px;
  top: -300px;
  left: -180px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.9), transparent 68%);
}

.orb-b {
  width: 560px;
  height: 560px;
  top: 90px;
  right: -260px;
  background: radial-gradient(circle, rgba(8, 145, 178, 0.75), transparent 68%);
  animation-delay: -6s;
}

.orb-c {
  width: 520px;
  height: 520px;
  bottom: -300px;
  left: 38%;
  background: radial-gradient(circle, rgba(219, 39, 119, 0.55), transparent 70%);
  animation-delay: -11s;
}

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
}

/* ---------- Header ---------- */

.site-header {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 26px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #05070c;
  background: linear-gradient(135deg, #67e8f9 0%, #a78bfa 55%, #fda4af 100%);
  box-shadow: 0 12px 34px rgba(139, 92, 246, 0.35);
}

.brand-mark .icon {
  width: 22px;
  height: 22px;
}

.brand-mark.small {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  box-shadow: none;
}

.brand-mark.small .icon {
  width: 16px;
  height: 16px;
}

.brand-text span {
  color: var(--muted);
  font-weight: 500;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: #c7d2e8;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12);
  animation: pulse 2.4s ease-in-out infinite;
}

/* ---------- Page / hero ---------- */

.page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 24px 60px;
}

.hero {
  text-align: center;
  padding: 52px 0 32px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.eyebrow .icon {
  width: 15px;
  height: 15px;
  color: var(--cyan);
}

.hero h1 {
  margin: 22px auto 18px;
  max-width: 920px;
  font-size: clamp(2.6rem, 6.1vw, 4.7rem);
  line-height: 0.99;
  letter-spacing: -0.055em;
  font-weight: 820;
}

.gradient-text {
  background: linear-gradient(100deg, #67e8f9 0%, #a78bfa 45%, #fda4af 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  max-width: 650px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.6vw, 1.08rem);
  line-height: 1.65;
}

/* ---------- Panels ---------- */

.panel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(22, 29, 50, 0.84) 0%, rgba(10, 14, 26, 0.82) 100%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.input-panel {
  padding: 18px;
  margin-top: 8px;
}

.result-panel,
.job-panel {
  margin-top: 18px;
  padding: 22px;
  animation: rise 0.35s ease both;
}

/* ---------- Form ---------- */

.url-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 17px;
  background: rgba(3, 6, 13, 0.72);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.url-field:focus-within {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.08);
}

.url-field.is-tiktok:focus-within {
  border-color: rgba(251, 113, 133, 0.55);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.08);
}

.url-field.is-youtube:focus-within {
  border-color: rgba(248, 113, 113, 0.55);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.08);
}

.url-field.is-threads:focus-within {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.url-platform {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: color 0.2s ease, background 0.2s ease;
}

.url-platform .icon {
  width: 20px;
  height: 20px;
}

.url-platform.is-tiktok {
  color: #fff;
  background: rgba(254, 44, 85, 0.14);
  border-color: rgba(254, 44, 85, 0.22);
}

.url-platform.is-youtube {
  color: #ff4d4d;
  background: rgba(255, 0, 0, 0.1);
  border-color: rgba(255, 0, 0, 0.18);
}

.url-platform.is-threads {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

#url {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  padding: 10px 4px;
}

#url::placeholder {
  color: #5b6681;
}

.paste-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 11px;
  padding: 10px 14px;
  color: #dbe3f5;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.paste-btn .icon {
  width: 17px;
  height: 17px;
}

.paste-btn:hover {
  background: rgba(255, 255, 255, 0.11);
}

.paste-btn:active {
  transform: scale(0.98);
}

.controls {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.mode-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(3, 6, 13, 0.72);
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  color: var(--muted);
  background: transparent;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.mode-btn .icon {
  width: 17px;
  height: 17px;
}

.mode-btn:hover {
  color: #e2e8f6;
}

.mode-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.95), rgba(34, 211, 238, 0.72));
  box-shadow: 0 8px 22px rgba(139, 92, 246, 0.28);
}

.quality-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(3, 6, 13, 0.72);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.quality-field select {
  max-width: 150px;
  padding: 11px 4px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
}

.quality-field select option {
  color: var(--text);
  background: var(--panel-solid);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 14px;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease,
    opacity 0.2s ease;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  color: #06070d;
  background: linear-gradient(135deg, #67e8f9 0%, #a78bfa 55%, #fda4af 100%);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(139, 92, 246, 0.42);
}

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.btn-lg {
  padding: 15px 24px;
  font-size: 0.96rem;
  border-radius: 15px;
}

.resolve-btn {
  margin-left: auto;
  min-width: 152px;
}

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(6, 7, 13, 0.25);
  border-top-color: #06070d;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.resolve-btn.is-loading .spinner {
  display: inline-block;
}

.form-hint {
  margin: 12px 4px 2px;
  color: var(--muted-2);
  font-size: 0.78rem;
}

.form-hint strong {
  color: #cbd5e1;
  font-weight: 650;
}

/* ---------- Notices ---------- */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
  font-size: 0.85rem;
  line-height: 1.5;
}

.notice .icon {
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

.notice.warn {
  border-color: rgba(251, 191, 36, 0.2);
  background: rgba(251, 191, 36, 0.07);
  color: #fcd34d;
}

.notice.error {
  border-color: rgba(248, 113, 113, 0.22);
  background: rgba(248, 113, 113, 0.075);
  color: #fca5a5;
}

.notice.success {
  border-color: rgba(52, 211, 153, 0.2);
  background: rgba(52, 211, 153, 0.07);
  color: #6ee7b7;
}

/* ---------- Platform badge ---------- */

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 0.69rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  color: #e2e8f0;
}

.platform-badge .icon {
  width: 13px;
  height: 13px;
}

.platform-badge.platform-tiktok {
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border-color: rgba(254, 44, 85, 0.35);
}

.platform-badge.platform-youtube {
  color: #ffd7d7;
  background: rgba(255, 0, 0, 0.18);
  border-color: rgba(255, 70, 70, 0.28);
}

.platform-badge.platform-threads {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.18);
}

/* ---------- Result: single ---------- */

.media-card {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.media-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 17px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background:
    radial-gradient(circle at 30% 20%, rgba(167, 139, 250, 0.35), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(34, 211, 238, 0.22), transparent 60%),
    #0b1020;
}

.media-thumb img,
.playlist-cover img,
.row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.25s ease;
}

.media-thumb img.is-broken,
.playlist-cover img.is-broken,
.row-thumb img.is-broken {
  opacity: 0;
}

.thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.28);
  font-size: 2rem;
  pointer-events: none;
}

.thumb-fallback .icon {
  width: 34px;
  height: 34px;
}

.media-thumb .platform-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  backdrop-filter: blur(8px);
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.play-overlay span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(6, 8, 14, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
}

.play-overlay .icon {
  width: 22px;
  height: 22px;
  margin-left: 2px;
}

.media-kicker {
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.media-body h2,
.playlist-info h2,
.job-head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.7vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
  font-weight: 780;
  overflow-wrap: anywhere;
}

.media-meta,
.playlist-meta,
.job-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.86rem;
}

.meta-sep {
  color: #46506a;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 600;
}

.chip .icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- Result: playlist ---------- */

.playlist-head {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.playlist-cover {
  position: relative;
  width: 168px;
  aspect-ratio: 16 / 10;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background:
    radial-gradient(circle at 20% 20%, rgba(167, 139, 250, 0.3), transparent 60%),
    #0b1020;
}

.playlist-cover .platform-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 2;
}

.playlist-info {
  min-width: 0;
}

.playlist-info h2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.playlist-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.select-all {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #dbe3f5;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.select-all input,
.row-check {
  width: 17px;
  height: 17px;
  accent-color: #67e8f9;
  cursor: pointer;
}

.selected-count {
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.playlist-toolbar .btn {
  margin-left: auto;
}

.playlist-list {
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
  border-top: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.playlist-list::-webkit-scrollbar,
.job-list::-webkit-scrollbar {
  width: 8px;
}

.playlist-list::-webkit-scrollbar-thumb,
.job-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.play-row {
  display: grid;
  grid-template-columns: 20px 28px 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.048);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.16s ease;
}

.play-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.play-row.is-live {
  opacity: 0.5;
}

.play-row.is-live .row-check {
  cursor: not-allowed;
}

.row-index {
  color: #56617b;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.row-thumb {
  position: relative;
  width: 72px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #0b1020;
}

.row-thumb .thumb-fallback .icon {
  width: 17px;
  height: 17px;
}

.row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.row-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.87rem;
  font-weight: 600;
  color: #eef2ff;
}

.row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-size: 0.73rem;
}

.row-duration {
  color: var(--muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.tag.live {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.tag.watermark {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.09);
  border: 1px solid rgba(251, 191, 36, 0.18);
}

.tag.ready {
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.16);
}

/* ---------- Job ---------- */

.job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.job-head-main {
  min-width: 0;
}

.job-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.job-head h2 {
  font-size: clamp(1.25rem, 2.3vw, 1.7rem);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.status-pill.is-queued,
.status-pill.is-pending {
  color: #cbd5e1;
}

.status-pill.is-downloading {
  color: #67e8f9;
  border-color: rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.08);
}

.status-pill.is-processing {
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.25);
  background: rgba(167, 139, 250, 0.08);
}

.status-pill.is-done {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.08);
}

.status-pill.is-error,
.status-pill.is-skipped {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.08);
}

.overall-block {
  margin: 18px 0 4px;
}

.progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.progress-meta strong {
  color: #e2e8f6;
  font-weight: 650;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
}

.progress-track.small {
  height: 6px;
  margin-top: 9px;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee 0%, #a78bfa 55%, #fb7185 100%);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.35);
  transition: width 0.35s ease;
}

.progress-bar.is-done {
  background: linear-gradient(90deg, #34d399, #67e8f9);
}

.progress-bar.is-error {
  background: linear-gradient(90deg, #f87171, #fb923c);
}

.job-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 520px;
  margin-top: 18px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.job-row {
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.022);
}

.job-row-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.job-row-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #e6ebfa;
  font-size: 0.85rem;
  font-weight: 600;
}

.job-row-pct {
  color: var(--muted);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.job-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 1.1em;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 0.72rem;
}

.job-row-meta .error-text {
  color: #fca5a5;
}

.job-row-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 7px;
}

.mini-download {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #06070d;
  background: linear-gradient(135deg, #67e8f9, #a78bfa);
  font-size: 0.72rem;
  font-weight: 750;
  text-decoration: none;
}

.mini-download .icon {
  width: 14px;
  height: 14px;
}

.mini-download:hover {
  filter: brightness(1.06);
}

.job-empty {
  padding: 18px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Features / steps ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.feature {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.022);
}

.feature-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 12px;
  color: #67e8f9;
  background: rgba(34, 211, 238, 0.075);
  border: 1px solid rgba(34, 211, 238, 0.12);
}

.feature:nth-child(2) .feature-icon {
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.14);
}

.feature:nth-child(3) .feature-icon {
  color: #fda4af;
  background: rgba(251, 113, 133, 0.08);
  border-color: rgba(251, 113, 133, 0.14);
}

.feature h3 {
  margin: 0 0 7px;
  font-size: 0.98rem;
  letter-spacing: -0.015em;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.steps {
  margin-top: 46px;
}

.steps h2 {
  margin: 0 0 18px;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  letter-spacing: -0.03em;
}

.steps ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: flex;
  gap: 13px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.018);
}

.steps li > span {
  color: var(--cyan);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  padding-top: 2px;
}

.steps strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(3, 6, 13, 0.45);
}

.footer-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted-2);
  font-size: 0.78rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  color: #cbd5e1;
  font-weight: 650;
}

.footer-inner p {
  margin: 0;
  max-width: 620px;
  text-align: right;
  line-height: 1.55;
}

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(13, 18, 32, 0.96);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  color: #e2e8f6;
  font-size: 0.84rem;
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.toast.is-visible {
  transform: none;
  opacity: 1;
}

.toast .icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--cyan);
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.3);
}

.toast.error .icon {
  color: var(--red);
}

.toast.success {
  border-color: rgba(52, 211, 153, 0.3);
}

.toast.success .icon {
  color: var(--green);
}

.toast.warn .icon {
  color: var(--amber);
}

/* ---------- Animations ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.03);
    opacity: 0.8;
  }
}

@keyframes float {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(24px, 18px, 0) scale(1.06);
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .media-card {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .media-thumb {
    max-width: 520px;
  }

  .feature-grid,
  .steps ol {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    padding: 20px 18px 0;
  }

  .page {
    padding: 0 16px 44px;
  }

  .hero {
    padding: 38px 0 26px;
  }

  .input-panel,
  .result-panel,
  .job-panel {
    padding: 15px;
  }

  .controls {
    align-items: stretch;
  }

  .mode-switch {
    flex: 1 1 auto;
  }

  .mode-btn {
    flex: 1;
    justify-content: center;
  }

  .quality-field {
    flex: 1 1 auto;
    justify-content: space-between;
  }

  .resolve-btn {
    flex: 1 1 100%;
    margin-left: 0;
    padding: 14px 20px;
  }

  .playlist-head {
    align-items: flex-start;
  }

  .playlist-cover {
    width: 120px;
  }

  .playlist-toolbar .btn {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .job-head {
    flex-direction: column;
  }

  .job-actions {
    width: 100%;
  }

  .job-actions .btn {
    flex: 1;
  }

  .play-row {
    grid-template-columns: 20px 60px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .row-index {
    display: none;
  }

  .row-thumb {
    width: 60px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 18px;
  }

  .footer-inner p {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .header-meta {
    display: none;
  }

  .hero h1 {
    font-size: clamp(2.25rem, 12vw, 3rem);
  }

  .paste-btn span {
    display: none;
  }

  .paste-btn {
    padding: 10px 11px;
  }

  .url-platform {
    width: 36px;
    height: 36px;
  }

  .playlist-cover {
    display: none;
  }

  .playlist-toolbar {
    gap: 9px;
  }

  .selected-count {
    margin-left: auto;
  }

  .play-row {
    grid-template-columns: 20px minmax(0, 1fr) auto;
  }

  .row-thumb,
  .row-index {
    display: none;
  }

  .row-duration {
    font-size: 0.7rem;
  }

  .job-row-status {
    display: none;
  }

  .toasts {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
