/* ═══════════════════════════════════════════════════════════
   TelegramGroups.co Design Tokens — standalone CSS
   Loaded BEFORE style.css so custom properties are available.
   Dark mode is the default. Light via [data-theme="light"].
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Backgrounds */
  --bg-0:  #0B0D12;
  --bg-1:  #151820;
  --bg-2:  #1E222C;
  --bg-3:  #262B36;

  /* Borders */
  --border:        #262B36;
  --border-strong: #3A4050;

  /* Text */
  --text:          #F5F7FA;
  --text-muted:    #8C95A8;
  --text-disabled: #545B6B;

  /* Primary — Telegram blue */
  --primary:        #3AA8F5;
  --primary-hover:  #6BBEF7;
  --primary-pressed:#1E7FC4;
  --primary-subtle: rgba(58, 168, 245, 0.12);

  /* Accent — amber */
  --accent:        #F6C453;
  --accent-hover:  #E9B03B;
  --accent-subtle: rgba(246, 196, 83, 0.15);

  /* Semantic */
  --success:        #3DD68C;
  --success-subtle: rgba(61, 214, 140, 0.12);
  --warning:        #F6C453;
  --warning-subtle: rgba(246, 196, 83, 0.12);
  --danger:         #F26B6B;
  --danger-subtle:  rgba(242, 107, 107, 0.12);

  /* Special */
  --pulse:          #3DD68C;
  --boosted-color:  #3AA8F5;
  --featured-color: #F6C453;

  /* Spacing */
  --s1:  4px;
  --s2:  8px;
  --s3:  12px;
  --s4:  16px;
  --s5:  20px;
  --s6:  24px;
  --s8:  32px;
  --s10: 40px;
  --s12: 48px;
  --s16: 64px;
  --s20: 80px;
  --s24: 96px;

  /* Radii */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-xs:   0 1px 2px hsl(220 15% 5% / 0.4);
  --shadow-sm:   0 2px 6px hsl(220 15% 5% / 0.5);
  --shadow-md:   0 8px 20px hsl(220 15% 5% / 0.55);
  --shadow-lg:   0 20px 40px hsl(220 15% 5% / 0.6);
  --shadow-glow: 0 0 24px hsl(215 85% 55% / 0.18);

  /* Motion */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:    120ms;
  --dur-normal:  180ms;
  --dur-slow:    240ms;

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-toast:    500;
  --z-tooltip:  600;

  /* Typography */
  --font-sans: 'Geist Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace;
  --font-body: 'Inter', var(--font-sans);

  /* Type scale */
  --text-caption: 0.75rem;
  --text-sm:      0.875rem;
  --text-base:    1rem;
  --text-lg:      1.125rem;
  --text-xl:      clamp(1.25rem, 1.1rem + 0.5vw, 1.375rem);
  --text-2xl:     clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
  --text-3xl:     clamp(1.875rem, 1.5rem + 1.5vw, 2.5rem);
  --text-display: clamp(2.5rem, 2rem + 2.5vw, 3.75rem);

  /* Weights */
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* Line heights */
  --leading-tight:  1.1;
  --leading-snug:   1.25;
  --leading-normal: 1.5;
  --leading-loose:  1.75;

  /* Tracking */
  --tracking-tight:   -0.02em;
  --tracking-caption:  0.04em;
}

/* ── Light mode ── */
[data-theme="light"] {
  --bg-0:  #FFFFFF;
  --bg-1:  #F7F8FA;
  --bg-2:  #EEF1F5;
  --bg-3:  #E2E6EC;
  --border:        #E2E6EC;
  --border-strong: #CBD1DB;
  --text:          #12141A;
  --text-muted:    #5A6072;
  --text-disabled: #9AA1AF;
  --shadow-xs:   0 1px 2px hsl(220 15% 20% / 0.08);
  --shadow-sm:   0 2px 6px hsl(220 15% 20% / 0.10);
  --shadow-md:   0 8px 20px hsl(220 15% 20% / 0.12);
  --shadow-glow: 0 0 24px hsl(215 85% 55% / 0.12);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Global base ── */
html {
  font-family: var(--font-body);
  background-color: var(--bg-0);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  transition: background-color var(--dur-normal) var(--ease-out),
              color var(--dur-normal) var(--ease-out);
}

/* ── Utility: mono numbers ── */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ── Utility: chip ── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: 2px var(--s2);
  border-radius: var(--r-full);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-caption);
  text-transform: uppercase;
  background: var(--bg-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}

