/* ==========================================================================
   Catch — design system
   ========================================================================== */

:root {
  --bg: #06070b;
  --bg-2: #090b11;
  --surface: #0c0e15;
  --surface-2: #11141d;
  --surface-3: #171b26;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f3f5fa;
  --muted: #99a1b6;
  --dim: #646c81;
  --violet: #a78bfa;
  --pink: #f472b6;
  --amber: #fbbf24;
  --cyan: #22d3ee;
  --green: #34d399;
  --red: #fb7185;
  --grad: linear-gradient(118deg, #a78bfa 0%, #f472b6 52%, #fbbf24 100%);
  --grad-soft: linear-gradient(118deg, rgba(167, 139, 250, 0.18), rgba(244, 114, 182, 0.14) 52%, rgba(251, 191, 36, 0.12));
  --shadow: 0 24px 70px -40px rgba(0, 0, 0, 0.9);
  --radius: 26px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 0.85, 0.28, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: rgba(167, 139, 250, 0.35); }

:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.85);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ------------------------------- backdrop ------------------------------- */

.aurora {
  position: fixed;
  inset: -25%;
  z-index: -2;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(76, 29, 149, 0.25), transparent 60%);
}
.aurora span {
  position: absolute;
  display: block;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: drift 26s var(--ease) infinite alternate;
}
.aurora .a1 {
  width: 46vw; height: 46vw; left: -6%; top: -6%;
  background: radial-gradient(circle at 40% 40%, rgba(124, 58, 237, 0.55), transparent 66%);
}
.aurora .a2 {
  width: 42vw; height: 42vw; right: -8%; top: 2%;
  background: radial-gradient(circle at 50% 50%, rgba(219, 39, 119, 0.4), transparent 66%);
  animation-delay: -7s;
}
.aurora .a3 {
  width: 52vw; height: 42vw; left: 22%; bottom: -22%;
  background: radial-gradient(circle at 50% 50%, rgba(14, 116, 144, 0.32), transparent 68%);
  animation-delay: -14s;
}
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(3vw, 4vh, 0) scale(1.08); }
  100% { transform: translate3d(-3vw, -2vh, 0) scale(0.96); }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 65% at 50% -10%, rgba(255, 255, 255, 0.045), transparent 60%),
    linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.5));
}

/* -------------------------------- layout -------------------------------- */

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--grad);
  box-shadow: 0 8px 24px -10px rgba(244, 114, 182, 0.7);
}
.brand-mark svg {
  width: 18px; height: 18px;
  fill: none; stroke: #100b1a; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.brand-name { font-size: 19px; font-weight: 650; }
.brand-pill {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.03);
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

.runtime {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.028);
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
}
.runtime-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.12);
  flex: none;
}
.runtime.ok .runtime-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.13); }
.runtime.err .runtime-dot { background: var(--red); box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.15); }

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

.hero {
  position: relative;
  padding: 58px 0 44px;
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.028);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  animation: rise 0.7s var(--ease) both;
}
.eyebrow-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.8);
}

h1 {
  margin: 22px 0 0;
  font-size: clamp(40px, 6.2vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 680;
  animation: rise 0.8s 0.05s var(--ease) both;
}
h1 .accent {
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.03em;
  padding-right: 0.06em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 560px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.65;
  animation: rise 0.8s 0.12s var(--ease) both;
}

.url-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(740px, 100%);
  margin: 30px auto 0;
  padding: 8px 8px 8px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)) padding-box,
    linear-gradient(120deg, rgba(167, 139, 250, 0.35), rgba(244, 114, 182, 0.22), rgba(251, 191, 36, 0.18)) border-box;
  box-shadow: 0 18px 50px -28px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  backdrop-filter: blur(18px);
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
  animation: rise 0.8s 0.18s var(--ease) both;
}
.url-bar:focus-within {
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.12), 0 26px 70px -30px rgba(167, 139, 250, 0.45);
  transform: translateY(-1px);
}
.url-icon { display: grid; place-items: center; color: var(--dim); transition: color 0.25s; }
.url-bar:focus-within .url-icon { color: var(--violet); }
/* Brand mark in the link field once a known site is pasted. Brand colors live
   in glass.css, after the theme's own .url-icon rules so they win. */
