/* ===================== Ads — slim sponsored rows + download call-to-action ===================== */
/* One line, three parts: image · "Sponsored" + title · button. Used in project comments and between Explore cards. */
.kad {
  --kad-line: #e3e6ef; --kad-bg: #f7f8fc; --kad-ink: #161c30; --kad-muted: #7a8398; --kad-accent: #6a5cf0;
  align-items: center; background: var(--kad-bg); border: 1px solid var(--kad-line); border-radius: 12px;
  box-sizing: border-box; display: flex; gap: 10px; min-width: 0; padding: 6px 8px 6px 6px; width: 100%;
}
body[data-theme="dark"] .kad { --kad-line: rgba(255,255,255,.09); --kad-bg: #1e1e1e; --kad-ink: #f1f3fa; --kad-muted: #8f98ae; --kad-accent: #8b7bff; }
.kad-thumb { background: #e9ecf5; border-radius: 8px; flex: 0 0 auto; height: 40px; object-fit: cover; width: 40px; }
.kad-text { display: flex; flex: 1 1 auto; flex-direction: column; gap: 1px; min-width: 0; }
.kad-tag { color: var(--kad-muted); font-size: 9.5px; font-weight: 800; letter-spacing: .07em; line-height: 1.2; text-transform: uppercase; }
.kad-title { color: var(--kad-ink); font-size: 12.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kad-btn {
  align-items: center; background: var(--kad-accent); border-radius: 999px; color: #fff; display: inline-flex; flex: 0 0 auto;
  font-size: 11.5px; font-weight: 800; gap: 4px; line-height: 1; max-width: 42%; padding: 8px 12px; text-decoration: none;
  transition: filter .15s ease, transform .15s ease; white-space: nowrap;
}
.kad-btn:hover { filter: brightness(1.08); }
.kad-btn:active { transform: scale(.97); }
.kad-btn svg { fill: none; flex: 0 0 auto; height: 12px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.4; width: 12px; }
body[data-theme="dark"] .kad-btn { color: #0f1220; }

/* In the comments page: the smallest version, sits between threads. */
.kad-comments { margin: 8px 12px; width: calc(100% - 24px); }

/* Between Explore cards: roomier, always the full width of the grid. */
.kad-explore { border-radius: 14px; gap: 12px; grid-column: 1 / -1; padding: 8px 10px 8px 8px; }
.kad-explore .kad-thumb { border-radius: 10px; height: 52px; width: 52px; }
.kad-explore .kad-title { font-size: 14px; }
.kad-explore .kad-btn { font-size: 12.5px; padding: 10px 16px; }
.feed-card + .kad-explore, .kad-explore + .feed-card { margin-top: 0; }
@media (max-width: 380px) { .kad-btn { padding: 7px 10px; } .kad-explore .kad-thumb { height: 44px; width: 44px; } }
@media (prefers-reduced-motion: reduce) { .kad-btn { transition: none; } }

/* ===================== Download page: the ad's call-to-action bar ===================== */
.dl-ad-cta {
  align-items: center; background: rgba(255,255,255,.96); border-radius: 16px; box-shadow: 0 14px 40px rgba(0,0,0,.35);
  box-sizing: border-box; display: none; flex: 0 0 auto; gap: 12px; max-width: 560px; padding: 10px 10px 10px 16px;
  position: relative; width: 100%;
}
.dl-stage.has-ad .dl-ad-cta.has-link, .dl-stage.has-ad .dl-ad-cta.has-title { display: flex; }
.dl-ad-cta-text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.dl-ad-cta-text span { color: #7a8398; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.dl-ad-cta-text strong { color: #161c30; font-size: 15px; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-ad-btn {
  align-items: center; background: linear-gradient(135deg, #6a5cf0, #3d83f5); border-radius: 12px; box-shadow: 0 8px 20px rgba(80,92,240,.4);
  color: #fff; display: none; flex: 0 0 auto; font-size: 14px; font-weight: 800; gap: 7px; padding: 13px 20px; text-decoration: none; white-space: nowrap;
}
.dl-ad-cta.has-link .dl-ad-btn { display: inline-flex; }
.dl-ad-btn svg { fill: none; height: 15px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.4; width: 15px; }
.dl-ad-btn:active { transform: scale(.98); }
body[data-theme="dark"] .dl-ad-cta { background: rgba(24,27,44,.94); border: 1px solid rgba(255,255,255,.1); }
body[data-theme="dark"] .dl-ad-cta-text strong { color: #f1f3fa; }
