/* ============================================================
   SnapVideoDL — Base styles (dark-first, RTL-aware)
   Brand: deep navy #0a0e27 · electric violet #7c3aed → cyan #06b6d4
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
ul, ol { list-style: none; }

/* ---------- Design tokens ---------- */
:root {
  --bg: #0a0e27;
  --bg-2: #0d1330;
  --surface: rgba(255, 255, 255, .045);
  --surface-solid: #131a3f;
  --surface-2: #182052;
  --border: rgba(255, 255, 255, .10);
  --text: #eef1ff;
  --text-muted: #9aa3c7;
  --brand-1: #7c3aed;
  --brand-2: #06b6d4;
  --gradient: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
  --danger: #f43f5e;
  --success: #22d3a5;
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 68px;
  --container: 1120px;
  --shadow-lg: 0 24px 60px -18px rgba(3, 6, 24, .7);
}

[data-theme="light"] {
  --bg: #f4f6ff;
  --bg-2: #eef1fb;
  --surface: rgba(10, 14, 39, .045);
  --surface-solid: #ffffff;
  --surface-2: #e9edfb;
  --border: rgba(10, 14, 39, .12);
  --text: #141a38;
  --text-muted: #5b648c;
  --shadow-lg: 0 24px 60px -22px rgba(20, 26, 56, .25);
}

/* ---------- Utilities ---------- */
.container { width: min(var(--container), 100% - 2.5rem); margin-inline: auto; }
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.section-title { font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.section-sub { color: var(--text-muted); margin-block-start: .75rem; max-width: 640px; }
.text-center { text-align: center; }
.text-center .section-sub { margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-block-end: 1px solid var(--border);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; background: var(--gradient);
  display: grid; place-items: center; color: #fff; flex: none;
  box-shadow: 0 6px 18px -6px rgba(124, 58, 237, .6);
}
.brand-mark svg { width: 20px; height: 20px; }
.main-nav { display: flex; align-items: center; gap: 1.4rem; margin-inline-start: auto; }
.nav-link { color: var(--text-muted); font-weight: 600; font-size: .95rem; transition: color .15s; }
.nav-link:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: .6rem; margin-inline-start: .5rem; }

.lang-switcher select {
  appearance: none; -webkit-appearance: none;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: .5rem 2rem .5rem 1rem; font-size: .85rem; font-weight: 600;
  cursor: pointer; max-width: 150px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa3c7' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center;
}
[dir="rtl"] .lang-switcher select { padding: .5rem 1rem .5rem 2rem; background-position: left .8rem center; }
.lang-switcher select option { color: #141a38; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; cursor: pointer; transition: transform .15s;
}
.theme-toggle:hover { transform: rotate(12deg); }
.theme-toggle svg { width: 18px; height: 18px; }
.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-weight: 700; font-size: 1rem; line-height: 1;
  padding: .95rem 2rem; border-radius: 999px; border: 0; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease, opacity .2s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 10px 30px -10px rgba(124, 58, 237, .6); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: .65; cursor: wait; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--brand-2); }
.btn-sm { padding: .6rem 1.2rem; font-size: .88rem; }

.icon-btn {
  width: 42px; height: 42px; flex: none; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  transition: color .15s, border-color .15s, transform .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--brand-2); transform: scale(1.05); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem); overflow: clip; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 320px at 15% 0%, rgba(124, 58, 237, .22), transparent 65%),
    radial-gradient(560px 300px at 85% 10%, rgba(6, 182, 212, .16), transparent 65%);
}
[data-theme="light"] .hero::before {
  background:
    radial-gradient(600px 320px at 15% 0%, rgba(124, 58, 237, .12), transparent 65%),
    radial-gradient(560px 300px at 85% 10%, rgba(6, 182, 212, .12), transparent 65%);
}
.hero-inner { text-align: center; max-width: 860px; margin-inline: auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .82rem; font-weight: 700; letter-spacing: .02em;
  padding: .45rem 1.1rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  margin-block-end: 1.25rem;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px var(--success); }