.url-icon.brand .ic { width: 20px; height: 20px; fill: currentColor; stroke: none; }

.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 190px;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 600;
}
.source-chip[hidden] { display: none; }
.source-chip .source-ic { width: 14px; height: 14px; fill: currentColor; stroke: none; flex: none; }
.source-chip #previewSourceName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-chip::after { content: "·"; margin-left: 3px; color: var(--dim); font-weight: 400; flex: none; }
.source-chip[data-source="youtube"] .source-ic { color: #ff4d45; }
.source-chip[data-source="pinterest"] .source-ic { color: #ff2d55; }
.source-chip[data-source="tiktok"] .source-ic { color: #25f4ee; }
.source-chip[data-source="instagram"] .source-ic { color: #e1306c; }
.source-chip[data-source="x"] .source-ic { color: #fff; }
.source-chip[data-source="facebook"] .source-ic { color: #1877f2; }
.source-chip[data-source="vimeo"] .source-ic { color: #1ab7ea; }
.source-chip[data-source="twitch"] .source-ic { color: #9146ff; }
.source-chip[data-source="reddit"] .source-ic { color: #ff4500; }
.source-chip[data-source="spotify"] .source-ic { color: #1ed760; }
.source-chip[data-source="soundcloud"] .source-ic { color: #ff5500; }

.url-bar input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.url-bar input::placeholder { color: var(--dim); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }
.paste-btn { color: var(--dim); }

.fetch-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 118px;
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: var(--grad);
  color: #170f24;
  font-weight: 650;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 30px -14px rgba(244, 114, 182, 0.6);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s;
}
.fetch-btn:hover { transform: translateY(-1px); box-shadow: 0 18px 40px -16px rgba(244, 114, 182, 0.75); filter: brightness(1.03); }
.fetch-btn:active { transform: scale(0.98); }
.fetch-btn .fetch-arrow { width: 16px; height: 16px; stroke-width: 2.2; }
.fetch-btn.busy .fetch-label,
.fetch-btn.busy .fetch-arrow { visibility: hidden; }
.fetch-btn.busy .fetch-spinner { display: block; }
.fetch-spinner {
  display: none;
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid rgba(23, 15, 36, 0.25);
  border-top-color: #170f24;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.feature-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
  animation: rise 0.8s 0.24s var(--ease) both;
}
.feature {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--dim);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.feature .ic { width: 13px; height: 13px; opacity: 0.8; }
.feature:hover { color: var(--muted); border-color: var(--line); background: rgba(255, 255, 255, 0.02); }
.feature.hint { color: rgba(167, 139, 250, 0.62); }

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

/* ------------------------------ workspace ------------------------------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(330px, 1fr);
  gap: 22px;
  align-items: start;
  padding-bottom: 20px;
}
.main-col { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.side-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.012)) padding-box,
    rgba(7, 8, 13, 0.55);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120% 80% at 50% -20%, rgba(255, 255, 255, 0.06), transparent 55%);
}

.label {
  display: inline-block;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

/* --------------------------------- alert -------------------------------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border: 1px solid rgba(251, 113, 133, 0.24);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(251, 113, 133, 0.09), rgba(251, 113, 133, 0.035));
  animation: rise 0.35s var(--ease) both;
}
.alert-icon { color: var(--red); margin-top: 1px; }
.alert-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alert-body strong { font-size: 13px; font-weight: 620; }
.alert-body span { color: #e7b3bc; font-size: 12.5px; line-height: 1.55; }

/* ------------------------------- start card ----------------------------- */

.start-card { padding: 24px; animation: rise 0.5s var(--ease) both; }
.start-head h3 {
  margin: 4px 0 0;
  font-size: 17px;
  letter-spacing: -0.025em;
  font-weight: 620;
}
.start-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 16px;
}
.start-step {
  display: flex;
  gap: 11px;
  padding: 14px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012));
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease);
}
.start-step:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.04); transform: translateY(-1px); }
.step-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 23px;
  line-height: 1;
  letter-spacing: -0.04em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  flex: none;
}
.start-step h4 { margin: 0; font-size: 12.5px; font-weight: 620; letter-spacing: -0.01em; }
.start-step p { margin: 4px 0 0; font-size: 10.8px; line-height: 1.55; color: var(--dim); }
.start-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.fmt-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.fmt-chips span {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.start-note { margin-left: auto; font-size: 10px; color: var(--dim); }

/* -------------------------------- preview ------------------------------- */

.preview {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  padding: 14px;
  overflow: hidden;
  align-items: center;
  animation: rise 0.45s var(--ease) both;
}
.preview-media {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 0;
  border-radius: 16px;
  background: #05060a;
  overflow: hidden;
}
.preview-media img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease), filter 0.5s;
}
.preview-media.portrait::before {
  content: "";
  position: absolute;
  inset: -24px;
  background-image: var(--thumb);
  background-size: cover;
  background-position: center;
  filter: blur(26px) saturate(1.25) brightness(0.55);
  transform: scale(1.1);
}
.preview-media.portrait img { object-fit: contain; }
.preview-media.empty {
  background:
    radial-gradient(120% 120% at 15% 10%, rgba(167, 139, 250, 0.34), transparent 58%),
    radial-gradient(100% 100% at 90% 90%, rgba(251, 191, 36, 0.2), transparent 58%),
    linear-gradient(135deg, #171126, #0b0912);
}
.preview:hover .preview-media img { transform: scale(1.035); }
.preview-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06) 40%, rgba(6, 7, 11, 0.7));
}
.preview-badges {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  background: rgba(5, 6, 10, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge.mono { font-variant-numeric: tabular-nums; }
.preview-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  background: rgba(10, 11, 16, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s, transform 0.3s var(--ease), background 0.3s;
}
.preview-play .ic { width: 20px; height: 20px; fill: #fff; stroke: none; margin-left: 2px; }
.preview:hover .preview-play { opacity: 1; transform: scale(1); }
.preview-play:hover { background: rgba(167, 139, 250, 0.35); }
@media (hover: none) {
  .preview-play { opacity: 1; transform: scale(1); }
}

/* Inline playback: the player sits exactly where the thumbnail was. */
.preview-player {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #000;
}
.preview-player iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.player-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: rgba(8, 9, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: var(--text);
  transition: background 0.2s, transform 0.2s var(--ease);
}
.player-close:hover { background: rgba(167, 139, 250, 0.4); transform: scale(1.05); }
.player-close .ic { width: 16px; height: 16px; stroke-width: 2.2; }

.preview-body {
  padding: 6px 10px 6px 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.preview-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}
#previewChannel {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px; height: 20px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--grad);
  color: #160f22;
  font-size: 10px;
  font-weight: 750;
}
.preview h2 {
  margin: 9px 0 0;
  font-size: 19px;
  line-height: 1.32;
  letter-spacing: -0.022em;
  font-weight: 640;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.preview-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 9px;
  color: var(--dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.preview-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--dim); }
.preview-desc {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.preview-links { display: flex; gap: 8px; margin-top: auto; padding-top: 14px; }

/* -------------------------------- skeleton ------------------------------ */

.skeleton-card {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  overflow: hidden;
  animation: rise 0.3s var(--ease) both;
}
.sk-thumb { min-height: 190px; border-radius: 0; }
.sk-body { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.sk-line { height: 12px; border-radius: 6px; }
.sk-line.w40 { width: 42%; height: 10px; }
.sk-line.w90 { width: 92%; height: 20px; }
.sk-line.w60 { width: 64%; }
.sk-chips { display: flex; gap: 10px; margin-top: auto; }
.sk-chips i { width: 86px; height: 46px; border-radius: 12px; }

.shimmer {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}
.shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.07) 45%, transparent 70%);
  animation: sweep 1.6s infinite;
}
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* -------------------------------- options ------------------------------- */

.options { padding: 24px 24px 20px; animation: rise 0.5s 0.05s var(--ease) both; }

.format-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.format-head h3 {
  margin: 4px 0 0;
  font-size: 17px;
  letter-spacing: -0.02em;
  font-weight: 620;
}

.segmented {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
}
.seg-thumb {
  position: absolute;
  top: 4px; left: 4px;
  width: calc(50% - 5px);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(167, 139, 250, 0.3), rgba(244, 114, 182, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 18px -8px rgba(167, 139, 250, 0.6);
  transition: transform 0.38s var(--ease);
}
.segmented.audio .seg-thumb { transform: translateX(calc(100% + 2px)); }
.seg-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font-size: 12.5px;
  font-weight: 600;
  transition: color 0.25s;
}
.seg-btn.active { color: var(--text); }
.seg-btn .ic { width: 15px; height: 15px; }

.panel { margin-top: 18px; animation: fade 0.35s var(--ease) both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.section-hint { font-size: 11px; font-weight: 400; color: var(--dim); }

.quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 8px;
}
.quality {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 12px 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease), color 0.2s;
}
.quality:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.045); transform: translateY(-1px); color: var(--text); }
.quality .q-top { display: flex; align-items: center; gap: 5px; }
.quality .q-name {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.quality .q-tag {
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.06em;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(251, 191, 36, 0.16);
  color: var(--amber);
  text-transform: uppercase;
}
.quality .q-meta { font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quality .q-check {
  position: absolute;
  top: 8px; right: 8px;
  width: 14px; height: 14px;
  opacity: 0;
  color: var(--violet);
  transition: opacity 0.2s, transform 0.2s var(--ease);
  transform: scale(0.7);
}
.quality .q-check .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.quality.selected {
  color: var(--text);
  border-color: transparent;
  background:
    linear-gradient(180deg, #1c1531, #151021) padding-box,
    var(--grad) border-box;
  box-shadow: 0 8px 26px -18px rgba(167, 139, 250, 0.9);
}
.quality.selected .q-check { opacity: 1; transform: scale(1); }
.quality.selected .q-check .ic { width: 14px; height: 14px; stroke-width: 2.6; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: 11px; color: var(--dim); font-weight: 550; letter-spacing: 0.02em; }
.field.grow { flex: 1; }

.select-wrap { position: relative; }
.select-wrap select,
.text-input {
  width: 100%;
  height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.text-input { padding-right: 12px; }
.select-wrap select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.select-wrap select:hover, .text-input:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); }
.select-wrap select:focus, .text-input:focus { border-color: rgba(167, 139, 250, 0.55); box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1); }
.select-chevron {
  position: absolute;
  right: 11px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--dim);
  pointer-events: none;
}
.select-wrap.compact select { height: 36px; font-size: 12px; min-width: 160px; }
.text-input.mono { font-family: var(--mono); font-size: 12px; }
.text-input::placeholder { color: var(--dim); }