.chip:hover {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--primary);
  text-decoration: none;
}

/* ── Utility: buttons ── */
.btn-primary-tg {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s5);
  border-radius: var(--r-md);
  background: var(--primary);
  color: #fff !important;
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.btn-primary-tg:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-primary-tg:active { background: var(--primary-pressed); transform: translateY(0); }

.btn-ghost-tg {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s5);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-muted);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  text-decoration: none;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.btn-ghost-tg:hover {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--border-strong);
  text-decoration: none;
}

.btn-accent-tg {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s5);
  border-radius: var(--r-md);
  background: var(--accent);
  color: #0B0D12;
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background var(--dur-fast), transform var(--dur-fast);
}

.btn-accent-tg:hover {
  background: var(--accent-hover);
  color: #0B0D12;
  transform: translateY(-1px);
  text-decoration: none;
}

/* ── Badges ── */
.badge-featured {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.badge-boosted {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.badge-category {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: var(--weight-medium);
  background: var(--bg-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all var(--dur-fast);
}

.badge-category:hover {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--primary);
  text-decoration: none;
}

/* ── item-list wrapper ── */
.item-list {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* ── item-row ── */
.item-row {
  position: relative;
  border-bottom: 1px solid var(--border);
  transition: background var(--dur-fast) var(--ease-out);
}

.item-row:last-child { border-bottom: none; }
.item-row:hover { background: var(--bg-1); }

.item-row--featured { border-left: 3px solid var(--featured-color); }
.item-row--boosted  { border-left: 3px solid var(--boosted-color); }

.item-row__inner {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4);
  text-decoration: none;
  color: inherit;
  min-height: 80px;
}

.item-row__inner:hover { text-decoration: none; color: inherit; }

.item-row__avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--r-lg);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-2);
}

.item-row__avatar-fallback {
  width: 56px;
  height: 56px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
  font-weight: var(--weight-bold);
  color: #fff;
  background: var(--primary);
}

.item-row__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.item-row__name {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.item-row__desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-row__badge {
  display: none;
  align-items: center;
  padding: 2px 6px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  flex-shrink: 0;
}

.item-row--featured .item-row__badge--featured,
.item-row--boosted  .item-row__badge--boosted  { display: inline-flex; }

.item-row__badge--featured { background: var(--accent-subtle); color: var(--accent); border: 1px solid var(--accent); }
.item-row__badge--boosted  { background: var(--primary-subtle); color: var(--primary); border: 1px solid var(--primary); }

.item-row__meta {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-shrink: 0;
  margin-left: auto;
}

.item-row__subs {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text);
  white-space: nowrap;
}

.item-row__chip {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--s2);
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: var(--weight-medium);
  background: var(--bg-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.item-row__view-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px var(--s3);
  border-radius: var(--r-md);
  background: var(--primary);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  text-decoration: none;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity var(--dur-fast), transform var(--dur-fast);
  flex-shrink: 0;
}

.item-row:hover .item-row__view-btn { opacity: 1; transform: translateX(0); }

/* ── Pulse dot ── */
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pulse);
  flex-shrink: 0;
  animation: pulse-ring 2.5s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(0.88); opacity: 0.75; }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .item-row__inner { padding: var(--s3); gap: var(--s3); }
  .item-row__avatar, .item-row__avatar-fallback { width: 44px; height: 44px; }
  .item-row__subs, .item-row__chip { display: none; }
  .item-row__view-btn { display: none; }
}

/* ── Category tints (used on hero sections) ── */
.category-tint-bg, .detail-hero {
  background:
    radial-gradient(circle at 25% 40%, hsl(var(--tint, 215 85% 55%) / 0.14), transparent 60%),
    var(--bg-0);
}

/* ── Detail page layout ── */
.detail-hero {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

.detail-hero__inner {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--s6);
}

/* 3-column grid: avatar | info | aside */
.detail-hero__row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: var(--s5);
  align-items: center;
}

