/* === Downloader — exact 1:1 replica of SUNOOCEP.com/tools/downloader/ === */

.dl-page main { padding-bottom: 64px; position: relative; }
.dl-queue-manager-note {
  max-width: var(--max);
  margin: 20px auto 0;
  padding: 0 20px;
  color: var(--text-muted);
  font-size: 0.86rem;
  text-align: center;
}
.downloader-language {
  position: relative;
  display: inline-flex;
}
.downloader-language summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  list-style: none;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}
.downloader-language summary::-webkit-details-marker { display: none; }
.downloader-language summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.18s ease;
}
.downloader-language summary:hover,
.downloader-language[open] summary {
  color: var(--heading);
  border-color: rgba(var(--overlay-rgb), 0.22);
  background: var(--control-hover);
}
.downloader-language[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}
.downloader-language summary:focus-visible,
.downloader-language__menu a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.downloader-language__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 148px;
  padding: 6px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--control-bg);
  box-shadow: var(--soft-shadow);
  backdrop-filter: var(--glass-blur);
  z-index: 250;
}
.downloader-language__menu a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.downloader-language__menu a:hover,
.downloader-language__menu a[aria-current="page"] {
  color: var(--heading);
  background: var(--control-hover);
}

.dl-page main::before {
  content: "";
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, 92vw);
  height: 460px;
  background: radial-gradient(closest-side, rgba(var(--overlay-rgb), 0.05), transparent 72%);
  pointer-events: none;
  z-index: 0;
}
.dl-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  margin: 0 auto;
}

/* === Empty / input stage === */
.dl-stage {
  text-align: center;
  padding: 36px 0 24px;
}
@media (max-width: 560px) {
  .dl-page .container { padding-top: 24px; }
  .dl-page .tools-back { margin-bottom: 12px; }
  .dl-stage { padding-top: 24px; padding-bottom: 18px; }
}
.dl-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.04);
  border: 1px solid rgba(var(--overlay-rgb), 0.12);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.dl-kicker svg { width: 12px; height: 12px; }

.dl-stage h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--heading);
}
.dl-stage .sub {
  margin: 0 auto 22px;
  max-width: 64ch;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.55;
}

.dl-form {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}
.dl-input-wrap {
  background: var(--input-bg);
  border: 1px solid rgba(var(--overlay-rgb), 0.10);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, box-shadow 0.25s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.dl-input-wrap:focus-within {
  border-color: rgba(var(--overlay-rgb), 0.28);
  box-shadow: 0 0 0 4px rgba(var(--overlay-rgb), 0.05), 0 12px 36px rgba(0, 0, 0, 0.4);
}
.dl-form textarea {
  width: 100%;
  padding: 18px 20px 10px;
  background: transparent;
  color: var(--text-main);
  border: none;
  border-radius: 18px 18px 0 0;
  font: 0.95rem/1.5 var(--mono);
  outline: none;
  resize: none;
  min-height: 72px;
  box-sizing: border-box;
  display: block;
}
.dl-form textarea::placeholder {
  color: var(--text-dim);
  font-family: var(--font);
  letter-spacing: 0;
}
.dl-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  padding: 10px 14px 14px;
}

.dl-paste-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 82px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(var(--overlay-rgb), 0.14);
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.045);
  color: var(--text-main);
  font: 700 0.82rem/1 var(--font);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 120ms ease;
}
.dl-paste-btn svg { width: 16px; height: 16px; }
.dl-paste-btn:hover {
  border-color: rgba(var(--overlay-rgb), 0.28);
  background: rgba(var(--overlay-rgb), 0.085);
}
.dl-paste-btn:active { transform: scale(0.985); }
.dl-paste-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.dl-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  min-height: 40px;
  border: 1px solid rgba(var(--overlay-rgb), 0.12);
  border-radius: 999px;
  background: #fafafa;
  color: #09090b;
  font-weight: 700;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.15s ease;
}
.dl-btn-primary:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
html[data-theme="light"] .dl-btn-primary:hover:not(:disabled) {
  border-color: #285f3c;
  background: #2f6f45;
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 20, 28, 0.20);
}
.dl-btn-primary:active { transform: scale(0.985); }
.dl-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.dl-btn-primary .ic { width: 16px; height: 16px; }
.dl-submit-spinner {
  display: none;
  width: 15px;
  height: 15px;
  box-sizing: border-box;
  border: 2px solid rgba(9, 9, 11, 0.28);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: dl-submit-spin 0.7s linear infinite;
}
.dl-btn-primary.is-loading:disabled {
  opacity: 1;
  cursor: progress;
}
.dl-btn-primary.is-loading .ic { display: none; }
.dl-btn-primary.is-loading .dl-submit-spinner { display: inline-block; }
.dl-form.is-loading .dl-input-wrap {
  border-color: rgba(255, 168, 77, 0.42);
  box-shadow: 0 0 0 4px rgba(255, 168, 77, 0.08), 0 12px 36px rgba(0, 0, 0, 0.36);
}
@keyframes dl-submit-spin { to { transform: rotate(360deg); } }
.dl-submit-label-compact { display: none; }