/* audio formats */
.audio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.audio-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.audio-opt:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.045); transform: translateY(-1px); }
.audio-opt .a-icon {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  flex: none;
}
.audio-opt .a-icon .ic { width: 15px; height: 15px; }
.audio-opt .a-copy { min-width: 0; display: flex; flex-direction: column; }
.audio-opt strong { font-size: 12.5px; font-weight: 620; letter-spacing: -0.01em; }
.audio-opt small { font-size: 10px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audio-opt.selected {
  border-color: transparent;
  background:
    linear-gradient(180deg, #1c1531, #151021) padding-box,
    var(--grad) border-box;
}
.audio-opt.selected .a-icon { background: rgba(167, 139, 250, 0.18); color: var(--violet); }

.bitrate-row { display: flex; gap: 7px; flex-wrap: wrap; }
.pill {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  transition: all 0.2s var(--ease);
}
.pill:hover { border-color: var(--line-strong); color: var(--text); }
.pill.active {
  border-color: rgba(167, 139, 250, 0.6);
  background: rgba(167, 139, 250, 0.16);
  color: #d9ccff;
}

/* ------------------------------- playlist ------------------------------- */

.playlist-block {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.055), rgba(255, 255, 255, 0.015));
}

/* --------------------------------- trim --------------------------------- */