.detail-hero__avatar {
  width: 120px;
  height: 120px;
  border-radius: var(--r-lg);
  object-fit: cover;
  border: 2px solid var(--border-strong);
  background: var(--bg-2);
  display: block;
}

.detail-hero__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.detail-hero__name {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--text);
  margin: 0;
  line-height: var(--leading-tight);
}

/* Right column: stat + actions stacked */
.detail-hero__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--s3);
  flex-shrink: 0;
}

.detail-hero__stat {
  font-family: var(--font-mono);
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.03em;
  text-align: right;
}

.detail-hero__stat-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  color: var(--text-muted);
  font-family: var(--font-sans);
  letter-spacing: normal;
  text-align: right;
}

.detail-hero__actions {
  display: flex;
  gap: var(--s2);
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Tablet: stack aside below info */
@media (max-width: 900px) {
  .detail-hero__row {
    grid-template-columns: 100px 1fr;
    grid-template-rows: auto auto;
  }
  .detail-hero__avatar { width: 100px; height: 100px; grid-row: 1; grid-column: 1; }
  .detail-hero__info   { grid-row: 1; grid-column: 2; }
  .detail-hero__aside  {
    grid-row: 2;
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .detail-hero__stat { text-align: left; }
  .detail-hero__stat-label { text-align: left; }
  .detail-hero__actions { justify-content: flex-start; }
}

/* Mobile: smaller avatar, full-width actions */
@media (max-width: 480px) {
  .detail-hero { padding: 24px 0; }
  .detail-hero__inner { padding: 0 var(--s4); }
  .detail-hero__row {
    grid-template-columns: 72px 1fr;
  }
  .detail-hero__avatar { width: 72px; height: 72px; border-radius: var(--r-md); }
  .detail-hero__name   { font-size: var(--text-xl); }
  .detail-hero__aside  {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s3);
  }
  .detail-hero__actions { width: 100%; }
  .detail-hero__actions .btn-primary-tg,
  .detail-hero__actions .btn-ghost-tg { flex: 1; justify-content: center; text-align: center; }
}

.detail-body {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--s8) var(--s6);
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--s8);
}

.detail-body__main { min-width: 0; display: flex; flex-direction: column; gap: var(--s6); }
.detail-body__sidebar { display: flex; flex-direction: column; gap: var(--s4); }

@media (max-width: 991px) {
  .detail-body { grid-template-columns: 1fr; }
}

/* ── Detail hero misc ── */
.detail-hero__badges {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
}

.badge-unavailable {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-sm);
  background: var(--danger-subtle);
  border: 1px solid var(--danger);
  color: var(--danger);
  font-size: 12px;
  font-weight: var(--weight-semibold);
}


.detail-hero__report {
  font-size: var(--text-sm);
  color: var(--text-disabled);
  text-decoration: none;
  transition: color var(--dur-fast);
}
.detail-hero__report:hover { color: var(--danger); }

.detail-hero__desc {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-normal);
  max-width: 540px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Boost CTA ── */
.boost-cta {
  background: var(--bg-1);
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  padding: var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.boost-cta__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text);
  margin: 0;
}

.boost-cta__desc { font-size: var(--text-sm); color: var(--text-muted); margin: 0; line-height: var(--leading-normal); }
.boost-cta__options { display: flex; flex-direction: column; gap: var(--s2); }

.boost-cta__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-0);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--dur-fast);
}

.boost-cta__btn:hover { border-color: var(--accent); background: var(--accent-subtle); text-decoration: none; color: var(--text); }
.boost-cta__btn-price { font-family: var(--font-mono); color: var(--accent); font-weight: var(--weight-semibold); }
.boost-cta__btn--primary { background: var(--accent-subtle); border-color: var(--accent); }

/* ── TG Header (new navbar) ── */
.tg-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  z-index: var(--z-sticky);
  background: var(--bg-0);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  transition: box-shadow var(--dur-normal);
}