@media (max-width: 560px) {
  .dl-submit-label-wide { display: none; }
  .dl-submit-label-compact { display: inline; }
}

.dl-form-hint {
  margin: 12px 0 0;
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}
.dl-form-hint:empty { display: none; }
.dl-form-hint.err { color: var(--danger-text); }
.dl-form-hint.ok { color: var(--success-text); }

.tool-example {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px 10px;
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 0.76rem;
}
.tool-example a {
  color: var(--text-muted);
  font-family: var(--mono);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.tool-example a:hover {
  color: var(--heading);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tool-example button {
  min-height: 28px;
  padding: 5px 12px;
  border: 1px solid rgba(var(--overlay-rgb), 0.15);
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.055);
  color: var(--text-main);
  font: 700 0.7rem/1 var(--font);
  cursor: pointer;
  transition: all 0.15s ease;
}
.tool-example button:hover {
  border-color: rgba(var(--overlay-rgb), 0.3);
  background: rgba(var(--overlay-rgb), 0.1);
}

/* Policy notice */
.dl-policy-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 680px);
  margin: 14px auto 0;
  padding: 9px 12px 9px 14px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 168, 77, 0.38);
  border-radius: 12px;
  background: rgba(255, 168, 77, 0.07);
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}
.dl-policy-notice__copy {
  flex: 1 1 auto;
  text-align: left;
}
.dl-policy-notice__copy a {
  color: var(--warning-text);
  font-weight: 700;
  text-decoration: none;
}
.dl-policy-notice__copy a:hover { text-decoration: underline; }
.dl-policy-notice__dismiss {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(var(--overlay-rgb), 0.14);
  border-radius: 50%;
  background: rgba(var(--overlay-rgb), 0.04);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}
.dl-policy-notice__dismiss:hover {
  background: rgba(var(--overlay-rgb), 0.1);
  color: var(--heading);
}

.dl-cross-link-top {
  margin: 12px auto 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}
.dl-cross-link-top a {
  color: var(--warning-text);
  font-weight: 700;
}

/* === Song hero card === */
.song-hero {
  --cover-url: none;
  position: relative;
  margin: 28px 0 18px;
  padding: 28px;
  border-radius: 22px;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  background: linear-gradient(180deg, rgba(20,20,24,0.85), rgba(12,12,15,0.92));
  overflow: hidden;
  isolation: isolate;
  scroll-margin-top: calc(var(--nav-h) + 16px);
  animation: heroIn 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.song-hero::before {
  content: "";
  position: absolute;
  inset: -20%;
  background-image: var(--cover-url);
  background-size: cover;
  background-position: center;
  filter: blur(46px) saturate(1.4) brightness(0.85);
  opacity: 0.32;
  z-index: -2;
}
.song-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,12,0.28) 0%, rgba(10,10,12,0.88) 88%);
  z-index: -1;
}

.song-hero-top {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 24px;
  align-items: center;
}
@media (max-width: 560px) {
  .song-hero {
    margin: 16px 0 14px;
    padding: 15px;
    border-radius: 18px;
  }
  .song-hero-top {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    text-align: left;
  }
}
.song-hero-cover {
  width: 168px;
  height: 168px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(0,0,0,0.35);
  box-shadow: 0 20px 50px rgba(0,0,0,0.55), 0 0 0 1px rgba(var(--overlay-rgb), 0.06);
}
@media (max-width: 560px) {
  .song-hero-cover {
    width: 74px;
    height: 74px;
    border-radius: 12px;
  }
}