.track-block { margin-top: 16px; max-width: 340px; }

.trim-block {
  margin-top: 18px;
  padding: 15px 16px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.25s, background 0.25s;
}
.trim-block.active { border-color: rgba(167, 139, 250, 0.34); background: rgba(167, 139, 250, 0.05); }
.trim-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.trim-head h4 { margin: 3px 0 0; font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; }
.trim-side { display: flex; align-items: center; gap: 8px; }
.trim-range {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.trim-block.active .trim-range { color: var(--violet); }
.trim-side .ghost-btn { height: 26px; padding: 0 9px; font-size: 11px; }
.trim-side .ghost-btn:disabled { opacity: 0.35; cursor: default; }

.trim-bar { position: relative; height: 34px; margin-top: 10px; }
.trim-track,
.trim-fill {
  position: absolute;
  top: 50%;
  height: 6px;
  margin-top: -3px;
  border-radius: 999px;
}
.trim-track { left: 0; right: 0; background: rgba(255, 255, 255, 0.08); }
.trim-fill {
  left: 0;
  right: 0;
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.9), rgba(244, 114, 182, 0.9));
  box-shadow: 0 0 18px -6px rgba(167, 139, 250, 0.9);
}

.trim-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 34px;
  margin: 0;
  background: none;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none; /* the thumbs opt back in */
}
.trim-input::-webkit-slider-runnable-track {
  height: 34px;
  background: transparent;
  border: 0;
}
.trim-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  margin-top: 8.5px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #0a0b10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  cursor: grab;
}
.trim-input::-webkit-slider-thumb:active { cursor: grabbing; }
.trim-input::-moz-range-track { height: 34px; background: transparent; border: 0; }
.trim-input::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #0a0b10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  cursor: grab;
}
.trim-input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.45); }
.trim-input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.45); }