.tg-header.scrolled { box-shadow: var(--shadow-sm); }
.tg-header__inner { display: flex; align-items: center; height: 64px; max-width: 1280px; margin: 0 auto; padding: 0 var(--s6); gap: var(--s4); }
.tg-header__logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.tg-header__logo img { height: 32px; width: auto; }
.tg-header__logo:hover { opacity: 0.85; }
.tg-header__nav { display: flex; align-items: center; gap: var(--s1); flex: 1; margin-left: var(--s4); }
.tg-header__nav-link { padding: var(--s2) var(--s3); border-radius: var(--r-sm); color: var(--text-muted); font-size: var(--text-sm); font-weight: var(--weight-medium); text-decoration: none; transition: color var(--dur-fast), background var(--dur-fast); }
.tg-header__nav-link:hover, .tg-header__nav-link.active { color: var(--text); background: var(--bg-2); text-decoration: none; }
.tg-header__actions { display: flex; align-items: center; gap: var(--s2); flex-shrink: 0; margin-left: auto; }

.tg-search-pill { display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s3); border: 1px solid var(--border); border-radius: var(--r-full); background: var(--bg-1); color: var(--text-muted); font-size: var(--text-sm); cursor: pointer; transition: all var(--dur-fast); white-space: nowrap; }
.tg-search-pill:hover { background: var(--bg-2); border-color: var(--border-strong); color: var(--text); }
.tg-search-pill__shortcut { font-family: var(--font-mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); color: var(--text-disabled); background: var(--bg-2); }

.tg-header__submit-btn { display: inline-flex; align-items: center; gap: var(--s1); padding: 7px var(--s4); border-radius: var(--r-md); background: var(--primary); color: #fff !important; font-size: var(--text-sm); font-weight: var(--weight-semibold); text-decoration: none !important; border: none; cursor: pointer; white-space: nowrap; transition: background var(--dur-fast), transform var(--dur-fast); }
.tg-header__submit-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }

.tg-theme-toggle { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-md); border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; transition: all var(--dur-fast); flex-shrink: 0; }
.tg-theme-toggle:hover { background: var(--bg-2); color: var(--text); border-color: var(--border-strong); }

.tg-header__hamburger { display: none; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-md); border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; }
@media (max-width: 768px) { .tg-header__nav { display: none; } .tg-header__hamburger { display: flex; } }

.skip-to-content { position: absolute; top: -100px; left: var(--s4); padding: var(--s2) var(--s4); background: var(--primary); color: #fff; border-radius: 0 0 var(--r-md) var(--r-md); font-size: var(--text-sm); z-index: 9999; text-decoration: none; }
.skip-to-content:focus { top: 0; }

body { padding-top: 64px; }

/* ── TG Footer ── */
.tg-footer { background: var(--bg-1); border-top: 1px solid var(--border); margin-top: 0; padding: 0; color: var(--text-muted); font-size: var(--text-sm); }
.tg-footer__inner { max-width: 1280px; margin: 0 auto; padding: 0 var(--s6); }
.tg-footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: var(--s10); padding-bottom: var(--s10); }
@media (max-width: 991px) { .tg-footer__grid { grid-template-columns: 1fr 1fr; gap: var(--s8); } }
@media (max-width: 576px)  { .tg-footer__grid { grid-template-columns: 1fr; gap: var(--s6); } }
.tg-footer__brand { display: flex; flex-direction: column; gap: var(--s3); }
.tg-footer__logo { display: flex; align-items: center; text-decoration: none; }
.tg-footer__logo img { height: 28px; }
.tg-footer__tagline { font-size: var(--text-sm); color: var(--text-muted); line-height: var(--leading-normal); max-width: 220px; }
.tg-footer__chatgpt-badge { display: inline-flex; align-items: center; gap: var(--s1); padding: 3px var(--s3); border-radius: var(--r-full); background: var(--success-subtle); color: var(--success); font-size: 11px; font-weight: var(--weight-semibold); width: fit-content; }
.tg-footer__col-title { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text); margin: 0 0 var(--s3); letter-spacing: var(--tracking-caption); text-transform: uppercase; }
.tg-footer__links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.tg-footer__links a { color: var(--text-muted); text-decoration: none; font-size: var(--text-sm); transition: color var(--dur-fast); }
.tg-footer__links a:hover { color: var(--text); text-decoration: none; }
.tg-footer__subscribe { padding: var(--s6) 0; border-bottom: 1px solid var(--border); }
.tg-footer__subscribe-inner { max-width: 1280px; margin: 0 auto; padding: 0 var(--s6); display: flex; align-items: center; justify-content: space-between; gap: var(--s6); }
@media (max-width: 768px) { .tg-footer__subscribe-inner { flex-direction: column; align-items: flex-start; } }
.tg-footer__subscribe-text h4 { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--text); margin: 0 0 var(--s1); }
.tg-footer__subscribe-text p { font-size: var(--text-sm); color: var(--text-muted); margin: 0; }
.tg-footer__subscribe-form { display: flex; gap: var(--s2); flex-shrink: 0; }
.tg-footer__email-input { padding: var(--s2) var(--s4); border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg-0); color: var(--text); font-size: var(--text-sm); width: 260px; outline: none; }
.tg-footer__email-input:focus { border-color: var(--primary); }
.tg-footer__subscribe-btn { padding: var(--s2) var(--s5); border-radius: var(--r-md); background: var(--primary); color: #fff; font-size: var(--text-sm); font-weight: var(--weight-semibold); border: none; cursor: pointer; }
.tg-footer__subscribe-btn:hover { background: var(--primary-hover); }
.tg-footer__bottom { max-width: 1280px; margin: 0 auto; padding: var(--s4) var(--s6); display: flex; align-items: center; justify-content: space-between; gap: var(--s4); font-size: var(--text-sm); color: var(--text-disabled); }
.tg-footer__status { display: flex; align-items: center; gap: var(--s2); color: var(--success); }
.tg-footer__status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: pulse-ring 2s ease-in-out infinite; }
.tg-footer__social { display: flex; gap: var(--s3); }
.tg-footer__social-link { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--r-md); border: 1px solid var(--border); color: var(--text-muted); text-decoration: none; transition: all var(--dur-fast); }
.tg-footer__social-link:hover { background: var(--bg-2); color: var(--text); text-decoration: none; }