.song-hero-title {
  margin: 0 0 6px;
  font-size: 1.55rem;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--heading);
}
.song-hero-artist {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.song-hero-artist strong { color: var(--text-main); font-weight: 600; }

.song-hero-meta {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  font-size: 0.84rem;
  color: var(--text-muted);
}
.song-hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.song-hero-meta svg {
  width: 14px;
  height: 14px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.song-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.song-hero-tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  color: var(--code-text);
  background: rgba(var(--overlay-rgb), 0.05);
  border: 1px solid rgba(var(--overlay-rgb), 0.12);
  font-family: var(--mono);
}

.song-hero-actions {
  position: absolute;
  top: 16px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.song-hero-suno,
.song-hero-analyze {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(var(--overlay-rgb), 0.1);
  color: var(--text-muted);
  font-size: 0.74rem;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: all 0.15s ease;
}
.song-hero-suno:hover, .song-hero-analyze:hover {
  color: var(--heading);
  border-color: rgba(var(--overlay-rgb), 0.3);
}
.song-hero-suno svg, .song-hero-analyze svg { width: 12px; height: 12px; }
.song-hero-analyze {
  border-color: rgba(126, 229, 151, 0.24);
  color: var(--success-text);
}

@media (max-width: 560px) {
  .song-hero-actions {
    position: static;
    justify-content: flex-end;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(var(--overlay-rgb), 0.09);
  }
}

/* Skeleton shimmer */
.song-hero.is-loading .song-hero-title,
.song-hero.is-loading .song-hero-artist,
.song-hero.is-loading .song-hero-meta li,
.song-hero.is-loading .song-hero-tag {
  background: linear-gradient(90deg, rgba(var(--overlay-rgb), 0.05), rgba(var(--overlay-rgb), 0.10), rgba(var(--overlay-rgb), 0.05));
  background-size: 200% 100%;
  animation: skelShimmer 1.4s ease-in-out infinite;
  color: transparent !important;
}
.song-hero.is-loading .song-hero-title { height: 28px; border-radius: 8px; }
.song-hero.is-loading .song-hero-artist { height: 18px; width: 60%; border-radius: 6px; }
.song-hero.is-loading .song-hero-meta li { height: 14px; width: 70px; border-radius: 6px; }
.song-hero.is-loading .song-hero-tag { height: 22px; width: 56px; border-radius: 999px; }
@keyframes skelShimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* === Section label === */
.dl-section {
  margin-top: 22px;
}
.dl-section-label {
  margin: 0 4px 10px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-dim);
}

/* === Preview === */
.dl-preview-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dl-audio-wrap {
  padding: 10px 12px;
  background: rgba(var(--overlay-rgb), 0.02);
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  border-radius: 12px;
}
.dl-audio-wrap audio {
  width: 100%;
  height: 40px;
  display: block;
}
.dl-video-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
}
.dl-video-wrap video {
  width: 100%;
  max-height: 340px;
  display: block;
  background: #000;
}
.dl-preview-miss {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  background: rgba(var(--overlay-rgb), 0.02);
  border: 1px dashed rgba(var(--overlay-rgb), 0.12);
  border-radius: 12px;
}
.dl-preview-miss svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--text-dim);
}

/* === Downloads rail === */
.dl-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 760px) { .dl-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .dl-rail { grid-template-columns: 1fr; } }

.dl-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  text-align: left;
  background: rgba(var(--overlay-rgb), 0.02);
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  border-radius: 14px;
  color: var(--text-main);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.dl-chip:hover:not([disabled]) {
  border-color: rgba(var(--overlay-rgb), 0.22);
  background: rgba(var(--overlay-rgb), 0.04);
  transform: translateY(-1px);
}
.dl-chip[disabled] { opacity: 0.55; cursor: not-allowed; }
.dl-chip.is-saved { border-color: rgba(0, 230, 118, 0.4); background: rgba(0, 230, 118, 0.06); }

.dl-chip-ic {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(var(--overlay-rgb), 0.05);
  display: grid;
  place-items: center;
  color: var(--text-muted);
}
.dl-chip.is-saved .dl-chip-ic { color: var(--success-text); background: rgba(0, 230, 118, 0.08); }
.dl-chip-ic svg { width: 18px; height: 18px; }