.trim-scale {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.trim-len { color: var(--violet); }
.playlist-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.playlist-head h4 { margin: 3px 0 0; font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; }
.playlist-items-wrap { margin-top: 12px; }
.hint { margin: 6px 0 0; font-size: 10.5px; color: var(--dim); }
.pl-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 13px;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.pl-strip::-webkit-scrollbar { display: none; }
.pl-item {
  flex: none;
  width: 104px;
  border-radius: 9px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
}
.pl-item img, .pl-item .pl-ph { width: 100%; height: 58px; object-fit: cover; }
.pl-ph { display: grid; place-items: center; color: var(--dim); background: linear-gradient(135deg, #191328, #120f1c); }
.pl-item span { display: block; padding: 5px 6px 6px; font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* -------------------------------- extras -------------------------------- */

.extras-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 22px 0 10px;
}
.extras-head h3 { margin: 0; font-size: 13px; font-weight: 620; letter-spacing: -0.01em; }
.extras-head span { font-size: 10.5px; color: var(--dim); }

.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.toggle-row, .inline-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.022);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.toggle-row:hover, .inline-field:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.04); }
.toggle-row:has(input:checked) { border-color: rgba(167, 139, 250, 0.28); background: linear-gradient(180deg, rgba(167, 139, 250, 0.07), rgba(255, 255, 255, 0.015)); }
.toggle-icon {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  flex: none;
  transition: color 0.2s, background 0.2s;
}
.toggle-icon .ic { width: 15px; height: 15px; }
.toggle-row:has(input:checked) .toggle-icon { color: var(--violet); background: rgba(167, 139, 250, 0.14); }
.toggle-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.toggle-copy strong { font-size: 12px; font-weight: 600; letter-spacing: -0.005em; }
.toggle-copy small { font-size: 10px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.toggle-row input, .mini-check input, .switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch { display: inline-flex; align-items: center; position: relative; flex: none; cursor: pointer; }
.switch-track {
  position: relative;
  display: inline-block;
  width: 36px; height: 21px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex: none;
  transition: background 0.25s var(--ease);
}
.switch-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #cfd4e2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s var(--ease), background 0.25s;
}
input:checked + .switch-track { background: linear-gradient(120deg, #8b5cf6, #ec4899); }
input:checked + .switch-track .switch-knob { transform: translateX(15px); background: #fff; }
.toggle-row:active .switch-knob, .switch:active .switch-knob { width: 17px; }

.sub-panel {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 2px;
  transition: max-height 0.4s var(--ease), opacity 0.3s, padding 0.3s;
}
.sub-panel.open { max-height: 160px; opacity: 1; padding: 12px 2px 2px; }

.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  padding-bottom: 9px;
  position: relative;
}
.check-box {
  display: grid; place-items: center;
  width: 17px; height: 17px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  color: transparent;
  transition: all 0.2s;
}
.check-box .ic { width: 11px; height: 11px; stroke-width: 3; }
.mini-check input:checked + .check-box { background: var(--grad); border-color: transparent; color: #1a1026; }

.inline-field { margin-top: 8px; }
.inline-field .select-wrap { flex: none; margin-left: auto; }
.inline-field .toggle-copy { flex: 1; }

/* ------------------------------- advanced ------------------------------- */

.advanced {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.018);
  overflow: hidden;
}
.advanced summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.advanced summary::-webkit-details-marker { display: none; }
.adv-icon { color: var(--dim); display: grid; place-items: center; }
.adv-title { font-size: 12.5px; font-weight: 600; }
.adv-hint { font-size: 10.5px; color: var(--dim); margin-left: 2px; }
.adv-chevron { margin-left: auto; color: var(--dim); transition: transform 0.3s var(--ease); }
.advanced[open] .adv-chevron { transform: rotate(180deg); }
.adv-body { padding: 0 14px 14px; animation: fade 0.3s var(--ease) both; }
.adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.adv-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.adv-foot .mini-check { padding-bottom: 0; }
.adv-note { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--dim); }
.adv-note .ic { width: 13px; height: 13px; }

/* -------------------------------- dl bar -------------------------------- */

.dl-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.dl-summary { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dl-title { font-size: 13.5px; font-weight: 620; letter-spacing: -0.01em; }
.dl-sub { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 48px;
  padding: 0 26px;
  border: 0;
  border-radius: 14px;
  background: var(--grad);
  color: #170f24;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 14px 34px -16px rgba(244, 114, 182, 0.65);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s;
  white-space: nowrap;
}
.primary-btn .ic { width: 17px; height: 17px; stroke-width: 2.1; }
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 20px 44px -18px rgba(244, 114, 182, 0.8); filter: brightness(1.03); }
.primary-btn:active { transform: scale(0.985); }
.primary-btn:disabled { opacity: 0.55; filter: saturate(0.4); cursor: not-allowed; transform: none; }
.primary-btn.busy .ic { animation: spin 0.9s linear infinite; }

/* --------------------------------- queue -------------------------------- */

.queue {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  padding: 20px 18px 16px;
  overflow: hidden;
}
.queue-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.queue-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 0 0;
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.02em;
}
.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.queue-head .icon-btn { width: 30px; height: 30px; }