/* ── Mobile drawer ── */
.tg-mobile-drawer { position: fixed; inset: 0; z-index: var(--z-overlay); pointer-events: none; opacity: 0; transition: opacity var(--dur-normal); }
.tg-mobile-drawer.open { pointer-events: auto; opacity: 1; }
.tg-mobile-drawer__backdrop { position: absolute; inset: 0; background: hsl(220 15% 2% / 0.7); backdrop-filter: blur(4px); }
.tg-mobile-drawer__panel { position: absolute; bottom: 0; left: 0; right: 0; background: var(--bg-1); border-top: 1px solid var(--border); border-radius: 20px 20px 0 0; padding: var(--s4) var(--s6) calc(var(--s8)); max-height: 80vh; overflow-y: auto; transform: translateY(100%); transition: transform var(--dur-slow) var(--ease-out); }
.tg-mobile-drawer.open .tg-mobile-drawer__panel { transform: translateY(0); }
.tg-mobile-drawer__handle { width: 36px; height: 4px; border-radius: 9999px; background: var(--border-strong); margin: 0 auto var(--s4); }
.tg-mobile-drawer__nav { display: flex; flex-direction: column; gap: var(--s1); }
.tg-mobile-drawer__link { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-md); color: var(--text); font-size: var(--text-base); font-weight: var(--weight-medium); text-decoration: none; transition: background var(--dur-fast); }
.tg-mobile-drawer__link:hover { background: var(--bg-2); text-decoration: none; }
.tg-mobile-drawer__submit { margin-top: var(--s4); width: 100%; padding: var(--s3) var(--s6); border-radius: var(--r-md); background: var(--primary); color: #fff; font-weight: var(--weight-semibold); font-size: var(--text-base); text-align: center; text-decoration: none; display: block; border: none; cursor: pointer; }

/* ── Cmd+K search modal ── */
.cmdk-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: flex; align-items: flex-start; justify-content: center;
  /* 132px = 64px navbar + 44px subnav + 24px breathing room */
  padding: 132px 16px 0;
  background: hsl(220 15% 2% / 0.65);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-normal);
}
.cmdk-overlay.open { opacity: 1; pointer-events: auto; }
.cmdk-panel {
  width: 100%; max-width: 640px;
  background: var(--bg-1); border: 1px solid var(--border-strong);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  overflow: hidden; display: flex; flex-direction: column;
  max-height: calc(100vh - 160px);
  transform: translateY(-10px) scale(0.98); opacity: 0;
  transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur-normal);
}
.cmdk-overlay.open .cmdk-panel { transform: translateY(0) scale(1); opacity: 1; }
.cmdk-input-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.cmdk-input { flex: 1; border: none; background: transparent; color: var(--text); font-size: var(--text-base); outline: none; font-family: var(--font-sans); }
.cmdk-input::placeholder { color: var(--text-disabled); }
.cmdk-close { padding: 4px 8px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--border); color: var(--text-muted); font-size: 11px; cursor: pointer; }
.cmdk-results { max-height: 420px; overflow-y: auto; padding: var(--s2); }
.cmdk-section-title { padding: var(--s2) var(--s3); font-size: var(--text-caption); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caption); text-transform: uppercase; color: var(--text-disabled); }
.cmdk-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r-md); text-decoration: none; color: var(--text); cursor: pointer; transition: background var(--dur-fast); }
.cmdk-item:hover, .cmdk-item.selected { background: var(--bg-2); text-decoration: none; }
.cmdk-item__avatar { width: 36px; height: 36px; border-radius: var(--r-md); object-fit: cover; flex-shrink: 0; background: var(--bg-2); }
.cmdk-item__text { flex: 1; min-width: 0; }
.cmdk-item__name { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item__desc { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item__subs { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.cmdk-footer { padding: var(--s2) var(--s5); border-top: 1px solid var(--border); display: flex; align-items: center; gap: var(--s4); font-size: 11px; color: var(--text-disabled); font-family: var(--font-mono); }
.cmdk-footer kbd { padding: 1px 4px; border-radius: 3px; border: 1px solid var(--border-strong); background: var(--bg-2); }
.cmdk-spinner { display: none; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
.cmdk-spinner.visible { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Bento hero ── */
.bento { padding: var(--s8) 0 var(--s10); background: var(--bg-0); }
.bento__inner { max-width: 1280px; margin: 0 auto; padding: 0 var(--s6); }
.bento__grid { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: minmax(160px, auto); gap: var(--s3); }
@media (max-width: 991px) { .bento__grid { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 576px)  { .bento__grid { grid-template-columns: 1fr; } }
.bento__tile { background: var(--bg-1); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.bento__tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.bento__tile--cotw { grid-column: span 6; grid-row: span 2; display: flex; flex-direction: column; justify-content: flex-end; padding: var(--s6); position: relative; min-height: 340px; }
.bento__tile--search { grid-column: span 6; padding: var(--s5); display: flex; flex-direction: column; justify-content: center; gap: var(--s3); }
.bento__tile--trending { grid-column: span 6; padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.bento__tile--stats { grid-column: span 4; padding: var(--s5); display: flex; flex-direction: column; justify-content: center; gap: var(--s4); }
.bento__tile--submit { grid-column: span 8; padding: var(--s6); display: flex; align-items: center; justify-content: space-between; gap: var(--s4); background: var(--primary-subtle); border-color: var(--primary); text-decoration: none; transition: background var(--dur-fast); }
.bento__tile--submit:hover { background: rgba(58,168,245,.18); text-decoration: none; box-shadow: var(--shadow-glow); }
@media (max-width: 576px) { .bento__tile--cotw, .bento__tile--search, .bento__tile--trending, .bento__tile--stats, .bento__tile--submit { grid-column: span 1; } }
.bento__cotw-label { font-size: var(--text-caption); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caption); text-transform: uppercase; color: var(--primary); margin-bottom: var(--s3); position: relative; }
.bento__cotw-inner { display: flex; gap: var(--s4); align-items: flex-start; position: relative; text-decoration: none; color: inherit; }
.bento__cotw-avatar { width: 80px; height: 80px; border-radius: var(--r-lg); object-fit: cover; flex-shrink: 0; border: 2px solid var(--border-strong); }
.bento__cotw-name { font-size: var(--text-xl); font-weight: var(--weight-bold); color: var(--text); margin: 0 0 var(--s1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: var(--s2); }
.bento__cotw-desc { font-size: var(--text-sm); color: var(--text-muted); line-height: var(--leading-normal); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: var(--s3); }
.bento__cotw-subs { font-family: var(--font-mono); font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--primary); display: flex; align-items: center; gap: var(--s2); }
.bento__search-label { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-muted); }
.bento__search-input { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--bg-0); color: var(--text-muted); font-size: var(--text-base); cursor: pointer; transition: all var(--dur-fast); }
.bento__search-input:hover { border-color: var(--primary); color: var(--text); box-shadow: var(--shadow-glow); }
.bento__search-shortcut { margin-left: auto; font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); color: var(--text-disabled); background: var(--bg-2); }
.bento__category-pills { display: flex; gap: var(--s2); flex-wrap: wrap; }
.bento__cat-pill { padding: 4px var(--s3); border-radius: var(--r-full); border: 1px solid var(--border); background: var(--bg-2); color: var(--text-muted); font-size: var(--text-sm); font-weight: var(--weight-medium); text-decoration: none; transition: all var(--dur-fast); }
.bento__cat-pill:hover { background: var(--primary-subtle); color: var(--primary); border-color: var(--primary); text-decoration: none; }
.bento__tile-label { font-size: var(--text-caption); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caption); text-transform: uppercase; color: var(--text-muted); }
.bento__trending-list { display: flex; flex-direction: column; gap: var(--s2); flex: 1; }
.bento__trending-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s2); border-radius: var(--r-md); text-decoration: none; color: inherit; transition: background var(--dur-fast); }
.bento__trending-item:hover { background: var(--bg-2); text-decoration: none; }
.bento__trending-avatar { width: 32px; height: 32px; border-radius: var(--r-md); object-fit: cover; flex-shrink: 0; background: var(--bg-2); }
.bento__trending-name { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bento__trending-growth { font-family: var(--font-mono); font-size: 11px; color: var(--success); flex-shrink: 0; }
.bento__stat { display: flex; flex-direction: column; gap: 2px; }
.bento__stat-num { font-family: var(--font-mono); font-size: var(--text-2xl); font-weight: var(--weight-bold); color: var(--text); line-height: 1; }
.bento__stat-label { font-size: var(--text-sm); color: var(--text-muted); }
.bento__submit-text h3 { font-size: var(--text-lg); font-weight: var(--weight-bold); color: var(--text); margin: 0 0 var(--s1); }
.bento__submit-text p { font-size: var(--text-sm); color: var(--text-muted); margin: 0; }
.bento__submit-arrow { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; transition: transform var(--dur-fast), background var(--dur-fast); }
.bento__tile--submit:hover .bento__submit-arrow { transform: translateX(4px); background: var(--primary-hover); }
.bento__trust { display: flex; align-items: center; justify-content: center; gap: var(--s6); margin-top: var(--s6); flex-wrap: wrap; }
.bento__trust-item { font-size: var(--text-sm); color: var(--text-muted); display: flex; align-items: center; gap: var(--s2); }
.bento__trust-item::before { content: '·'; font-size: 18px; line-height: 0; color: var(--border-strong); }
.bento__trust-item:first-child::before { display: none; }

/* ═══════════════════════════════════════════════════════════
   BUGFIXES & OVERRIDES
   ═══════════════════════════════════════════════════════════ */

/* 1. Sub-header always hidden */
.sub-header { display: none !important; }

/* 2. Body offset: only new navbar height */
body { padding-top: 64px !important; }

/* 3. Light mode: page bg */
[data-theme="light"] body,
[data-theme="light"] { background-color: #F7F8FA !important; }

/* 4. "MOST POPULAR" badge — single line always */
[style*="MOST POPULAR"],
.most-popular-badge { white-space: nowrap !important; }

/* Fix pricing card badge position */
.bento__tile--submit + * span[style*="MOST POPULAR"],
span[style*="MOST POPULAR"] { white-space: nowrap !important; }

/* 5. Submit page — no huge gap from hidden blocks */
.submit-step { min-height: 0 !important; }
#step-category, #step-email, #step-boost, #step-submit,
#step-loading, #step-success, #step-rejected { min-height: 0 !important; }

/* 6. Search modal kbd — visible on dark background */
.cmdk-footer { background: var(--bg-1); }
.cmdk-footer kbd {
  background: var(--bg-3) !important;
  border-color: var(--border-strong) !important;
  color: var(--text-muted) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  font-size: 11px !important;
}
.cmdk-footer span { color: var(--text-muted) !important; }

/* 7. Search modal result text overflow fix */
.cmdk-item { overflow: hidden; }
.cmdk-item__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.cmdk-item__desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* ═══════════════════════════════════════════════════════════
   NEW FILTER BAR — replaces old Bootstrap button groups
   ═══════════════════════════════════════════════════════════ */

.tg-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s4);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  flex-wrap: wrap;
  margin-bottom: var(--s4);
}

.tg-filter-group {
  display: flex;
  gap: var(--s1);
  align-items: center;
  flex-shrink: 0;
}

.tg-filter-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

.tg-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px var(--s3);
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease-out);
  font-family: var(--font-sans);
}

