/* ═══════════════════════════════════════════════════════════
   دانلودچی — UI v5 (۱۴۰۵)
   Layered on top of style.css: new tokens, light/dark themes,
   download-first hero, cleaner cards, better reading UX.
   ═══════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg: #0a0b12;
  --bg-2: #0e1019;
  --bg-3: #141726;
  --surface: #12141f;
  --surface-2: #191c2b;
  --surface-3: #20243a;
  --line: rgba(255,255,255,.075);
  --line-2: rgba(255,255,255,.14);
  --text-1: #f4f5fb;
  --text-2: #c5c8db;
  --text-3: #8b8fa9;
  --accent: #7c6fff;
  --accent-ink: #a99fff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(124,111,255,.13);
  --grad: linear-gradient(135deg, #7c6fff 0%, #4f8bff 55%, #22d3ee 100%);
  --ok: #34d399;
  --hot: #fb7185;
  --shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --shadow-2: 0 10px 40px rgba(0,0,0,.45);
  --nav-bg: rgba(10,11,18,.78);
  /* legacy aliases used by style.css + templates */
  --glass: var(--surface);
  --glass-b: var(--surface);
  --border: var(--line);
  --border-h: var(--line-2);
  --purple: var(--accent);
  --purple-2: var(--accent-ink);
  --purple-3: var(--accent-ink);
  --purple-dim: var(--accent-soft);
  --cyan: var(--accent-2);
  --cyan-2: var(--accent-2);
  --cyan-dim: rgba(34,211,238,.1);
  --r: 16px; --r-sm: 11px; --r-lg: 22px; --r-xl: 28px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f6fb;
  --bg-2: #eef0f7;
  --bg-3: #e7e9f3;
  --surface: #ffffff;
  --surface-2: #f3f4fa;
  --surface-3: #e9ebf5;
  --line: rgba(17,20,45,.08);
  --line-2: rgba(17,20,45,.16);
  --text-1: #12141f;
  --text-2: #3b4058;
  --text-3: #6c718b;
  --accent: #5b4bff;
  --accent-ink: #4b3bea;
  --accent-2: #0891b2;
  --accent-soft: rgba(91,75,255,.09);
  --cyan-dim: rgba(8,145,178,.09);
  --shadow-1: 0 1px 2px rgba(17,20,45,.05), 0 4px 14px rgba(17,20,45,.06);
  --shadow-2: 0 14px 40px rgba(17,20,45,.12);
  --nav-bg: rgba(245,246,251,.82);
  color-scheme: light;
}

/* ── Base ───────────────────────────────────────────────── */
body {
  background: var(--bg) !important;
  color: var(--text-2) !important;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 0;
  transition: background-color .25s, color .25s;
}
a { color: var(--accent-ink); }
a:hover { color: var(--accent-2); }
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar-track { background: var(--bg); }
#ambient, #cursor-glow, #hero-canvas, .hero-fade { display: none !important; }
#progress-bar { height: 3px; background: var(--grad); box-shadow: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .anim { opacity: 1 !important; transform: none !important; }
}