.hero-title { font-size: clamp(2rem, 5.4vw, 3.4rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.12; }
.hero-subtitle { color: var(--text-muted); font-size: clamp(1rem, 2.2vw, 1.15rem); margin-block: 1rem 1.75rem; max-width: 640px; margin-inline: auto; }

/* Platform badges */
.platform-badges { display: flex; justify-content: center; gap: .7rem; margin-block-end: 1.75rem; flex-wrap: wrap; }
.platform-badge {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  transition: transform .15s, color .15s, border-color .15s;
}
.platform-badge:hover { transform: translateY(-3px); color: var(--text); border-color: var(--brand-2); }
.platform-badge svg { width: 22px; height: 22px; }

/* URL bar */
.url-bar {
  display: flex; align-items: center; gap: .5rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: .35rem .35rem .35rem 1.25rem;
  max-width: 660px; margin-inline: auto;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: border-color .2s, box-shadow .2s;
}
[dir="rtl"] .url-bar { padding: .35rem 1.25rem .35rem .35rem; }
.url-bar:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(6, 182, 212, .16); }
.url-bar input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0;
  color: var(--text); font-size: 1rem; padding-block: .55rem;
}
.url-bar input::placeholder { color: var(--text-muted); opacity: .75; }
.url-bar input:dir(rtl) { text-align: right; }
.platform-chip {
  display: none; align-items: center; gap: .35rem; flex: none;
  font-size: .74rem; font-weight: 800; text-transform: capitalize; letter-spacing: .02em;
  padding: .32rem .75rem; border-radius: 999px;
  background: rgba(6, 182, 212, .14); color: var(--brand-2); border: 1px solid rgba(6, 182, 212, .3);
}
.platform-chip.show { display: inline-flex; }
.platform-chip .pdot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Tool: preview / options / progress ---------- */
.options-panel {
  max-width: 660px; margin: 1.75rem auto 0; text-align: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
  display: grid; gap: 1.25rem;
  opacity: 0; transform: translateY(14px) scale(.985); pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
}
.options-panel.open { opacity: 1; transform: none; pointer-events: auto; }

.preview { display: flex; gap: 1rem; align-items: center; }
.preview-thumb {
  width: 148px; aspect-ratio: 16/9; flex: none; object-fit: cover;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border);
}
.preview-info { min-width: 0; }
.preview-kicker { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-2); margin-block-end: .3rem; }
.preview-title { font-size: 1.02rem; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.preview-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-block-start: .55rem; color: var(--text-muted); font-size: .85rem; }
.preview-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.preview-meta svg { width: 14px; height: 14px; }