.tg-filter-chip:hover {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--border-strong);
}

.tg-filter-chip.active,
.tg-filter-chip[aria-pressed="true"] {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--primary);
}

.tg-filter-search {
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 6px var(--s3);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg-0);
  transition: border-color var(--dur-fast);
}

.tg-filter-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

.tg-filter-search input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: var(--text-sm);
  outline: none;
  flex: 1;
  min-width: 0;
  font-family: var(--font-sans);
}

.tg-filter-search input::placeholder { color: var(--text-disabled); }

.tg-filter-search svg { color: var(--text-disabled); flex-shrink: 0; }

.tg-filter-category {
  padding: 6px var(--s3);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg-0);
  color: var(--text);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  outline: none;
  cursor: pointer;
  max-width: 160px;
  transition: border-color var(--dur-fast);
}

.tg-filter-category:focus { border-color: var(--primary); }

.tg-filter-clear {
  padding: 5px var(--s3);
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--dur-fast);
  font-family: var(--font-sans);
}

.tg-filter-clear:hover {
  background: var(--danger-subtle);
  color: var(--danger);
  border-color: var(--danger);
}

/* Responsive filter bar */
@media (max-width: 768px) {
  .tg-filter-bar { flex-direction: column; align-items: stretch; }
  .tg-filter-search { min-width: 0; width: 100%; }
  .tg-filter-category { max-width: 100%; }
  .tg-filter-divider { width: 100%; height: 1px; }
}