/* ── Nav ────────────────────────────────────────────────── */
.nav {
  background: var(--nav-bg) !important;
  border-bottom: 1px solid var(--line) !important;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.nav.scrolled { box-shadow: var(--shadow-1) !important; }
.nav-inner { height: 64px; }
.nav-logo { gap: 10px; }
.nav-logo .logo-img {
  width: 34px; height: 34px; border-radius: 10px; object-fit: cover;
  box-shadow: 0 0 0 1px var(--line-2);
}
.logo-text {
  font-size: 1.12rem; font-weight: 900;
  background: none; -webkit-text-fill-color: currentColor; color: var(--text-1);
}
.logo-text b { color: var(--accent-ink); font-weight: 900; }
.nav-links a { color: var(--text-3); font-weight: 600; font-size: .88rem; }
.nav-links a:hover { color: var(--text-1); background: var(--surface-2); }
.nav-links a.active { color: var(--text-1); background: var(--accent-soft); }
.nav-links a::after { display: none; }
.search-wrap input {
  background: var(--surface-2) !important; border: 1px solid var(--line) !important;
  color: var(--text-1) !important; border-radius: 12px !important;
}
.search-wrap input::placeholder { color: var(--text-3); }
.search-wrap input:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft) !important; }
.nav-tg-btn {
  background: var(--grad) !important; border: 0 !important; color: #fff !important;
  border-radius: 12px !important; padding: 8px 16px !important; font-weight: 800 !important;
  box-shadow: 0 6px 20px rgba(91,75,255,.28);
}
.nav-tg-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.theme-toggle {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-1);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.05rem; transition: background .2s, transform .2s;
}
.theme-toggle:hover { background: var(--surface-3); transform: rotate(-12deg); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: inline; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
.nav-burger span { background: var(--text-1) !important; }

/* Mobile drawer */
.mobile-nav { background: var(--surface) !important; border-left: 1px solid var(--line) !important; }
.mobile-nav a { color: var(--text-2) !important; border-radius: 12px; }
.mobile-nav a:hover { background: var(--surface-2) !important; color: var(--text-1) !important; }
.mobile-nav-close { color: var(--text-2) !important; }
.mn-sep { background: var(--line) !important; }

/* ── Ticker (calmer) ────────────────────────────────────── */
.ticker-wrap { background: var(--bg-2) !important; border-bottom: 1px solid var(--line) !important; }
.ticker-wrap::before { background: linear-gradient(to left, var(--bg-2), transparent) !important; }
.ticker-wrap::after { background: linear-gradient(to right, var(--bg-2), transparent) !important; }
.ticker-badge { background: var(--hot) !important; box-shadow: none !important; animation: none !important; }
.ticker-item a { color: var(--text-2) !important; }
.ticker-item a:hover { color: var(--text-1) !important; }
.ticker-dot { color: var(--accent) !important; }

/* ── Download hero ──────────────────────────────────────── */
.dl-hero {
  position: relative; z-index: 1; overflow: hidden;
  padding: 64px 28px 56px;
  background:
    radial-gradient(900px 380px at 85% -10%, rgba(124,111,255,.22), transparent 60%),
    radial-gradient(700px 320px at 0% 110%, rgba(34,211,238,.14), transparent 60%);
  border-bottom: 1px solid var(--line);
}
:root[data-theme="light"] .dl-hero {
  background:
    radial-gradient(900px 380px at 85% -10%, rgba(91,75,255,.12), transparent 60%),
    radial-gradient(700px 320px at 0% 110%, rgba(8,145,178,.10), transparent 60%);
}
.dl-hero-inner { max-width: 880px; margin: 0 auto; text-align: center; }
.dl-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text-2); font-size: .8rem; font-weight: 600; box-shadow: var(--shadow-1);
}
.dl-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(52,211,153,.18); }
.dl-title {
  font-size: clamp(1.7rem, 4.2vw, 2.75rem); font-weight: 900; line-height: 1.35;
  color: var(--text-1); margin-bottom: 14px; letter-spacing: -.3px;
}
.dl-title .grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.dl-sub { color: var(--text-3); font-size: 1rem; max-width: 620px; margin: 0 auto 28px; line-height: 1.9; }
.dl-box {
  display: flex; gap: 8px; align-items: center;
  max-width: 680px; margin: 0 auto;
  padding: 8px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2);
  transition: border-color .2s, box-shadow .2s;
}
.dl-box:focus-within { border-color: var(--accent); box-shadow: var(--shadow-2), 0 0 0 4px var(--accent-soft); }
.dl-box .dl-plat-ico {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); font-size: 1.25rem; transition: transform .25s;
}
.dl-box.detected .dl-plat-ico { transform: scale(1.08); background: var(--accent-soft); }
.dl-box input {
  flex: 1; min-width: 0; height: 46px; border: 0; outline: 0; background: transparent;
  color: var(--text-1); font-family: inherit; font-size: .98rem; direction: ltr; text-align: left;
  padding: 0 6px;
}
.dl-box input::placeholder { color: var(--text-3); direction: rtl; text-align: right; }
.dl-paste {
  height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text-2); font-family: inherit; font-weight: 700;
  font-size: .85rem; cursor: pointer; flex-shrink: 0;
}
.dl-paste:hover { color: var(--text-1); background: var(--surface-3); }
.dl-go {
  height: 46px; padding: 0 22px; border: 0; border-radius: 13px; cursor: pointer;
  background: var(--grad); color: #fff; font-family: inherit; font-weight: 900; font-size: .95rem;
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(91,75,255,.35); transition: transform .15s, filter .2s;
}
.dl-go:hover { filter: brightness(1.08); transform: translateY(-1px); }
.dl-go:active { transform: translateY(1px); }
.dl-hint { margin-top: 12px; font-size: .8rem; color: var(--text-3); min-height: 1.4em; }
.dl-hint.ok { color: var(--ok); }
.dl-hint.err { color: var(--hot); }
.dl-steps {
  display: flex; justify-content: center; gap: 10px 26px; flex-wrap: wrap;
  margin-top: 18px; font-size: .84rem; color: var(--text-3);
}
.dl-steps span { display: inline-flex; align-items: center; gap: 8px; }
.dl-steps b {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink); font-size: .75rem;
}