.queue-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 34px 18px 30px;
  margin: 14px 0 6px;
  border: 1px dashed rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: radial-gradient(100% 100% at 50% 0%, rgba(167, 139, 250, 0.05), transparent 70%);
}
.empty-art { width: 122px; opacity: 0.9; margin-bottom: 10px; }
.empty-art svg { width: 100%; height: auto; overflow: visible; }
.queue-empty p { margin: 0; display: flex; flex-direction: column; gap: 3px; }
.queue-empty strong { font-size: 12.5px; font-weight: 600; }
.queue-empty span { font-size: 11px; color: var(--dim); }

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px -4px 8px;
  padding: 0 4px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}
.queue-list::-webkit-scrollbar, .pl-strip::-webkit-scrollbar { width: 6px; height: 6px; }
.queue-list::-webkit-scrollbar-thumb, .pl-strip::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 99px; }
.queue-list::-webkit-scrollbar-track, .pl-strip::-webkit-scrollbar-track { background: transparent; }

.job {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.022);
  animation: jobIn 0.35s var(--ease) both;
  transition: border-color 0.25s, background 0.25s;
}
.job:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.04); }
@keyframes jobIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.job-thumb {
  position: relative;
  width: 80px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1430, #100d19);
  flex: none;
}
.job-thumb img { width: 100%; height: 100%; object-fit: cover; }
.job-thumb .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(167, 139, 250, 0.55);
  background: radial-gradient(80% 80% at 30% 20%, rgba(167, 139, 250, 0.16), transparent 70%);
}
.job-dur {
  position: absolute;
  right: 4px; bottom: 4px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
  color: #e5e8f2;
}
.job-body { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.job-head { display: flex; align-items: flex-start; gap: 6px; }
.job-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 570;
  line-height: 1.35;
  letter-spacing: -0.008em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.job-actions { display: flex; gap: 1px; flex: none; opacity: 0; transition: opacity 0.2s; }
.job:hover .job-actions, .job:focus-within .job-actions { opacity: 1; }
.job-actions .icon-btn { width: 22px; height: 22px; border-radius: 6px; }
.job-actions .ic { width: 13px; height: 13px; }
.job-actions .icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
.job-actions .danger:hover { color: var(--red); background: rgba(251, 113, 133, 0.12); }

.job-meta { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 10px; color: var(--dim); }
.job-state { display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--muted); font-weight: 550; }
.job-state i { width: 5px; height: 5px; border-radius: 50%; background: var(--dim); }
.job-meta .job-detail {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.job[data-status="downloading"] .job-state i,
.job[data-status="processing"] .job-state i { background: var(--violet); box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.13); animation: pulse 1.4s infinite; }
.job[data-status="completed"] .job-state i { background: var(--green); }
.job[data-status="error"] .job-state i { background: var(--red); }
.job[data-status="canceled"] .job-state i { background: var(--dim); }
.job[data-status="error"] .job-title { color: #f3c2c8; }
@keyframes pulse { 50% { opacity: 0.35; } }

.job-bar {
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  margin-top: 1px;
  opacity: 0;
  transition: opacity 0.25s;
}
.job-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--grad);
  transition: width 0.5s var(--ease);
}
.job[data-status="downloading"] .job-bar,
.job[data-status="processing"] .job-bar,
.job[data-status="queued"] .job-bar { opacity: 1; }
.job[data-status="processing"] .job-bar i { width: 100% !important; animation: shimmerBar 1.4s infinite; background-size: 200% 100%; }
.job[data-status="queued"] .job-bar i { width: 12% !important; animation: pulse 1.4s infinite; }
@keyframes shimmerBar { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }

