:root {
  --brand: #7c3aed;
  --brand-dark: #6d28d9;
  --brand-2: #4f46e5;
  --audio: #0d9488;
  --audio-dark: #0f766e;
  --text: #0f1117;
  --text-2: #5b6472;
  --border: #e8eaf0;
  --border-2: #d6dae3;
  --bg-soft: #f7f8fb;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 900px; margin: 0 auto; padding: 0 18px; }

/* ============================= App (mobile-first) ============================= */
.app {
  flex: 1 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; width: 100%; max-width: 640px; margin: 0 auto;
  padding: 34px 18px 48px;
  background: radial-gradient(900px 420px at 50% -6%, #f1ecfe 0%, #ffffff 60%);
}
.logo { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 22px; }
.logo-mark { display: block; border-radius: 9px; }
.logo-text { font-size: 21px; letter-spacing: -0.4px; line-height: 1; }
.logo-text b { color: var(--text); font-weight: 800; }
.logo-text i { color: var(--brand); font-style: normal; font-weight: 600; }

.hero-title { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin: 0 0 10px; }
.tagline { color: var(--text-2); font-size: 15.5px; margin: 0 0 24px; max-width: 480px; }

/* Input bar: stacked on mobile */
.input-bar {
  display: flex; flex-direction: column; gap: 10px;
  background: #fff; border: 1px solid var(--border-2); border-radius: 16px;
  padding: 10px; width: 100%; box-shadow: 0 12px 34px rgba(24, 20, 50, .09);
}
#url-input {
  width: 100%; min-width: 0; border: none; outline: none; font-size: 16px;
  padding: 13px 14px; color: var(--text); background: transparent;
}
#url-input::placeholder { color: #9aa2b1; }
/* min-width:0 lets the buttons shrink so a long localized label can't push the
   row past the screen edge; the label ellipsizes instead of overflowing. */
.input-actions { display: flex; gap: 10px; min-width: 0; }
.input-actions .btn { min-width: 0; }
.input-actions .btn .btn-label { overflow: hidden; text-overflow: ellipsis; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; border-radius: 12px; cursor: pointer; font-family: inherit;
  font-size: 15px; font-weight: 700; padding: 13px 18px; white-space: nowrap;
  transition: background .15s, transform .05s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; flex: 1; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-paste { background: #f0eefa; color: var(--brand-dark); }
.btn-paste:hover { background: #e7e2f8; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border-2); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn:disabled { opacity: .55; cursor: default; }
.btn[hidden] { display: none; }  /* author display beats UA [hidden] otherwise */

.supported { color: #97a0af; font-size: 13px; margin: 22px 0 0; }
.supported span { color: var(--text-2); font-weight: 600; }

.reveal-nav { margin-top: 16px; display: flex; align-items: center; gap: 12px; }
.reveal-link {
  background: none; border: none; color: var(--text-2); cursor: pointer;
  font-size: 14px; font-family: inherit; padding: 2px 0;
}
.reveal-link:hover { color: var(--brand); text-decoration: underline; }
.reveal-nav .dot { color: var(--border-2); }

/* ============================= Result card ============================= */
.result {
  background: #fff; border: 1px solid var(--border-2); border-radius: 16px;
  margin: 18px 0 0; width: 100%; padding: 16px; text-align: left;
  box-shadow: 0 12px 34px rgba(24, 20, 50, .09);
}
.result.error { color: #b4261a; text-align: center; font-weight: 500; }
.result.loading { text-align: center; color: var(--text-2); }

.result-head { display: flex; gap: 13px; align-items: flex-start; }
.result-thumb {
  width: 128px; height: 76px; border-radius: 10px; object-fit: cover;
  background: #e6e8ee; flex: none;
}
.result-meta { min-width: 0; flex: 1; }
.platform-badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  color: var(--brand-dark); background: #f0eefa; border-radius: 6px; padding: 2px 7px; margin-bottom: 5px;
}
.result-title {
  font-weight: 700; font-size: 14.5px; margin: 0 0 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.result-uploader { color: var(--text-2); font-size: 12.5px; margin: 0; }
.playlist-note {
  margin: 12px 0 0; font-size: 12.5px; color: #8a6d00; background: #fdf6e3;
  border-radius: 8px; padding: 8px 10px;
}

/* playlist picker */
.pl-head { margin-bottom: 4px; }
.pl-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pl-actions .btn { flex: 1 1 30%; min-width: 0; white-space: normal; }
.pl-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; margin-top: 12px; }
.pl-row { display: flex; align-items: center; gap: 8px; }
.pl-row .pl-item { flex: 1; min-width: 0; }
/* Playlist converter: per-track links into the music services */
.pl-cv { display: flex; flex-direction: column; gap: 2px; font-size: 11px; white-space: nowrap; flex: none; }
.pl-cv a { color: var(--text-2); }
.pl-cv a:hover { color: var(--brand); }
/* Pro perk chip + upsell note (bulk download) */
.pro-chip {
  font-size: 10px; font-weight: 800; letter-spacing: .04em; vertical-align: middle;
  background: rgba(255,255,255,.22); color: inherit; border-radius: 5px; padding: 1px 5px;
}
.btn-ghost .pro-chip, .reveal-link .pro-chip { background: #f0eefa; color: var(--brand-dark); }
.batch-pro-note { width: 100%; margin: 0 0 8px; font-size: 13.5px; color: var(--text-2); }
/* Batch import modal */
#batch-urls {
  width: 100%; border: 1px solid var(--border-2); border-radius: 10px; padding: 10px;
  font: inherit; font-size: 13.5px; resize: vertical; min-height: 110px; box-sizing: border-box;
}
.batch-card { gap: 10px; text-align: left; }
.batch-card .adblock-title { margin: 0; font-size: 18px; }
.batch-card .batch-hint { margin: 0; font-size: 13px; color: var(--text-2); }
#batch-close { align-self: center; padding: 6px 14px; }
.pl-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 9px; cursor: pointer; font-family: inherit; color: var(--text);
}
.pl-item:hover { border-color: var(--brand); background: #f5f2fe; }
.pl-thumb { width: 56px; height: 34px; border-radius: 6px; object-fit: cover; background: #e6e8ee; flex: none; }
.pl-title { flex: 1; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-dur { font-size: 12px; color: var(--text-2); flex: none; }

.fmt-group { margin-top: 16px; }
.fmt-group-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: #97a0af; margin: 0 0 8px;
}
.fmt-btns { display: flex; flex-wrap: wrap; gap: 9px; }
.fmt-btn {
  display: inline-flex; align-items: center; gap: 7px; border: none; border-radius: 11px;
  padding: 10px 15px; font-size: 14px; font-weight: 700; cursor: pointer;
  color: #fff; text-decoration: none;
}
.fmt-btn small { font-weight: 500; opacity: .85; }
.fmt-btn.video { background: var(--brand); }
.fmt-btn.video:hover { background: var(--brand-dark); text-decoration: none; }
.fmt-btn.audio { background: var(--audio); }
.fmt-btn.audio:hover { background: var(--audio-dark); text-decoration: none; }
.fmt-btn.text { background: #334155; }
.fmt-btn.text:hover { background: #1f2937; text-decoration: none; }
.fmt-btn.tool { background: #9333ea; }
.fmt-btn.tool:hover { background: #7e22ce; text-decoration: none; }
.fmt-btn.share { background: #2563eb; }
.fmt-btn.share:hover { background: #1d4ed8; text-decoration: none; }

/* photo grid */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.img-tile {
  position: relative; display: block; border-radius: 10px; overflow: hidden;
  background: var(--bg-soft); border: 1px solid var(--border); min-height: 92px;
  text-decoration: none;
}
.img-tile:hover { border-color: var(--brand); text-decoration: none; }
.img-prev { width: 100%; height: 112px; object-fit: cover; display: block; }
.img-dl {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 8px; font-size: 12.5px; font-weight: 700; color: #fff;
  background: rgba(15, 17, 23, .62);
}
.img-dl small { font-weight: 500; opacity: .8; }

.spinner {
  width: 20px; height: 20px; border: 3px solid rgba(124,58,237,.25);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================= SEO content ============================= */
.seo-content { border-top: 1px solid var(--border); padding: 8px 0 10px; }
.seo-content[hidden] { display: none; }
.section-title { text-align: center; font-size: 22px; font-weight: 800; margin: 30px 0 18px; }
.intro { padding: 8px 18px 8px; }
.intro p { color: var(--text); font-size: 15px; max-width: 760px; margin: 0 auto; text-align: center; }

.cards { display: grid; grid-template-columns: 1fr; gap: 30px; margin-top: 8px; }
.step-card {
  position: relative; background: var(--bg-soft); border-top: 3px solid var(--brand);
  border-radius: 14px; padding: 40px 20px 22px; text-align: center;
}
.step-num {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  width: 42px; height: 42px; border-radius: 50%; background: var(--brand); color: #fff;
  font-size: 19px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  border: 4px solid #fff;
}
.step-card h3 { font-size: 16px; margin: 0 0 8px; }
.step-card p { font-size: 14px; color: var(--text-2); margin: 0; }

.faq { padding-bottom: 10px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 15px 30px 15px 4px; position: relative;
  font-weight: 700; font-size: 15.5px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "⌄"; position: absolute; right: 8px; top: 12px; color: var(--brand);
  font-size: 18px; transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item p { margin: 0 4px 15px; color: var(--text-2); font-size: 14.5px; }

/* ============================= Ads ============================= */
.ad-slot {
  width: 100%; margin: 18px 0 0; text-align: center;
  border: 1px solid var(--border); border-radius: 12px; padding: 10px;
  background: #fff;
}
.ad-slot[hidden] { display: none; }
.ad-label {
  display: block; font-size: 10px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: #aab2bf; margin-bottom: 6px;
}
/* Reserve space so the ad injecting after consent doesn't shift layout (CLS). */
.ad-content { min-height: 90px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ad-content > * { max-width: 100%; }

.ad-modal {
  position: fixed; inset: 0; z-index: 60; background: rgba(15, 17, 23, .55);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.ad-modal[hidden] { display: none; }
/* The pre-download interstitial must paint above the batch-import modal */
#ad-interstitial { z-index: 70; }
.ad-modal-card {
  background: #fff; border-radius: 16px; padding: 16px; width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); text-align: center;
  display: flex; flex-direction: column; gap: 12px;
}
.ad-modal-card .ad-content { min-height: 250px; }
#ad-continue { width: 100%; }

/* Anti-adblock wall (reuses the modal shell) */
.adblock-card { gap: 10px; }
.adblock-card .adblock-ico { font-size: 34px; line-height: 1; }
.adblock-card .adblock-title { margin: 0; font-size: 19px; }
.adblock-card p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.adblock-card .btn { width: 100%; }

/* ===================== Comparison / alternative pages ===================== */
.compare-table-wrap { overflow-x: auto; margin: 16px 0; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 380px; }
.compare-table th, .compare-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.compare-table thead th { font-weight: 700; color: var(--text-1); border-bottom: 2px solid var(--border-2); }
.compare-table thead th:nth-child(2) { color: var(--brand); }
.compare-table tbody th { font-weight: 600; color: var(--text-2); }
.compare-table td { color: var(--text-1); }
.compare-cta { margin: 18px 0; }
.compare-cta .btn { display: inline-block; width: auto; padding: 11px 22px; }

/* ============================= Legal pages ============================= */
.legal { max-width: 760px; padding: 40px 18px 60px; }
.legal .logo { margin-bottom: 28px; }
.legal h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin: 0 0 4px; }
.legal-updated { color: #97a0af; font-size: 13.5px; margin: 0 0 26px; }
.legal h2 { font-size: 18px; font-weight: 800; margin: 30px 0 10px; }
.legal p, .legal li { font-size: 15px; color: var(--text); line-height: 1.65; }
.legal ul { padding-left: 22px; margin: 10px 0 16px; }
.legal li { margin: 8px 0; }
.legal strong { font-weight: 700; }

/* ============================= Footer ============================= */
.mini-footer { flex-shrink: 0; border-top: 1px solid var(--border); padding: 22px 18px; text-align: center; }
.footer-tools { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-bottom: 16px; }
.footer-tools a { color: var(--text-2); font-size: 13.5px; }
.footer-meta { display: flex; gap: 16px; justify-content: center; color: #97a0af; font-size: 13px; }
.footer-meta a { color: #97a0af; }

/* ============================= Cookie banner ============================= */
.cookie-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50;
  background: #14121c; color: #e8e6ef; border-radius: 14px;
  padding: 14px 16px; box-shadow: 0 14px 40px rgba(0,0,0,.28);
  display: flex; flex-direction: column; gap: 12px;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; font-size: 13.5px; line-height: 1.5; color: #d9d7e2; }
.cookie-banner a { color: #b6a7f5; }
/* Wrap + shrink so long localized labels (e.g. "Sin anuncios — €0.99/mes")
   never overflow the banner on a narrow phone. */
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-actions .btn { flex: 1 1 42%; min-width: 0; white-space: normal; padding: 11px 14px; }
.cookie-actions .btn-ghost { color: #cfcddb; border-color: #3a3550; }
.cookie-actions .btn-ghost:hover { background: #221f30; }

/* ============================= Desktop ============================= */
@media (min-width: 640px) {
  .app { max-width: 700px; padding-top: 52px; }
  .hero-title { font-size: 31px; }
  .input-bar { flex-direction: row; align-items: center; padding: 8px 8px 8px 6px; }
  .input-actions { flex: none; }
  .btn-primary { flex: none; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .cookie-banner {
    left: 50%; right: auto; transform: translateX(-50%); max-width: 720px; width: calc(100% - 32px);
    flex-direction: row; align-items: center; justify-content: space-between;
  }
  .cookie-actions { flex: none; }
  .cookie-actions .btn { flex: none; }
}

/* ============================= Ad-free subscription ============================= */
.ad-remove { display: block; text-align: center; font-size: 12px; margin-top: 6px; color: #97a0af; }
.ad-remove:hover { color: var(--brand); }
.ad-modal-card .ad-remove { margin-top: 10px; }

/* Nudge when a download is attempted before a consent choice */
.cookie-banner.attn { animation: cb-attn 0.45s ease 2; }
@keyframes cb-attn {
  0%, 100% { bottom: 12px; }
  50% { bottom: 24px; }
}
.cookie-actions a.btn { text-decoration: none; text-align: center; }

/* /pro page */
.pro-page h1 { margin-bottom: 18px; }
.pro-notice {
  border: 1px solid var(--border-2); border-left: 3px solid var(--brand);
  border-radius: 8px; padding: 10px 14px; margin: 0 0 18px;
  font-size: 14px; background: var(--bg-soft);
}
.pro-card {
  border: 1px solid var(--border-2); border-radius: 14px;
  padding: 22px; margin: 6px 0 28px; background: var(--bg-soft);
}
.pro-price { font-size: 30px; font-weight: 800; margin: 0 0 12px; letter-spacing: -0.5px; }
.pro-feats { list-style: none; padding: 0; margin: 0 0 18px; }
.pro-feats li { position: relative; padding-left: 26px; margin: 9px 0; font-size: 15px; line-height: 1.5; }
.pro-feats li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 800; }
.pro-cta { width: 100%; }
.pro-fine { font-size: 12.5px; color: #97a0af; line-height: 1.55; margin: 12px 0 0; }
.pro-badge { color: #16a34a; font-weight: 800; font-size: 16px; margin: 0 0 10px; }
.pro-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.pro-card-actions .btn { text-decoration: none; }
.pro-restore { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.pro-restore input {
  flex: 1; min-width: 220px; padding: 11px 13px; font: inherit;
  border: 1px solid var(--border-2); border-radius: 10px; background: #fff;
}
.pro-restore input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }

/* ============================= SEO content (answer-first, how-to, hubs) ============================= */
.answer { font-size: 15.5px; line-height: 1.6; color: var(--text); margin: 0 0 14px; }
.seo-content .note { font-size: 14px; color: var(--text-2); margin: 0 0 10px; }
.seo-content .formats { font-size: 14px; color: var(--text-2); margin: 0 0 18px; }

/* How-to article (visible primary content) */
.howto { max-width: 720px; margin: 8px auto 0; padding: 8px 18px 40px; }
.howto .answer { font-size: 16.5px; }
.howto-steps { margin: 18px 0 24px; padding-left: 22px; }
.howto-steps li { margin: 10px 0; line-height: 1.6; font-size: 15px; }
.howto-more { margin-top: 18px; font-size: 14px; }

/* Related / hub internal-link blocks */
.related ul, .about-tools, .about-guides { list-style: none; padding: 0; margin: 6px 0 18px; }
.related ul { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.related li a, .about-tools li a { color: var(--brand); font-size: 14px; }
.about-tools { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.about-guides li { margin: 8px 0; line-height: 1.55; font-size: 15px; }
.about-group { font-size: 15px; font-weight: 800; margin: 18px 0 4px; color: var(--text); }
.guides-teaser { font-size: 14px; color: var(--text-2); }
.about-page .answer { margin-bottom: 22px; }

/* Supported-sites directory */
.supported-directory { max-width: 980px; }
.directory-search {
  width: 100%; border: 1px solid var(--border-2); border-radius: 12px;
  padding: 12px 14px; font: inherit; margin: 8px 0 14px;
}
.supported-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; }
.supported-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.supported-table th, .supported-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.supported-table tbody tr:last-child th, .supported-table tbody tr:last-child td { border-bottom: 0; }
.status-pill {
  display: inline-flex; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 800;
  background: #ecfdf5; color: #047857;
}
.status-pill.paused { background: #fef2f2; color: #b91c1c; }

/* Legal/report page */
.legal-page { max-width: 760px; width: 100%; margin: 0 auto; padding: 34px 18px 48px; }
.legal-page h1 { margin: 8px 0 10px; font-size: 30px; line-height: 1.15; }
.muted { color: var(--text-2); }
.card {
  background: #fff; border: 1px solid var(--border-2); border-radius: 14px;
  padding: 18px; margin: 16px 0; box-shadow: 0 8px 24px rgba(24,20,50,.05);
}
.abuse-form { display: flex; flex-direction: column; gap: 12px; }
.abuse-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; color: var(--text); }
.abuse-form input, .abuse-form textarea {
  border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 12px; font: inherit; font-weight: 400;
}

/* Language switcher (footer) */
.footer-lang { margin-top: 12px; display: flex; gap: 12px; justify-content: center; font-size: 13px; }
.footer-lang a { color: var(--brand); }
.footer-lang span { color: #97a0af; }

/* Breadcrumbs (visible; complements BreadcrumbList JSON-LD) */
.breadcrumb { font-size: 12.5px; color: var(--text-2); margin: 0 0 14px; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { color: #c4c0d4; margin: 0 2px; }
.breadcrumb [aria-current] { color: var(--text); }

.footer-lang select {
  font: inherit; font-size: 13px; color: var(--text-2); background: var(--bg-soft);
  border: 1px solid var(--border-2); border-radius: 8px; padding: 5px 8px; cursor: pointer;
}
[dir="rtl"] .input-actions { flex-direction: row-reverse; }