.tabs { display: flex; background: rgba(0, 0, 0, .18); border: 1px solid var(--border); border-radius: 999px; padding: .28rem; }
[data-theme="light"] .tabs { background: rgba(10, 14, 39, .06); }
.tab {
  flex: 1; border: 0; background: transparent; color: var(--text-muted);
  font-weight: 700; font-size: .95rem; padding: .65rem 1rem; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  transition: background .2s, color .2s, box-shadow .2s;
}
.tab svg { width: 16px; height: 16px; }
.tab.active { background: var(--gradient); color: #fff; box-shadow: 0 6px 18px -8px rgba(124, 58, 237, .7); }

.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.opt-group { display: grid; gap: .45rem; }
.opt-label { font-size: .82rem; font-weight: 700; color: var(--text-muted); letter-spacing: .03em; }
.select {
  appearance: none; -webkit-appearance: none; width: 100%; cursor: pointer;
  background-color: var(--surface-solid); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: .75rem 2.4rem .75rem 1rem; font-weight: 600;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa3c7' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
  transition: border-color .15s;
}
[dir="rtl"] .select { padding: .75rem 1rem .75rem 2.4rem; background-position: left 1rem center; }
.select:focus { outline: 0; border-color: var(--brand-2); }
.select option { color: #141a38; background: #fff; }

.dl-actions { display: grid; gap: .9rem; }
.progress { display: grid; gap: .5rem; }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; font-size: .88rem; }
.progress-top strong { font-weight: 800; }
.progress-bar { height: 10px; border-radius: 999px; background: rgba(127, 140, 190, .22); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%; border-radius: inherit; background: var(--gradient);
  transition: width .25s ease; box-shadow: 0 0 12px rgba(6, 182, 212, .55);
}
.progress-fill.indet {
  width: 100% !important;
  background: linear-gradient(100deg, var(--brand-1) 20%, var(--brand-2) 40%, var(--brand-1) 60%);
  background-size: 200% 100%;
  animation: progress-indet 1.2s linear infinite;
}
@keyframes progress-indet { to { background-position: -200% 0; } }
.progress-sub { display: flex; justify-content: space-between; color: var(--text-muted); font-size: .8rem; }
.dl-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.dl-row .btn-primary { flex: 1; min-width: 200px; }

/* Fetch loader */
.fetch-loader { display: flex; align-items: center; justify-content: center; gap: .7rem; color: var(--text-muted); font-weight: 600; margin-block-start: 1.4rem; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 3px solid rgba(127, 140, 190, .3); border-top-color: var(--brand-2);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards / features ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin-block-start: 2.25rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform .18s, border-color .18s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(6, 182, 212, .45); box-shadow: var(--shadow-lg); }
.card-icon {
  width: 52px; height: 52px; border-radius: 15px; background: var(--gradient);
  display: grid; place-items: center; color: #fff; margin-block-end: 1rem;
  box-shadow: 0 8px 20px -8px rgba(124, 58, 237, .6);
}
.card-icon svg { width: 24px; height: 24px; }
.card h3 { font-size: 1.08rem; font-weight: 750; margin-block-end: .45rem; }
.card p { color: var(--text-muted); font-size: .94rem; }

/* Steps */
.steps { display: grid; gap: 1rem; margin-block-start: 2.25rem; counter-reset: step; }
.step {
  display: flex; gap: 1.1rem; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.4rem;
}
.step-num {
  counter-increment: step; flex: none; width: 42px; height: 42px; border-radius: 50%;
  background: var(--gradient); color: #fff; font-weight: 800;
  display: grid; place-items: center;
}
.step-num::before { content: counter(step); }
.step h3 { font-size: 1.02rem; font-weight: 750; margin-block-end: .25rem; }
.step p { color: var(--text-muted); font-size: .93rem; }

/* FAQ */
.faq-list { display: grid; gap: .8rem; margin-block-start: 2rem; max-width: 800px; margin-inline: auto; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: none; border: 0; cursor: pointer; text-align: start;
  padding: 1.1rem 1.3rem; font-weight: 700; font-size: 1rem; color: var(--text);
}
.faq-q svg { width: 18px; height: 18px; flex: none; color: var(--brand-2); transition: transform .2s; }
.faq-item.open .faq-q svg { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a p { padding: 0 1.3rem 1.25rem; color: var(--text-muted); font-size: .94rem; }

/* Related links */
.related-grid { display: flex; flex-wrap: wrap; gap: .7rem; margin-block-start: 1.75rem; }
.chip-link {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem 1.15rem; border-radius: 999px; font-weight: 650; font-size: .9rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: border-color .15s, transform .15s;
}
.chip-link:hover { border-color: var(--brand-2); transform: translateY(-2px); }
.chip-link svg { width: 15px; height: 15px; color: var(--brand-2); }

/* ---------- Ad slots ---------- */
.ad-slot {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 96px; width: min(var(--container), 100% - 2.5rem); margin: 1.75rem auto;
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: rgba(127, 140, 190, .05); overflow: hidden;
}
.ad-slot-label {
  position: absolute; top: 6px; inset-inline-start: 10px;
  font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted); opacity: .55;
}
.ad-slot ins, .ad-slot iframe { max-width: 100%; }

/* ---------- Footer ---------- */
.site-footer { border-block-start: 1px solid var(--border); margin-block-start: 2rem; background: var(--bg-2); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem;
  padding-block: 3rem 2rem;
}
.footer-brand p { color: var(--text-muted); font-size: .93rem; margin-block-start: .8rem; max-width: 340px; }
.footer-title { font-size: .95rem; font-weight: 800; margin-block-end: 1rem; letter-spacing: .02em; }
.footer-links { display: grid; gap: .6rem; }
.footer-link { color: var(--text-muted); font-size: .93rem; transition: color .15s; }
.footer-link:hover { color: var(--brand-2); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  border-block-start: 1px solid var(--border); padding-block: 1.25rem;
  color: var(--text-muted); font-size: .85rem;
}

/* ---------- Language switcher (footer / floating) ---------- */
.lang-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.lang-link {
  font-size: .82rem; padding: .35rem .8rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  transition: color .15s, border-color .15s;
}
.lang-link:hover, .lang-link.active { color: var(--text); border-color: var(--brand-2); }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; inset-block-end: 1.25rem; inset-inline: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  pointer-events: none; padding-inline: 1rem;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: .6rem;
  background: var(--surface-solid); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: .85rem 1.2rem; font-size: .92rem; font-weight: 600;
  box-shadow: var(--shadow-lg); max-width: min(480px, 92vw);
  animation: toast-in .25s ease;
}
.toast svg { width: 18px; height: 18px; flex: none; }
.toast-error { border-color: rgba(244, 63, 94, .55); }
.toast-error svg { color: var(--danger); }
.toast-success { border-color: rgba(34, 211, 165, .5); }
.toast-success svg { color: var(--success); }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Legal / article content ---------- */
.prose { max-width: 800px; margin-inline: auto; }
.prose h2 { font-size: 1.4rem; margin-block: 2rem 1rem; }
.prose h3 { font-size: 1.15rem; margin-block: 1.6rem .8rem; }
.prose p { color: var(--text-muted); margin-block-end: 1rem; }
.prose ul { color: var(--text-muted); margin-block-end: 1rem; padding-inline-start: 1.4rem; list-style: disc; }
.prose li { margin-block-end: .4rem; }
.prose a { color: var(--brand-2); text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .main-nav { display: none; }
  .nav-toggle { display: grid; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .opt-grid { grid-template-columns: 1fr; }
  .preview { flex-direction: column; align-items: stretch; }
  .preview-thumb { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .hero-badge { font-size: .75rem; }
  .url-bar { border-radius: 22px; flex-wrap: wrap; padding: .5rem; }
  .url-bar input { flex: 1 1 100%; padding: .5rem .8rem; order: -1; }
  .platform-badges { gap: .5rem; }
  .platform-badge { width: 40px; height: 40px; }
}

/* Mobile nav panel */
.mobile-nav {
  display: none; position: fixed; inset: var(--header-h) 0 auto 0; z-index: 99;
  background: var(--bg-2); border-block-end: 1px solid var(--border); padding: 1rem 1.25rem 1.5rem;
}
.mobile-nav.open { display: grid; gap: .25rem; }
.mobile-nav .nav-link { padding: .8rem .4rem; border-block-end: 1px solid var(--border); font-size: 1.05rem; }

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

/* ---------- Header fix: styles for the class names header.php actually uses ---------- */
.skip-link { position: absolute; inset-inline-start: -9999px; top: 0; z-index: 200; background: var(--surface); padding: .6rem 1rem; border-radius: var(--radius-sm); }
.skip-link:focus { inset-inline-start: 1rem; top: .5rem; }
.site-header .header-inner { width: min(var(--container), 100% - 2.5rem); margin-inline: auto; }
.logo { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; color: var(--text); text-decoration: none; flex: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--gradient); display: grid; place-items: center; color: #fff; font-size: 1rem; box-shadow: 0 6px 18px -6px rgba(124, 58, 237, .6); }
.site-nav { display: flex; align-items: center; gap: 1.4rem; margin-inline-start: auto; }
.site-nav a { color: var(--text-muted); font-weight: 600; font-size: .95rem; text-decoration: none; transition: color .15s; }
.site-nav a:hover { color: var(--text); }
.header-tools { display: flex; align-items: center; gap: .6rem; margin-inline-start: .5rem; }
.theme-toggle .theme-icon-sun, .theme-toggle .theme-icon-moon { font-size: 1rem; line-height: 1; }
[data-theme="dark"] .theme-toggle .theme-icon-moon, [data-theme="light"] .theme-toggle .theme-icon-sun { display: none; }
@media (max-width: 900px) {
  .site-nav { display: none; }
  .header-tools { margin-inline-start: auto; }
}
/* Ad slots stay hidden until real ad code (ins/iframe) is placed inside them. */
.ad-slot:not(:has(ins, iframe)) { display: none; }

/* ---------- Hidden elements must not take space (loader / options panel) ---------- */
[hidden] { display: none !important; }

/* ---------- SEO sections below the tool (intro, features, steps, FAQ, related) ---------- */
.page-main { padding-block-end: 1rem; }
.seo-section { padding-block: 2.5rem; }
.seo-section h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); letter-spacing: -.01em; margin-block-end: 1.25rem; }
.seo-intro .container { max-width: 820px; }
.seo-intro p { color: var(--text-muted); font-size: 1.05rem; line-height: 1.75; margin-block-end: 1rem; }
.seo-intro strong { color: var(--text); }
.seo-intro a, .legal-article a { color: var(--brand-2); text-decoration: underline; text-underline-offset: 2px; }
.features-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1.4rem; }
.feature-card h3 { font-size: 1.05rem; margin-block-end: .45rem; }
.feature-card p { color: var(--text-muted); line-height: 1.6; margin: 0; }
.steps-list { list-style: none; counter-reset: step; display: grid; gap: .85rem; padding: 0; margin: 0; }
.steps-list li { counter-increment: step; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.3rem 1.1rem 4rem; }
.steps-list li::before { content: counter(step); position: absolute; inset-inline-start: 1.1rem; top: 1.05rem; width: 2rem; height: 2rem; border-radius: 50%; background: var(--gradient); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .95rem; }
[dir="rtl"] .steps-list li { padding: 1.1rem 4rem 1.1rem 1.3rem; }
.steps-list h3 { font-size: 1.02rem; margin-block-end: .3rem; }
.steps-list p { color: var(--text-muted); line-height: 1.6; margin: 0; }
.faq .faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm, 12px); padding: .95rem 1.2rem; margin-block-end: .7rem; }
.faq .faq-item summary { cursor: pointer; font-weight: 700; list-style-position: outside; }
.faq .faq-item[open] summary { margin-block-end: .6rem; }
.faq .faq-item p { color: var(--text-muted); line-height: 1.65; margin: 0; }
.related-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.related-list a { display: inline-block; padding: .6rem 1rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; }
.related-list a:hover { border-color: var(--brand-2); }
.legal-page { padding-block: 2.5rem 1rem; }
.legal-article { max-width: 780px; margin-inline: auto; line-height: 1.75; }
.legal-article h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-block-end: 1.2rem; }
.legal-article h2 { font-size: 1.25rem; margin-block: 1.8rem .6rem; }
.legal-article p, .legal-article li { color: var(--text-muted); }
.legal-article ul { padding-inline-start: 1.3rem; }
@media (max-width: 640px) {
  .features-grid { grid-template-columns: 1fr; }
  .seo-section { padding-block: 1.8rem; }
}
.legal-article ul { list-style: disc; } .legal-article li { margin-block-end: .35rem; }