.queue-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.foot-stats { display: flex; gap: 16px; }
.foot-stat { display: flex; flex-direction: column; gap: 0; }
.foot-stat span { font-size: 12px; font-weight: 620; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.foot-stat small { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); }

/* -------------------------------- tip card ------------------------------ */

.tip-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(167, 139, 250, 0.1), transparent 60%),
    rgba(255, 255, 255, 0.018);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.tip-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.24), rgba(244, 114, 182, 0.14));
  border: 1px solid rgba(167, 139, 250, 0.18);
  color: var(--violet);
}
.tip-icon .ic { width: 15px; height: 15px; }
.tip-copy { flex: 1; min-width: 0; }
.tip-copy strong { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: -0.005em; }
.tip-copy span { display: block; margin-top: 2px; font-size: 10.5px; line-height: 1.55; color: var(--dim); }
.tip-copy code {
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}
.tip-card .icon-btn { flex: none; width: 26px; height: 26px; margin-top: -2px; }
.tip-card .icon-btn .ic { width: 14px; height: 14px; }

/* ------------------------------- buttons -------------------------------- */

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  transition: all 0.2s var(--ease);
}
.ghost-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); transform: translateY(-1px); }
.ghost-btn .ic { width: 14px; height: 14px; }
.ghost-btn.sm { height: 32px; padding: 0 11px; font-size: 11.5px; border-radius: 9px; }

/* --------------------------------- modal -------------------------------- */

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 4, 7, 0.7); backdrop-filter: blur(8px); animation: fade 0.25s both; }
.modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: linear-gradient(180deg, #14121d, #0b0c12);
  box-shadow: 0 40px 100px -30px #000;
  animation: pop 0.3s var(--ease) both;
  overflow: hidden;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 4px 0 0; font-size: 16px; letter-spacing: -0.02em; font-weight: 620; }