@media (max-width: 480px) {
  .tg-filter-group { flex-wrap: wrap; }
  .tg-filter-chip { font-size: 12px; padding: 4px 10px; }
}

/* ─── Listing page wrapper ─── */
.tg-listing-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--s6) var(--s6);
}

.tg-listing-page h1 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text);
  margin: 0 0 var(--s4);
  font-family: var(--font-sans);
}

.tg-listing-summary {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0 0 var(--s4);
}

.tg-listing-summary strong { color: var(--text); }

/* ─── Pagination (new) ─── */
.tg-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  margin-top: var(--s6);
  flex-wrap: wrap;
}

.tg-pagination a,
.tg-pagination span,
.tg-pagination button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--s2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--dur-fast);
}

.tg-pagination a:hover,
.tg-pagination button:hover {
  background: var(--bg-2);
  color: var(--text);
  text-decoration: none;
}

.tg-pagination .active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ─── Category page overrides ─── */
.category-section { background: var(--bg-0) !important; }
.category-section .section-heading h1 { color: var(--text) !important; }
.category-section .section-heading p { color: var(--text-muted) !important; }

/* ─── Advertise page: MOST POPULAR badge ─── */
[style*="position:absolute"][style*="MOST POPULAR"],
[style*="position: absolute"] { white-space: nowrap !important; }

/* Fix old Bootstrap overrides */
.card { background: var(--bg-1) !important; border-color: var(--border) !important; color: var(--text) !important; }
.text-muted { color: var(--text-muted) !important; }
.form-control {
  background-color: var(--bg-1) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.form-control:focus {
  background-color: var(--bg-1) !important;
  border-color: var(--primary) !important;
  color: var(--text) !important;
  box-shadow: 0 0 0 3px var(--primary-subtle) !important;
}
.form-control::placeholder { color: var(--text-disabled) !important; }

/* Loading overlay */
.loading-overlay {
  background: var(--bg-0) !important;
  opacity: 0.85;
}

/* ─── Light mode specific overrides ─── */
[data-theme="light"] .tg-filter-bar { background: #fff; }
[data-theme="light"] .tg-filter-search { background: #fff; }
[data-theme="light"] .tg-filter-category { background: #fff; }
[data-theme="light"] .item-list { background: #fff; }