.dl-chip-body { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.dl-chip-kind {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}
.dl-chip-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 2px;
}
.dl-chip-arrow {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  transition: transform 0.2s ease, color 0.2s ease;
}
.dl-chip:hover:not([disabled]) .dl-chip-arrow {
  color: var(--heading);
  transform: translateY(2px);
}
.dl-chip.is-saved .dl-chip-arrow { color: var(--success-text); }

.dl-chip.is-unavailable {
  opacity: 0.88;
  cursor: default;
  border-style: dashed;
  border-color: rgba(var(--overlay-rgb), 0.1);
  background: rgba(var(--overlay-rgb), 0.01);
}
.dl-chip.is-unavailable .dl-chip-arrow { display: none; }

.dl-btn-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 14px;
  padding: 13px 18px;
  border: 1px solid rgba(var(--overlay-rgb), 0.14);
  border-radius: 14px;
  background: rgba(var(--overlay-rgb), 0.05);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dl-btn-all:hover:not(:disabled) {
  border-color: rgba(var(--overlay-rgb), 0.3);
  background: rgba(var(--overlay-rgb), 0.08);
  transform: translateY(-1px);
}
.dl-btn-all:disabled { opacity: 0.5; cursor: not-allowed; }
.dl-btn-all.is-saved {
  border-color: rgba(0,230,118,0.4);
  background: rgba(0,230,118,0.08);
  color: var(--success-text);
}
.dl-btn-all svg { width: 18px; height: 18px; }

/* === Help / FAQ === */
.dl-help {
  margin-top: 40px;
  padding: 28px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
}
.dl-help h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--heading);
}
.dl-help h2:not(:first-child) { margin-top: 26px; }
.dl-help p {
  margin: 0 0 10px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-muted);
}
.dl-help ul, .dl-help ol {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
  padding-left: 20px;
  margin: 10px 0;
}
.dl-help li { margin-bottom: 6px; }

.tool-content-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 16px 0;
}
@media (max-width: 640px) {
  .tool-content-grid { grid-template-columns: 1fr; }
}
.tool-content-grid div {
  padding: 16px;
  border-radius: 12px;
  background: rgba(var(--overlay-rgb), 0.02);
  border: 1px solid rgba(var(--overlay-rgb), 0.06);
}
.tool-content-grid h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: var(--heading);
}
.tool-content-grid p {
  margin: 0;
  font-size: 0.84rem;
}

.faq-item {
  border-bottom: 1px solid rgba(var(--overlay-rgb), 0.08);
  padding: 12px 0;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--heading);
}
.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--text-dim);
}
.faq-item details[open] summary::after {
  content: "−";
}
.faq-answer {
  padding-top: 8px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* === Modals === */
.dl-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
}
.dl-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 11, 0.72);
  backdrop-filter: blur(8px);
}
.dl-modal-card {
  position: relative;
  width: min(100%, 460px);
  padding: 28px;
  border: 1px solid rgba(255, 168, 77, 0.45);
  border-radius: 20px;
  background: var(--control-bg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  z-index: 1;
}
.dl-modal-kicker {
  margin: 0 0 10px;
  color: var(--warning-text);
  font: 700 0.7rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dl-modal-card h2 {
  margin: 0 34px 10px 0;
  color: var(--heading);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.dl-modal-card p:not(.dl-modal-kicker) {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}
.dl-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(var(--overlay-rgb), 0.14);
  border-radius: 50%;
  background: rgba(var(--overlay-rgb), 0.04);
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.16s ease;
}
.dl-modal-close:hover {
  background: rgba(var(--overlay-rgb), 0.1);
  color: var(--heading);
}

.dl-audio-format-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 22px;
}
.dl-audio-format-choice {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 18px;
  border: 1px solid rgba(var(--overlay-rgb), 0.14);
  border-radius: 16px;
  background: rgba(var(--overlay-rgb), 0.035);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 160ms ease;
}
.dl-audio-format-choice:hover {
  border-color: rgba(255, 168, 77, 0.52);
  background: rgba(255, 168, 77, 0.07);
  transform: translateY(-1px);
}
.dl-audio-format-choice strong {
  flex: 0 0 100px;
  color: var(--heading);
  font: 800 1.05rem/1.2 var(--font);
}
.dl-audio-format-choice span {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.dl-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.dl-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid rgba(var(--overlay-rgb), 0.14);
  border-radius: 999px;
  background: transparent;
  color: var(--text-main);
  font: 700 0.86rem/1 var(--font);
  cursor: pointer;
}
.dl-btn-secondary:hover {
  background: rgba(var(--overlay-rgb), 0.07);
}

/* === Processing modal === */
.dl-processing {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: grid;
  place-items: center;
  padding: 18px;
}
.dl-processing::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 11, 0.72);
  backdrop-filter: blur(9px);
}
.dl-processing-card {
  position: relative;
  width: min(100%, 430px);
  padding: 28px;
  border: 1px solid rgba(126, 229, 151, 0.34);
  border-radius: 22px;
  background: var(--control-bg);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
  z-index: 1;
}
.dl-processing-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.dl-processing-spinner {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 3px solid rgba(var(--overlay-rgb), 0.1);
  border-top-color: var(--success-text);
  border-radius: 50%;
  animation: dlProcessingSpin 850ms linear infinite;
}
@keyframes dlProcessingSpin { to { transform: rotate(360deg); } }