.files-list { padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.file-row:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--line); }
.file-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(167, 139, 250, 0.1); color: var(--violet); flex: none; }
.file-name { flex: 1; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.file-row .icon-btn { width: 28px; height: 28px; }

/* Local player — plays the downloaded file straight from disk. */
.player-card { width: min(900px, 100%); }
.player-stage { display: grid; place-items: center; background: #000; }
.player-stage video { display: block; width: 100%; max-height: 72vh; background: #000; }

/* --------------------------------- toasts ------------------------------- */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 40px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: rgba(16, 18, 27, 0.94);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 44px -20px rgba(0, 0, 0, 0.9);
  font-size: 12px;
  line-height: 1.45;
  animation: toastIn 0.35s var(--ease) both;
  pointer-events: auto;
}
.toast.out { animation: toastOut 0.3s var(--ease) both; }
.toast .t-ic { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: rgba(167, 139, 250, 0.14); color: var(--violet); }
.toast.success .t-ic { background: rgba(52, 211, 153, 0.13); color: var(--green); }
.toast.error .t-ic { background: rgba(251, 113, 133, 0.13); color: var(--red); }
.toast strong { display: block; font-weight: 620; margin-bottom: 1px; }
.toast span { color: var(--muted); }
.toast .ic { width: 13px; height: 13px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(0.98); } }

/* ------------------------------ drop overlay ---------------------------- */

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  place-items: center;
  background: rgba(4, 5, 9, 0.72);
  backdrop-filter: blur(10px);
}
.drop-overlay.show { display: grid; animation: fade 0.2s both; }
.drop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 42px 54px;
  border: 1.5px dashed rgba(167, 139, 250, 0.55);
  border-radius: 24px;
  background: rgba(167, 139, 250, 0.05);
  text-align: center;
}
.drop-card .ic { width: 32px; height: 32px; color: var(--violet); margin-bottom: 4px; }
.drop-card strong { font-size: 18px; letter-spacing: -0.02em; }
.drop-card span { font-size: 12px; color: var(--muted); }

/* --------------------------------- footer ------------------------------- */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 26px 2px 40px;
  color: var(--dim);
  font-size: 11px;
  border-top: 1px solid var(--line);
  margin-top: 26px;
}
.footer-left, .footer-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brand-mini { color: var(--muted); font-weight: 650; letter-spacing: -0.01em; }
.footer a { color: var(--muted); transition: color 0.2s; }
.footer a:hover { color: var(--text); }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--dim); opacity: 0.7; }

/* ------------------------------- responsive ----------------------------- */

@media (max-width: 1080px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 340px; }
  .preview { grid-template-columns: 260px minmax(0, 1fr); }
  .skeleton-card { grid-template-columns: 260px minmax(0, 1fr); }
  .quality-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .queue { position: static; max-height: none; }
  .queue-list { max-height: 420px; }
  .preview { grid-template-columns: 240px minmax(0, 1fr); }
  .skeleton-card { grid-template-columns: 240px minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 38px 0 30px; }
  h1 { font-size: clamp(36px, 11vw, 52px); }
  .lede { font-size: 14px; }
  .url-bar { padding: 7px 7px 7px 14px; gap: 6px; border-radius: 17px; }
  .url-bar input { height: 44px; font-size: 14px; }
  .fetch-btn { min-width: 92px; height: 44px; padding: 0 14px; }
  .fetch-btn .fetch-arrow { display: none; }
  .paste-btn { display: none; }
  .runtime { display: none; }
  .preview { grid-template-columns: 1fr; gap: 12px; padding: 12px; }
  .preview-media { aspect-ratio: 16 / 9; min-height: 0; }
  .preview-body { padding: 4px 6px 8px; }
  .skeleton-card { grid-template-columns: 1fr; }
  .start-card { padding: 18px 16px; }
  .start-grid { grid-template-columns: 1fr; }
  .start-note { margin-left: 0; }
  .sk-thumb { min-height: 180px; }
  .options { padding: 18px 16px 16px; }
  .format-head { align-items: stretch; }
  .segmented { width: 100%; }
  .quality-grid { grid-template-columns: repeat(2, 1fr); }
  .audio-grid { grid-template-columns: repeat(2, 1fr); }
  .toggles { grid-template-columns: 1fr; }
  .two-col, .adv-grid { grid-template-columns: 1fr; }
  .dl-bar { flex-direction: column; align-items: stretch; }
  .primary-btn { width: 100%; }
  .queue { padding: 16px 14px 14px; }
  .hide-sm { display: none; }
  .feature.hint { display: none; }
  .footer { justify-content: flex-start; }
}

@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;
  }
}