/* Instagram story viewer */
.story-hero .hero-title { margin-block-end: .75rem; }
.story-form { margin-block-start: 1.75rem; }
.story-at { color: var(--text-muted); font-weight: 700; flex: none; }
.story-go { flex: none; padding-inline: 1.25rem; border-radius: 999px; }
.story-status { max-width: 660px; margin: 1rem auto 0; padding: .75rem 1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); text-align: center; }
.story-status.is-error { border-color: rgba(239, 68, 68, .45); color: #f87171; }
.story-status.is-warn { border-color: rgba(234, 179, 8, .45); }
.story-result { margin-block-start: 1.75rem; }
.story-user { display: flex; align-items: center; gap: .75rem; justify-content: center; margin-block-end: 1.25rem; text-align: start; }
.story-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--brand-2); }
.story-name { font-weight: 800; }
.story-count { color: var(--text-muted); font-size: .9rem; }
.story-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.story-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.story-media { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #000; display: block; }
.story-bar { display: flex; flex-direction: column; align-items: stretch; gap: .5rem; padding: .6rem .7rem .75rem; }
.story-tag { font-size: .8rem; color: var(--text-muted); text-align: center; }
.story-bar .btn { width: 100%; padding-inline: .5rem; }
@media (max-width: 640px) {
  .url-bar.story-form { flex-wrap: nowrap; border-radius: 999px; padding: .35rem; }
  .url-bar.story-form input { flex: 1 1 auto; order: 0; padding: .5rem .25rem .5rem .75rem; }
  .story-at { display: none; }
}
@media (max-width: 480px) {
  .story-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .story-go { padding: .8rem .9rem; font-size: .88rem; }
}

/* Footer lists: readable colour, comfortable tap targets on phones */
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .15rem; }
.footer-col a { display: inline-block; padding-block: .35rem; color: var(--text-muted); font-size: .93rem; transition: color .15s; }
.footer-col a:hover { color: var(--brand-2); }
.footer-title { font-size: 1rem; font-weight: 800; margin-block-end: .6rem; }
.footer-logo { font-weight: 800; }
/* Legal pages: space between paragraphs, long words/emails never overflow */
.legal-article p + p { margin-block-start: .9em; }
.legal-article { overflow-wrap: anywhere; }
[id] { scroll-margin-top: 84px; }