.dl-processing-card h2 {
  margin: 0 0 4px;
  color: var(--heading);
  font-size: 1.35rem;
  line-height: 1.2;
}
.dl-processing-stage {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}
.dl-processing-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.08);
}
.dl-processing-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--success-text);
  transition: width 160ms linear;
}
.dl-processing.is-indeterminate .dl-processing-bar {
  width: 42%;
  animation: dlProcessingIndeterminate 1.15s ease-in-out infinite;
}
@keyframes dlProcessingIndeterminate {
  from { transform: translateX(-115%); }
  to { transform: translateX(340%); }
}
.dl-processing-detail {
  min-height: 1.4em;
  margin: 9px 0 0;
  color: var(--text-dim);
  font: 600 0.74rem/1.4 var(--mono);
  text-align: right;
}
.dl-processing-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

/* Toast */
.dl-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1400;
  padding: 11px 20px;
  border: 1px solid rgba(126, 229, 151, 0.34);
  border-radius: 999px;
  background: rgba(13, 18, 16, 0.94);
  color: #eaf5ec;
  box-shadow: 0 16px 44px rgba(2, 6, 4, 0.42);
  font: 700 0.82rem/1.25 var(--font);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.dl-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.dl-toast.is-error {
  border-color: rgba(239, 145, 133, 0.46);
  color: #ffd5ce;
}

.dl-hidden { display: none !important; }
body.dl-modal-open { overflow: hidden; }


/* ==========================================================================
   SUNOOCEP — Downloader Mobile UI Enhancements
   ========================================================================== */

/* Example Link & Button */
.dl-example {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px auto 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  max-width: 100%;
}