/* Platforms grid */
.plat-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px;
  max-width: 980px; margin: 34px auto 0;
}
.plat {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 8px 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text-2); font-size: .82rem; font-weight: 700;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.plat:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow-1); color: var(--text-1); }
.plat .ico {
  width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; color: #fff;
}
.plat small { font-size: .7rem; font-weight: 500; color: var(--text-3); }
.ico.ig { background: linear-gradient(45deg,#f9a825,#e91e63 50%,#8e24aa); }
.ico.yt { background: #ff0033; }
.ico.tt { background: #111; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.ico.sp { background: #1db954; }
.ico.sc { background: linear-gradient(180deg,#ff8800,#ff3300); }
.ico.pin { background: #e60023; }
.ico.gh { background: #24292f; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }

/* Stats strip */
.stat-strip {
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 30px;
}
.stat-strip .st {
  display: flex; align-items: baseline; gap: 6px; padding: 8px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: .8rem; color: var(--text-3);
}
.stat-strip .st b { color: var(--text-1); font-size: 1rem; font-weight: 900; }

/* ── Featured article ───────────────────────────────────── */
.feat {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 0; margin-top: 34px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-1); transition: box-shadow .25s, transform .25s;
}
.feat:hover { box-shadow: var(--shadow-2); }
.feat-img { position: relative; overflow: hidden; min-height: 280px; background: var(--surface-2); }
.feat-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.feat:hover .feat-img img { transform: scale(1.04); }
.feat-body { padding: 30px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.feat-kicker { font-size: .78rem; font-weight: 800; color: var(--accent-ink); display: flex; gap: 8px; align-items: center; }
.feat-title { font-size: 1.4rem; line-height: 1.55; color: var(--text-1); font-weight: 900; }
.feat-title a { color: inherit; }
.feat-title a:hover { color: var(--accent-ink); }
.feat-ex { color: var(--text-3); font-size: .92rem; line-height: 1.9;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feat-meta { font-size: .78rem; color: var(--text-3); display: flex; gap: 14px; }

/* ── Buttons / badges ───────────────────────────────────── */
.btn::after { display: none; }
.btn { border-radius: 12px; }
.btn-primary { background: var(--grad) !important; box-shadow: 0 8px 22px rgba(91,75,255,.28) !important; color: #fff !important; }
.btn-cyan { background: var(--grad) !important; color: #fff !important; box-shadow: 0 8px 22px rgba(91,75,255,.28); }
.btn-outline { background: var(--surface-2) !important; color: var(--text-1) !important; border: 1px solid var(--line) !important; }
.btn-outline:hover { background: var(--surface-3) !important; }
.badge { border-radius: 8px; font-weight: 800; }
.badge-cyan { background: var(--cyan-dim); color: var(--accent-2); border-color: transparent; }
.badge-purple { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.badge-hot { background: rgba(251,113,133,.13); color: var(--hot); border-color: transparent; animation: none; }

/* ── Section head / tabs ────────────────────────────────── */
.sec-head h2 { color: var(--text-1); font-size: 1.2rem; }
.sec-head .line { background: var(--line); }
.cat-tabs {
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 26px 0 6px;
  -webkit-overflow-scrolling: touch;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0; background: var(--surface) !important; color: var(--text-2) !important;
  border: 1px solid var(--line) !important; font-weight: 700; box-shadow: none !important;
  backdrop-filter: none;
}
.cat-tab:hover { color: var(--text-1) !important; border-color: var(--line-2) !important; }
.cat-tab.active { background: var(--text-1) !important; color: var(--bg) !important; border-color: var(--text-1) !important; }

/* ── Cards ──────────────────────────────────────────────── */
.cards-grid { gap: 20px; }
.card {
  background: var(--surface) !important; backdrop-filter: none !important;
  box-shadow: 0 0 0 1px var(--line) !important; border-radius: var(--r) !important;
  transform: none; position: relative;
}
.card::before { display: none; }
.card:hover { box-shadow: 0 0 0 1px var(--line-2), var(--shadow-2) !important; transform: translateY(-4px) !important; }
.card-thumb { background: var(--surface-2); object-position: right center; }
.card:hover .card-thumb { transform: scale(1.05); }
.card-title { color: var(--text-1); font-size: 1rem; line-height: 1.6; }
.card:hover .card-title { color: var(--accent-ink); }
.card-excerpt { color: var(--text-3); font-size: .84rem; line-height: 1.8; }
.card-footer { border-top: 1px solid var(--line) !important; color: var(--text-3); }
/* make whole card clickable */
.card .card-link-cover { position: absolute; inset: 0; z-index: 1; }
.card .card-link-cover:focus-visible { outline-offset: -3px; border-radius: var(--r); }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar { top: 84px; }
.sidebar-widget { background: var(--surface) !important; border: 1px solid var(--line) !important; backdrop-filter: none; }
.widget-head { background: transparent !important; border-bottom: 1px solid var(--line) !important; color: var(--text-1); font-weight: 800; }
.trending-item { border-bottom: 1px solid var(--line) !important; }
.trending-item:hover { background: var(--surface-2) !important; }
.trend-title { color: var(--text-2); }
.trend-num.n2 { background: var(--accent-soft); color: var(--accent-ink); }
.trend-num.n3 { background: var(--cyan-dim); color: var(--accent-2); }
.trend-num.n4, .trend-num.n5 { background: var(--surface-2); color: var(--text-3); }
.channel-widget {
  background: var(--grad) !important; border: 0 !important; color: #fff;
  box-shadow: 0 14px 36px rgba(91,75,255,.28);
}
.channel-widget::before { display: none; }
.channel-widget h3 { color: #fff; font-size: 1.02rem; margin-bottom: 6px; }
.channel-widget p { color: rgba(255,255,255,.86) !important; }
.channel-widget .btn { background: #fff !important; color: #2b1fd1 !important; box-shadow: none !important; }

/* ── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb { color: var(--text-3); }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent-ink); }
.bc-current { color: var(--text-2); }

/* ── Article ────────────────────────────────────────────── */
.art-head { border-bottom: 0 !important; padding-bottom: 18px; margin-bottom: 22px; }
.art-head h1 { color: var(--text-1); font-size: clamp(1.5rem, 3.6vw, 2.2rem); line-height: 1.5; }
.art-meta { color: var(--text-3); }
.art-chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .78rem; color: var(--text-3); }
.art-chips .chip { padding: 3px 10px; border-radius: 8px; background: var(--surface-2); }
.art-hero-img { border: 1px solid var(--line) !important; box-shadow: var(--shadow-1) !important; border-radius: var(--r-lg); }
.art-hero-img:hover img { transform: none; }
.art-body { font-size: 1.07rem; line-height: 2.15; color: var(--text-2); }
.art-body h2 {
  color: var(--text-1); border-right: 0 !important; padding-right: 0 !important;
  font-size: 1.38rem; margin: 42px 0 14px; scroll-margin-top: 90px;
  display: flex; gap: 10px; align-items: baseline;
}
.art-body h2::before { content: ""; width: 6px; height: 1.05em; border-radius: 3px; background: var(--grad); flex-shrink: 0; transform: translateY(3px); }
.art-body h3 {
  color: var(--text-1) !important; scroll-margin-top: 90px; font-size: 1.22rem; font-weight: 800;
  margin: 36px 0 12px; display: flex; gap: 10px; align-items: baseline; line-height: 1.6;
}
.art-body h3::before { content: ""; width: 5px; height: 1em; border-radius: 3px; background: var(--grad); flex-shrink: 0; transform: translateY(3px); }
.art-body a { color: var(--accent-ink); text-decoration: underline; text-decoration-color: var(--accent-soft); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.art-body a:hover { text-decoration-color: var(--accent); }
.art-body strong { color: var(--text-1); }
.art-body ul, .art-body ol { padding-right: 22px; margin-bottom: 18px; }
.art-body li { margin-bottom: 8px; }
.art-body li::marker { color: var(--accent); }
.art-body blockquote {
  margin: 22px 0; padding: 16px 20px; border-radius: 14px;
  background: var(--surface-2); border-right: 4px solid var(--accent); color: var(--text-1);
}
.art-body code { background: var(--surface-2); color: var(--text-1); padding: 2px 7px; border-radius: 6px; font-size: .9em; direction: ltr; unicode-bidi: embed; }
.art-body pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; overflow-x: auto; direction: ltr; text-align: left; margin-bottom: 18px; }
.art-body pre code { background: none; padding: 0; }
.art-body img { max-width: 100%; height: auto; border-radius: 14px; }
.art-body table { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: .92rem; display: block; overflow-x: auto; }
.art-body th, .art-body td { border: 1px solid var(--line); padding: 8px 12px; }
.art-body th { background: var(--surface-2); color: var(--text-1); }

.toc {
  margin: 0 0 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  overflow: hidden;
}
.toc summary {
  list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 800; color: var(--text-1);
  display: flex; align-items: center; justify-content: space-between; font-size: .95rem;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "▾"; color: var(--text-3); transition: transform .2s; }
.toc[open] summary::after { transform: rotate(180deg); }
.toc ol { list-style: none; counter-reset: t; padding: 0 18px 14px; margin: 0; }
.toc li { counter-increment: t; border-top: 1px solid var(--line); }
.toc li a { display: flex; gap: 10px; padding: 9px 0; color: var(--text-2); font-size: .9rem; line-height: 1.6; }
.toc li a::before { content: counter(t, persian); color: var(--accent-ink); font-weight: 800; min-width: 1.2em; }
.toc li a:hover, .toc li a.on { color: var(--accent-ink); }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tag-list a {
  font-size: .8rem; padding: 5px 12px; border-radius: 10px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
}
.tag-list a:hover { color: var(--accent-ink); border-color: var(--accent); }

.share-bar { background: var(--surface) !important; border: 1px solid var(--line) !important; border-radius: 16px !important; backdrop-filter: none; }
.share-btn { border: 1px solid var(--line) !important; color: var(--text-1) !important; background: var(--surface-2) !important; border-radius: 10px !important; font-weight: 700; padding: 8px 14px !important; }
.share-btn:hover { border-color: var(--accent) !important; }
.share-btn.ok { border-color: var(--ok) !important; color: var(--ok) !important; }
.art-source { background: var(--surface-2) !important; border-right: 3px solid var(--accent) !important; color: var(--text-3); border-radius: 12px; }

.art-cta {
  background: var(--grad) !important; border: 0 !important; color: #fff; border-radius: var(--r-lg);
  box-shadow: 0 18px 44px rgba(91,75,255,.3); text-align: right !important;
  display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: center; padding: 28px 30px !important;
}
.art-cta::before { display: none; }
.art-cta h2 { color: #fff; font-size: 1.2rem; margin: 0; }
.art-cta p { color: rgba(255,255,255,.88) !important; margin: 0 !important; grid-column: 1; }
.art-cta .btn { grid-column: 2; grid-row: 1 / span 2; background: #fff !important; color: #2b1fd1 !important; box-shadow: none !important; font-weight: 900; padding: 13px 22px; }
.art-cta .plats { grid-column: 1; display: flex; gap: 6px; margin-top: 6px; }
.art-cta .plats .ico { width: 30px; height: 30px; border-radius: 9px; font-size: .9rem; display: inline-flex; align-items: center; justify-content: center; }

.howto-box { margin: 26px 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.howto-box h2 { font-size: 1.02rem; color: var(--text-1); margin-bottom: 12px; }
.howto-box ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.howto-box a {
  display: inline-block; font-size: .84rem; padding: 7px 13px; border-radius: 10px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
}
.howto-box a:hover { color: var(--accent-ink); border-color: var(--accent); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 30px 0 0; }

/* ── Pagination ─────────────────────────────────────────── */
.page-btn { background: var(--surface) !important; border: 1px solid var(--line) !important; color: var(--text-2) !important; backdrop-filter: none; font-weight: 700; }
.page-btn:hover { border-color: var(--line-2) !important; color: var(--text-1) !important; box-shadow: none !important; }
.page-btn.on { background: var(--text-1) !important; color: var(--bg) !important; border-color: var(--text-1) !important; box-shadow: none !important; }

/* ── FAQ ────────────────────────────────────────────────── */
.faq-section { background: transparent !important; border-top: 1px solid var(--line) !important; position: relative; z-index: 1; }
.faq-title { color: var(--text-1) !important; }
.faq-item { background: var(--surface) !important; border: 1px solid var(--line) !important; border-radius: 14px !important; }
.faq-item summary { color: var(--text-1) !important; }
.faq-item p { color: var(--text-2) !important; }
.faq-item[open] { border-color: var(--line-2) !important; }

/* ── Footer ─────────────────────────────────────────────── */
.footer { background: var(--bg-2) !important; border-top: 1px solid var(--line) !important; position: relative; z-index: 1; }
.footer-logo { color: var(--text-1) !important; background: none !important; -webkit-text-fill-color: currentColor !important; display: flex; align-items: center; gap: 10px; }
.footer-logo img { width: 32px; height: 32px; border-radius: 9px; }
.footer-desc { color: var(--text-3) !important; }
.footer-col h3 { color: var(--text-1) !important; }
.footer-col a { color: var(--text-3) !important; }
.footer-col a:hover { color: var(--accent-ink) !important; }
.footer-bottom { border-top: 1px solid var(--line) !important; color: var(--text-3) !important; }
.soc-btn { background: var(--surface) !important; border: 1px solid var(--line) !important; color: var(--text-1) !important; border-radius: 12px !important; }
.soc-btn:hover { border-color: var(--accent) !important; }

/* ── Back to top / toast ────────────────────────────────── */
#btt { background: var(--surface) !important; color: var(--text-1) !important; border: 1px solid var(--line-2) !important; box-shadow: var(--shadow-1) !important; border-radius: 14px !important; }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 9500;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text-1); color: var(--bg); padding: 12px 18px; border-radius: 14px;
  font-size: .88rem; font-weight: 700; box-shadow: var(--shadow-2);
  transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Mobile bottom tab bar ──────────────────────────────── */
.tabbar { display: none; }
@media (max-width: 768px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; bottom: 0; right: 0; left: 0; z-index: 600;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--nav-bg); border-top: 1px solid var(--line);
    backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 0; border-radius: 12px; color: var(--text-3); font-size: .7rem; font-weight: 700;
  }
  .tabbar a .ti { font-size: 1.25rem; line-height: 1.2; }
  .tabbar a.on { color: var(--text-1); background: var(--surface-2); }
  .tabbar a.cta { color: #fff; background: var(--grad); }
  #btt { bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .nav-tg-btn { display: none !important; }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .plat-grid { grid-template-columns: repeat(4, 1fr); }
  .feat { grid-template-columns: 1fr; }
  .feat-img { min-height: 0; aspect-ratio: 16/9; }
}
@media (max-width: 768px) {
  .dl-hero { padding: 36px 16px 34px; }
  .dl-sub { font-size: .92rem; margin-bottom: 20px; }
  .dl-box { flex-wrap: wrap; padding: 8px; border-radius: 16px; }
  .dl-box input { flex-basis: calc(100% - 60px); }
  .dl-paste { flex: 0 0 auto; height: 46px; }
  .dl-go { flex: 1; justify-content: center; }
  .dl-steps { gap: 8px 16px; font-size: .78rem; }
  .plat-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 24px; }
  .plat { padding: 12px 4px 10px; font-size: .74rem; border-radius: 14px; }
  .plat .ico { width: 38px; height: 38px; font-size: 1.15rem; }
  .plat small { display: none; }
  .feat-body { padding: 20px; }
  .feat-title { font-size: 1.15rem; }
  .art-cta { grid-template-columns: 1fr; text-align: center !important; }
  .art-cta .btn, .art-cta p, .art-cta .plats { grid-column: 1; grid-row: auto; justify-self: center; justify-content: center; }
  .art-body { font-size: 1.03rem; line-height: 2.05; }
  .wrap, .wrap-sm { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 420px) {
  .plat-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-strip .st { padding: 6px 12px; }
}

/* ── v5.1: clear button, direct download, articles CTA, image fixes ── */
html { scroll-padding-top: 76px; }
.dl-box { flex-direction: column; align-items: stretch; gap: 8px; }
.dl-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dl-row input { flex: 1; min-width: 0; }
.dl-clear {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--surface-3); color: var(--text-1); font-size: .95rem; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
}
.dl-clear[hidden] { display: none; }
.dl-clear:hover { background: var(--hot); color: #fff; }
.dl-actions { display: grid; grid-template-columns: 1.15fr 1fr; gap: 8px; }
.dl-go { justify-content: center; flex-direction: row; height: 50px; }
.dl-go small { font-weight: 600; font-size: .72rem; opacity: .9; background: rgba(255,255,255,.2); padding: 2px 8px; border-radius: 999px; }
.dl-direct {
  height: 50px; border-radius: 13px; cursor: pointer; font-family: inherit; font-weight: 800; font-size: .9rem;
  background: var(--surface-2); color: var(--text-1); border: 1px solid var(--line-2);
  transition: background .2s, border-color .2s;
}
.dl-direct:hover { background: var(--surface-3); border-color: var(--accent); }
.dl-direct[disabled], .dl-go[disabled] { opacity: .6; cursor: progress; }
.dl-note { max-width: 680px; margin: 14px auto 0; font-size: .8rem; color: var(--text-3); line-height: 1.9; }
.dl-result {
  max-width: 680px; margin: 16px auto 0; padding: 16px; border-radius: 18px; text-align: right;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-1);
}
.dl-result[hidden] { display: none; }
.dl-result .spin { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: .92rem; }
.dl-result .spin::before {
  content: ""; width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
.dl-result video, .dl-result audio, .dl-result img { width: 100%; border-radius: 12px; display: block; background: #000; }
.dl-result video, .dl-result img { max-height: 420px; object-fit: contain; }
.dl-result audio { background: transparent; }
.dl-result .f-name { font-size: .84rem; color: var(--text-2); margin: 10px 0; direction: ltr; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-result .f-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.dl-result .f-btns a {
  flex: 1; min-width: 150px; text-align: center; padding: 12px; border-radius: 12px; font-weight: 800; font-size: .9rem;
  background: var(--grad); color: #fff;
}
.dl-result .f-btns a.alt { background: var(--surface-2); color: var(--text-1); border: 1px solid var(--line); }
.dl-result .f-left { margin-top: 10px; font-size: .78rem; color: var(--text-3); }
.dl-result .msg { color: var(--text-1); font-size: .92rem; line-height: 1.9; margin-bottom: 12px; }

.to-articles {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 28px;
  padding: 13px 22px; border-radius: 999px; font-weight: 800; font-size: .95rem;
  background: var(--surface); color: var(--text-1); border: 1px solid var(--line-2); box-shadow: var(--shadow-1);
  transition: transform .2s, border-color .2s;
}
.to-articles:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent-ink); }
.to-articles span { animation: nudge 1.6s ease-in-out infinite; color: var(--accent-ink); }
@keyframes nudge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
.stat-strip { margin-top: 18px; }

/* covers are 1200×630 — never crop them */
.card-thumb { aspect-ratio: 1200 / 630 !important; height: auto; object-fit: cover; object-position: center; }
.cards-grid .card:first-child { grid-column: auto; }
.cards-grid .card:first-child .card-title { font-size: 1rem; }
.card:hover .card-thumb { transform: none; }
.art-hero-img { max-height: none !important; }
.art-hero-img img { max-height: none !important; height: auto; aspect-ratio: auto; object-fit: contain; }
.feat { align-items: stretch; }
.feat-img { min-height: 0; aspect-ratio: 1200 / 630; align-self: center; }
.feat:hover .feat-img img { transform: none; }

@media (max-width: 768px) {
  .dl-actions { grid-template-columns: 1fr; }
  .dl-box input { flex-basis: auto; }
  .dl-paste { height: 42px; padding: 0 12px; }
  .to-articles { width: 100%; justify-content: center; margin-top: 22px; }
  .tabbar a.on:not(.cta) { color: var(--accent-ink); }
}
.dl-box, .dl-row { width: 100%; box-sizing: border-box; }
.dl-row input { width: 0; }
.dl-hero-inner { min-width: 0; }
.dl-result .f-item + .f-item { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.dl-result .f-links { display: grid; gap: 8px; }
.dl-result .f-link {
  display: block; padding: 11px 14px; border-radius: 12px; font-size: .86rem; font-weight: 700;
  background: var(--surface-2); color: var(--text-1); border: 1px solid var(--line);
  direction: ltr; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dl-result .f-link:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ── v5.3: download ⇄ articles switch, brand logos ── */
.mode-switch { display: flex; gap: 6px; width: max-content; max-width: calc(100% - 32px); margin: 18px auto 0; padding: 5px;
  background: var(--surface-1, rgba(127,127,127,.12)); border: 1px solid var(--line-1, rgba(127,127,127,.25)); border-radius: 999px; position: relative; z-index: 2; }
.mode-switch a { padding: 10px 26px; border-radius: 999px; font-weight: 700; font-size: .95rem; color: var(--text-2); text-decoration: none; white-space: nowrap; transition: .2s; }
.mode-switch a.on { background: linear-gradient(90deg,#22d3ee,#6d6cff); color: #fff; box-shadow: 0 6px 18px rgba(99,102,241,.35); }
.arts-head { text-align: center; padding: 34px 16px 6px; }
.arts-head h1 { font-size: clamp(1.4rem, 4.5vw, 2.1rem); font-weight: 900; color: var(--text-1); margin: 0 0 10px; }
.arts-head p { color: var(--text-2); max-width: 620px; margin: 0 auto; line-height: 2; font-size: .95rem; }
.magazine-layout.no-side { display: block; }
.ico i { display: block; width: 58%; height: 58%; background: #fff;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ico.ig { --m: url(/static/brand/instagram.svg); background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.ico.yt { --m: url(/static/brand/youtube.svg); background: #ff0000; }
.ico.tt { --m: url(/static/brand/tiktok.svg); background: #010101; }
.ico.sp { --m: url(/static/brand/spotify.svg); background: #1ed760; }
.ico.sp i { background: #000; }
.ico.sc { --m: url(/static/brand/soundcloud.svg); background: #ff5500; }
.ico.pin { --m: url(/static/brand/pinterest.svg); background: #e60023; }
.ico.gh { --m: url(/static/brand/github.svg); background: #181717; }
.plat .ico, .art-cta .plats .ico { display: inline-flex; align-items: center; justify-content: center; }

/* 2026-11-21 article: «خلاصه در یک نگاه» box + FAQ questions */
.art-body .tldr-box { background: var(--accent-soft); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px 4px; margin: 6px 0 22px; }
.art-body .tldr-box ul { margin-bottom: 10px; }
.art-body .tldr-box li { color: var(--text-1); font-weight: 500; }
.art-body h3.faq-q { font-size: 1.02rem; margin: 18px 0 6px; }
.art-body ol li { padding-right: 4px; }