.dl-example a {
  color: var(--accent, #94e571);
  text-decoration: none;
  max-width: min(300px, 68vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}

.dl-example a:hover {
  text-decoration: underline;
}

.dl-example button {
  padding: 4px 12px;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(var(--overlay-rgb), 0.15);
  background: rgba(var(--overlay-rgb), 0.05);
  color: var(--text-main);
  font: 600 0.78rem var(--font);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dl-example button:hover {
  background: var(--accent, #94e571);
  color: #061c07;
  border-color: var(--accent, #94e571);
}

@media (max-width: 560px) {
  .dl-stage h1 {
    font-size: clamp(1.6rem, 6.8vw, 2.1rem);
    letter-spacing: -0.03em;
    line-height: 1.15;
  }

  .dl-stage .sub {
    font-size: 0.92rem;
    line-height: 1.5;
    padding: 0 4px;
  }

  .dl-input-wrap {
    border-radius: 14px;
  }

  .dl-form textarea {
    padding: 14px 14px 8px;
    min-height: 68px;
    font-size: 16px !important;
  }

  .dl-input-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px 12px;
  }

  .dl-paste-btn {
    flex: 1 1 90px;
    min-height: 44px;
    font-size: 0.85rem;
  }

  .dl-btn-primary {
    flex: 2 1 150px;
    min-height: 44px;
    font-size: 0.9rem;
  }

  /* Song Hero Result Card Mobile */
  .song-hero {
    padding: 16px 14px;
    border-radius: 16px;
    margin: 16px 0;
  }

  .song-hero-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .song-hero-cover {
    width: 84px;
    height: 84px;
    border-radius: 14px;
    margin: 0 auto;
  }

  .song-hero-body {
    width: 100%;
    text-align: center;
  }

  .song-hero-title {
    font-size: 1.18rem;
    text-align: center;
    margin-bottom: 4px;
  }

  .song-hero-artist {
    font-size: 0.84rem;
    text-align: center;
    margin-bottom: 8px;
  }

  .song-hero-meta {
    justify-content: center;
    gap: 6px;
  }

  .song-hero-tags {
    justify-content: center;
    gap: 5px;
    margin-top: 8px;
  }

  .song-hero-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 14px;
  }

  .song-hero-actions a {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  /* Download Rail (Chips) */
  .dl-rail {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dl-chip {
    padding: 12px 14px;
    min-height: 48px;
    border-radius: 12px;
  }

  .dl-chip-label {
    font-size: 0.88rem;
  }
}


/* ==========================================================================
   SUNOOCEP Downloader — Ultra-Modern UI & UX Styling
   ========================================================================== */

/* Page background glow & centering */
.dl-page main {
  padding-bottom: 72px;
  position: relative;
}

.dl-page main::before {
  content: "";
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, 96vw);
  height: 520px;
  background: radial-gradient(closest-side, rgba(148, 229, 113, 0.08), transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.dl-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 780px !important;
  margin: 0 auto;
}

/* Tools back link */
.dl-shell .tools-back {
  margin: 0 0 20px;
  font-size: 0.88rem;
}

.dl-shell .tools-back a {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.18s ease, transform 0.18s ease;
}

.dl-shell .tools-back a:hover {
  color: var(--accent);
  transform: translateX(-2px);
}

/* Stage & Titles */
.dl-stage {
  text-align: center;
  padding: 32px 0 20px;
}

.dl-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.04);
  border: 1px solid rgba(var(--overlay-rgb), 0.12);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
  backdrop-filter: blur(8px);
}

.dl-kicker svg {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.dl-stage h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: var(--heading);
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html[data-theme="light"] .dl-stage h1 {
  background: linear-gradient(180deg, #09090b 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dl-stage .sub {
  margin: 0 auto 24px;
  max-width: 58ch;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

/* Input Form & Glassmorphism Box */
.dl-form {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

.dl-input-wrap {
  background: rgba(18, 18, 24, 0.88);
  border: 1px solid rgba(var(--overlay-rgb), 0.12);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(var(--overlay-rgb), 0.05);
}

.dl-input-wrap:focus-within {
  border-color: rgba(148, 229, 113, 0.5);
  box-shadow: 0 0 0 4px rgba(148, 229, 113, 0.12), 0 20px 54px rgba(0, 0, 0, 0.52);
}

html[data-theme="light"] .dl-input-wrap {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.dl-form textarea {
  width: 100%;
  padding: 20px 22px 10px;
  background: transparent;
  color: var(--text-main);
  border: none;
  font: 0.95rem/1.55 var(--mono);
  outline: none;
  resize: none;
  min-height: 76px;
  box-sizing: border-box;
  display: block;
}

.dl-form textarea::placeholder {
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 0.95rem;
}

.dl-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  padding: 8px 16px 16px;
}

.dl-paste-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid rgba(var(--overlay-rgb), 0.14);
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.045);
  color: var(--text-main);
  font: 700 0.84rem/1 var(--font);
  cursor: pointer;
  transition: all 0.16s ease;
}

.dl-paste-btn:hover {
  background: rgba(var(--overlay-rgb), 0.1);
  border-color: rgba(var(--overlay-rgb), 0.28);
  transform: translateY(-1px);
}

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

.dl-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  min-height: 42px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #94e571 0%, #6fd845 100%);
  color: #061c07;
  font-weight: 700;
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 20px rgba(148, 229, 113, 0.32);
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.dl-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(148, 229, 113, 0.48);
  filter: brightness(1.04);
}

.dl-btn-primary:active:not(:disabled) {
  transform: scale(0.97);
}

.dl-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Example link pill */
.tool-example,
.dl-example {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 16px auto 0;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.035);
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  font-size: 0.8rem;
  color: var(--text-dim);
  max-width: 100%;
}

.tool-example a,
.dl-example a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--mono);
  max-width: min(280px, 60vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-example a:hover,
.dl-example a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.tool-example button,
.dl-example button {
  padding: 4px 12px;
  min-height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(148, 229, 113, 0.32);
  background: rgba(148, 229, 113, 0.12);
  color: var(--accent);
  font: 700 0.76rem var(--font);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-example button:hover,
.dl-example button:hover {
  background: var(--accent);
  color: #061c07;
  transform: translateY(-1px);
}

/* Status hint */
.dl-form-hint {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  text-align: center;
}

/* Policy notice */
.dl-policy-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 720px);
  margin: 16px auto 0;
  padding: 10px 16px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 168, 77, 0.32);
  border-radius: 14px;
  background: rgba(255, 168, 77, 0.06);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.dl-cross-link-top {
  margin: 14px auto 0;
  color: var(--text-dim);
  font-size: 0.84rem;
  text-align: center;
}

.dl-cross-link-top a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.dl-cross-link-top a:hover {
  text-decoration: underline;
}

/* Song Hero Card */
.song-hero {
  --cover-url: none;
  position: relative;
  margin: 28px auto 20px;
  max-width: 780px !important;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid rgba(var(--overlay-rgb), 0.10);
  background: linear-gradient(180deg, rgba(22, 22, 28, 0.88), rgba(14, 14, 18, 0.94));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  isolation: isolate;
  scroll-margin-top: calc(var(--nav-h) + 16px);
  animation: heroIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.song-hero::before {
  content: "";
  position: absolute;
  inset: -20%;
  background-image: var(--cover-url);
  background-size: cover;
  background-position: center;
  filter: blur(52px) saturate(1.5) brightness(0.85);
  opacity: 0.35;
  z-index: -2;
}

.song-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 12, 0.3) 0%, rgba(10, 10, 12, 0.92) 88%);
  z-index: -1;
}

.song-hero-top {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 24px;
  align-items: center;
}

.song-hero-cover {
  width: 168px;
  height: 168px;
  border-radius: 18px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(var(--overlay-rgb), 0.08);
}

.song-hero-title {
  margin: 0 0 6px;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--heading);
  font-weight: 800;
}

.song-hero-artist {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.song-hero-artist strong {
  color: var(--text-main);
  font-weight: 600;
}

.song-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.song-hero-suno,
.song-hero-analyze {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(var(--overlay-rgb), 0.12);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: all 0.15s ease;
}

.song-hero-analyze {
  border-color: rgba(148, 229, 113, 0.35);
  color: var(--accent);
  background: rgba(148, 229, 113, 0.08);
}

.song-hero-analyze:hover {
  background: var(--accent);
  color: #061c07;
  border-color: var(--accent);
}

.song-hero-suno:hover {
  color: var(--heading);
  border-color: rgba(var(--overlay-rgb), 0.3);
  background: rgba(var(--overlay-rgb), 0.1);
}

/* Download Rail & Chips */
.dl-section {
  max-width: 780px !important;
  margin-left: auto;
  margin-right: auto;
}

.dl-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dl-chip {
  padding: 16px 14px;
  border-radius: 16px;
  background: rgba(var(--overlay-rgb), 0.03);
  border: 1px solid rgba(var(--overlay-rgb), 0.1);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
}

.dl-chip:hover:not([disabled]) {
  background: rgba(var(--overlay-rgb), 0.06);
  border-color: rgba(148, 229, 113, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

.dl-chip-ic {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(148, 229, 113, 0.08);
  display: grid;
  place-items: center;
  color: var(--accent);
  flex-shrink: 0;
}

.dl-chip-kind {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--heading);
}

.dl-chip-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--mono);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.dl-btn-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
  padding: 14px 20px;
  border: 1px solid rgba(var(--overlay-rgb), 0.14);
  border-radius: 16px;
  background: rgba(var(--overlay-rgb), 0.05);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dl-btn-all:hover:not(:disabled) {
  border-color: rgba(148, 229, 113, 0.45);
  background: rgba(148, 229, 113, 0.12);
  color: var(--heading);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(148, 229, 113, 0.18);
}

/* FAQ cards in dl-help */
.dl-help {
  max-width: 780px !important;
  margin-left: auto;
  margin-right: auto;
}

.dl-help .faq-item details {
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  border-radius: 14px;
  background: rgba(var(--overlay-rgb), 0.025);
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.dl-help .faq-item details[open] {
  background: rgba(var(--overlay-rgb), 0.045);
  border-color: rgba(var(--overlay-rgb), 0.16);
}

.dl-help .faq-item summary {
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
}

.dl-help .faq-item summary::-webkit-details-marker {
  display: none;
}

.dl-help .faq-item .faq-answer {
  padding: 0 20px 18px;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.92rem;
}
