/* 
  NOTE: TgramLink 
*/
/* ========================================================================== 
   1. Variables
   Merged and normalized :root and theme variables.
   ========================================================================== */
:root {
  --bg-body: #f0f2f5;
  --card-bg: #ffffff;
  --card-border: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --primary: #24A1DE;
  --tech-hover: #f1f5f9;
  --vip-overlay: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  --radius-card: 16px;
  --shadow-card: 0 4px 15px rgba(0,0,0,0.05);
  --font-main: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
}
body.dark-mode {
  --bg-body: #0f172a;
  --card-bg: #1e293b;
  --card-border: #334155;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #38bdf8;
  --tech-hover: #334155;
  --vip-overlay: linear-gradient(to top, rgba(15, 23, 42, 0.95), transparent);
  --shadow-card: 0 4px 15px rgba(0,0,0,0.3);
}
/* ========================================================================== 
   2. Reset & Base Styles
   Base element styles and global defaults.
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  transition: background 0.3s, color 0.3s;
}
a {
  text-decoration: none;
  color: inherit;
  transition: 0.2s;
}
ul {
  list-style: none;
}
/* ========================================================================== 
   3. Layout
   Page structure, containers, grids, header/footer.
   ========================================================================== */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 15px;
}
.main-header {
  background: var(--card-bg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 15px;
}
/* ========================================================================== 
   4. Components
   Reusable UI components (cards, badges, buttons, etc.).
   ========================================================================== */
.logo span {
  color: var(--primary);
}
.logo {
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}
.logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}
.logo-text {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}
.logo-text span {
  color: var(--primary);
}
.search-wrapper {
  flex: 1;
  max-width: 500px;
}

.search-form {
  display: flex;
  background: var(--bg-body);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 0;
  align-items: center;
  overflow: hidden;
}

.search-form input {
  flex: 1;
  border: none;
  background: transparent;
  height: 48px !important;
  min-height: 48px !important;  
  padding: 0 12px;

  
  font-size: 16px;
  outline: none;
  color: var(--text-main);
}

.search-form button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-upload {
  background: #222;
  color: #fff;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.lang-dropdown {
  position: relative;
  display: inline-block;
}
.lang-btn {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  border: 1px solid rgba(96, 165, 250, 0.65);
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.lang-btn:hover {
  background: linear-gradient(135deg, #1e40af, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
}
.lang-btn:focus-visible {
  outline: 2px solid rgba(147, 197, 253, 0.95);
  outline-offset: 2px;
}
.lang-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: var(--card-bg);
  min-width: 320px;
  width: min(92vw, 360px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 8px;
  z-index: 1001;
  padding: 6px;
  border: 1px solid var(--card-border);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}
.lang-content a {
  color: var(--text-main);
  padding: 8px 10px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  white-space: nowrap;
}
.lang-content .lang-flag {
  width: 18px;
  height: 13px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}
.lang-content a:hover {
  background-color: var(--tech-hover);
  color: var(--primary);
}
.lang-dropdown.open .lang-content {
  display: grid !important;
}
.footer-lang-dropdown .lang-btn {
  font-size: 12px;
  padding: 7px 11px;
}
.footer-lang-dropdown .lang-content {
  top: auto;
  bottom: 100%;
  right: auto;
  left: 0;
  margin-bottom: 8px;
  min-width: 320px;
  width: min(92vw, 360px);
  max-height: 280px;
  overflow-y: auto;
}
@media (max-width: 480px) {
  .lang-content {
    width: min(96vw, 340px);
    min-width: 300px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 62vh;
    overflow-y: auto;
  }
  .footer-lang-dropdown .lang-content {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  .lang-content a {
    font-size: 11px;
    padding: 7px 8px;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .lang-content .lang-flag {
    width: 16px;
    height: 12px;
  }
}

@media (max-width: 768px) {
  .main-header .lang-dropdown .lang-content {
    left: 0;
    right: auto;
    transform: none;
    width: min(82vw, 280px);
    min-width: 220px;
    grid-template-columns: 1fr;
    max-height: 62vh;
    overflow-y: auto;
  }
  .main-header .lang-dropdown .lang-content a {
    direction: ltr;
    text-align: left;
    justify-content: flex-start;
  }
  .main-footer .footer-lang-dropdown .lang-content {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(94vw, 360px);
    min-width: 300px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 62vh;
    overflow-y: auto;
  }
}
.home-spacer {
  margin-top: 25px;
}
.section-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
  padding: 20px;
  margin-bottom: 25px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--card-border);
}
.section-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}
.section-head p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.home-cat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.home-seo-box {
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 800px;
}
.home-seo-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 5px 0;
}
.home-seo-desc {
  margin: 0;
}

.cats-wrapper {
    display: none;
    opacity: 0; 
    margin-top: 0;
}

.cats-wrapper.expanded {
    display: block; 
    opacity: 1;  
    margin-top: 15px; 
    animation: fadeInCats 0.3s ease-out forwards;
}
@media (min-width: 992px) {
    .cats-wrapper {
        display: block !important;
        opacity: 1 !important;
        margin-top: 15px !important;
        animation: none !important;
        max-height: none !important;
        overflow: visible !important;
    }
    #toggleCatsBtn {
        display: none !important;
    }
}

@keyframes fadeInCats {
  from { 
    opacity: 0; 
    transform: translateY(-10px);
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.cats-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, 1fr);
  padding: 5px;
}
@media (min-width: 768px) {
  .cats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 1024px) {
  .cats-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}
.cat-card {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px;
  background: var(--bg-body);
  display: flex;
  gap: 10px;
  align-items: center;
  transition: all 0.2s ease;
  min-height: 56px;
  color: var(--text-main);
}
.cat-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(22,119,255,0.1);
}
.cat-card .ic {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(36, 161, 222, 0.1);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex: 0 0 auto;
}
.cat-card .t {
  margin: 0;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  color: var(--text-main);
}
.btn-toggle-cats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--bg-body);
  border: 1px solid var(--card-border);
  padding: 8px 15px;
  border-radius: 8px;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.section-title-neon {
  font-size: 14px;
  font-weight: 800;
  color: #f472b6;
  letter-spacing: 1px;
  margin-bottom: 15px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
}
.section-title-light {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 15px;
  text-transform: uppercase;
}
.grid-vip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}
@media (min-width: 768px) {
  .grid-vip {
    grid-template-columns: repeat(4, 1fr);
  }
}
.card-vip {
  display: block;
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
}
.card-vip:hover {
  border-color: #f472b6;
  transform: translateY(-3px);
}
.vip-cover {
  height: 120px;
  position: relative;
  width: 100%;
}
.vip-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vip-overlay {
  position: absolute;
  inset: 0;
  background: var(--vip-overlay);
}
.badge-vip {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #db2777;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 2;
}
.vip-info {
  padding: 10px;
  text-align: center;
}
.vip-name {
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  height: auto;
  max-height: 2.8em;
  white-space: normal !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.btn-vip-join {
  width: 100%;
  background: linear-gradient(90deg, #ec4899, #8b5cf6);
  color: #fff;
  border: none;
  padding: 6px 0;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
}
.grid-explorer, .trending-grid-modern {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 991px) {
  .grid-explorer, .trending-grid-modern {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }
}
@media (max-width: 360px) {
  .grid-explorer, .trending-grid-modern {
    gap: 8px;
  }
}
.card-tech {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 12px;
  border-radius: 12px;
  text-decoration: none;
  transition: 0.2s;
}
.card-tech:hover {
  background: var(--tech-hover);
  border-color: var(--primary);
}
.tech-avatar img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: #000;
}
.tech-info {
  flex: 1;
  min-width: 0;
}
.tech-name {
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: normal !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tech-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tech-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}
.tech-badge.group {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}
.tech-badge.channel {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
}
.tech-mem {
  font-size: 11px;
  color: var(--text-muted);
}
.ver-icon {
  width: 14px;
  height: 14px;
  color: var(--primary);
  vertical-align: middle;
}
.home-section-transparent {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.home-head-transparent {
  margin-bottom: 20px !important;
  border: none !important;
}
.grid-groups {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) {
  .grid-groups {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1200px) {
  .grid-groups {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 599px) {
  .grid-groups {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
.gcard {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  color: var(--text-main);
}
.gcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  border-color: var(--primary);
}
.gcard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  padding: 12px 12px 0 12px;
  margin-bottom: 8px;
}
.gcard-flag {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 22px;
}
.gcard-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.type-badge {
  font-size: 8px;
  padding: 3px 8px;
  line-height: 1;
  display: inline-block;
  white-space: nowrap;
  border-radius: 4px;
}
.badge-access {
  margin-bottom: 0 !important;
  font-size: 7px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0.9;
}
.badge-access.private {
  background-color: #850b0b;
  color: #fff;
  border: 1px solid #fecaca;
}
.badge-access.public {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
  font-weight: 600;
}
.gcard-body {
  padding: 5px 12px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.gcard-img-wrapper {
  margin-bottom: 8px;
}
.gcard-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  margin: 0 0 8px 0;
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  height: 2.8em;
  word-break: break-word;
  white-space: normal !important;
}
.gcard-info-row {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 6px;
}
.badge-row {
  gap: 6px;
  flex-wrap: wrap;
  height: 24px;
}
.meta-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--tech-hover);
  color: var(--text-muted);
  font-weight: 600;
}
.member-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.gcard-footer {
  padding: 12px;
  background: var(--bg-body);
  border-top: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-join-block {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 0;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  color: #fff !important;
  transition: opacity 0.2s;
}
.gcard-bottom-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.btn-action-small {
  background: transparent;
  border: 1px solid var(--card-border);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.theme-channel .type-badge {
  background: #794c03;
  color: #fff;
}
.theme-channel .btn-join-block {
  background: linear-gradient(135deg, #ff9800, #f57c00);
}
.theme-group .type-badge {
  background: #365ecd;
  color: #fff;
}
.theme-group .btn-join-block {
  background: linear-gradient(135deg, #42a5f5, #1976d2);
}
.sidebar-wrapper-fix {
  height: 100%;
}
.sidebar-widget {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}
.widget-title {
  margin: 0 0 15px;
  font-size: 15px;
  font-weight: 800;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--card-border);
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.trending-list {
  padding: 0;
  margin: 0;
  list-style: none;
}
.trending-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px dashed var(--card-border);
}
.trending-list li:last-child {
  border: none;
  margin: 0;
  padding: 0;
}
.rank-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--bg-body);
  color: var(--text-muted);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  border: 1px solid var(--card-border);
  margin-top: 2px;
}
.rank-0 {
  background: #fffbeb;
  color: #d97706;
  border-color: #fcd34d;
}
.rank-1 {
  background: #f0f9ff;
  color: #0284c7;
  border-color: #bae6fd;
}
.rank-2 {
  background: #fff1f2;
  color: #e11d48;
  border-color: #fecdd3;
}
body.dark-mode .rank-0 {
  background: rgba(217, 119, 6, 0.2);
  border-color: rgba(217, 119, 6, 0.4);
  color: #fbbf24;
}
body.dark-mode .rank-1 {
  background: rgba(2, 132, 199, 0.2);
  border-color: rgba(2, 132, 199, 0.4);
  color: #38bdf8;
}
body.dark-mode .rank-2 {
  background: rgba(225, 29, 72, 0.2);
  border-color: rgba(225, 29, 72, 0.4);
  color: #f5a5b1;
}
.trend-info a, .trend-info .top-link {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 5px;
  text-decoration: none;
  transition: 0.2s;
  white-space: normal !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  height: auto;
}
.trend-info a:hover {
  color: var(--primary);
}
.top-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.badge-type {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 700;
}
.badge-type.ch {
  background: rgba(249, 115, 22, 0.15);
  color: #f3bcbc;
}
.badge-type.gr {
  background: rgba(37, 99, 235, 0.15);
  color: #a3c5fd;
}
.nav-controls-wrapper {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 15px;
}
.tab-nav-container {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  height: 44px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  text-transform: capitalize;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
  background-color: #ffffff;
  border: 2px solid #cbd5e1;
  color: #334155;
  position: relative;
}
.tab-btn:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-1px);
}
.tab-btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(36, 161, 222, 0.35);
}
.tab-btn::after {
  display: none !important;
}
.tab-count {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
  line-height: 1;
}
.tab-btn .tab-count {
  background-color: #e2e8f0;
  color: #1e293b;
}
.tab-btn.active .tab-count {
  background-color: rgba(0, 0, 0, 0.2);
  color: #fff;
}
body.dark-mode .tab-btn {
  background-color: #1e293b;
  border-color: #475569;
  color: #fff;
}
body.dark-mode .tab-btn:hover {
  background-color: #334155;
  border-color: #94a3b8;
  color: #fff;
}
body.dark-mode .tab-btn.active {
  background-color: #4b6977;
  border-color: var(--primary);
  color: #fff;
}
body.dark-mode .tab-btn .tab-count {
  background-color: #0f172a;
  color: #fff;
}
body.dark-mode .tab-btn.active .tab-count {
  background-color: rgba(0,0,0,0.3);
  color: #fff;
}
.nav-filters-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-item-group {
  display: flex;
  align-items: center;
  background: var(--bg-body);
  border: 1px solid var(--card-border);
  padding: 6px 10px;
  border-radius: 8px;
}
.filter-label-small {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 5px;
}
.dropdown-sort {
  position: relative;
  display: inline-block;
}
.btn-sort-toggle {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 5px;
}
.sort-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 140px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  z-index: 50;
  margin-top: 8px;
}
.dropdown-sort.open .sort-menu {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}
/* ========================================================================== 
   Animations
   Keyframes used by loading states and micro-interactions.
   ========================================================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.sort-item {
  display: block;
  padding: 8px 15px;
  font-size: 13px;
  color: var(--text-main);
  text-decoration: none;
}
.sort-item:hover {
  background: var(--bg-body);
  color: var(--primary);
}
.sort-item.active {
  font-weight: 700;
  color: var(--primary);
  background: var(--bg-body);
}
.live-feed-section {
  margin-top: 30px;
  border-top: 1px dashed var(--card-border);
  padding-top: 20px;
}
.live-feed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 15px;
}
@media (min-width: 992px) {
  .live-feed-grid {
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
  }
}
.d-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
  height: 100%;
}
.d-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.d-card-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 4px;
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.6em;
  white-space: normal !important;
}
.d-card-mini-foot {
  font-size: 9px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: auto;
}
.status-live {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
}
.pulse-dot {
  width: 5px;
  height: 5px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}
body.dark-mode .d-card {
  background: #1e293b;
  border-color: #334155;
}
body.dark-mode .d-card-avatar {
  border-color: #334155;
}
.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--card-border);
  background: var(--bg-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.main-footer {
  margin-top: auto;
  background: var(--card-bg);
  border-top: 1px solid var(--card-border);
  padding-top: 50px;
  color: var(--text-muted);
  font-size: 14px;
}
.footer-grid {
  display: grid;
  gap: 30px;
  margin-bottom: 30px;
  grid-template-columns: 1fr;
  text-align: center;
}
@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    text-align: left;
  }
}
.footer-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  display: block;
  margin-bottom: 10px;
}
.footer-logo span {
  color: var(--primary);
}
.footer-desc {
  line-height: 1.5;
  margin-bottom: 15px;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-head {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 15px;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-link-item {
  color: var(--text-muted);
  text-decoration: none;
  transition: 0.2s;
}
.footer-link-item:hover {
  color: var(--primary);
  padding-left: 3px;
}
.footer-socials {
  display: flex;
  gap: 10px;
  justify-content: center;
}
@media (min-width: 768px) {
  .footer-socials {
    justify-content: flex-start;
  }
}
.social-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-body);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 16px;
}
.social-btn:hover {
  background: var(--primary);
  color: #fff;
}
.footer-copyright {
  border-top: 1px solid var(--card-border);
  padding: 20px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg-body);
}
.search-header-box {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}
.search-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
}
.search-desc {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 600px;
  margin: 0 auto;
}
.grid-search {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) {
  .grid-search {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }
}
@media (min-width: 1024px) {
  .grid-search {
    grid-template-columns: repeat(5, 1fr);
  }
}
@media (min-width: 1200px) {
  .grid-search {
    grid-template-columns: repeat(6, 1fr);
  }
}
.grid-search .gcard-body {
  padding: 8px 10px;
}
.grid-search .gcard-name {
  font-size: 13px;
  height: 2.6em;
  margin-bottom: 5px;
}
.grid-search .btn-join-block {
  padding: 8px 0;
  font-size: 12px;
}
.search-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--card-bg);
  border: 1px dashed var(--card-border);
  border-radius: 16px;
}
.detail-box {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  border: 1px solid var(--card-border);
}
.detail-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-body);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  display: block;
  margin: 0 auto 20px auto;
}
.detail-type-wrap {
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}
.detail-badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  display: inline-block;
}
.detail-title {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 15px;
  color: var(--text-main);
}
.detail-stats strong {
  color: var(--text-main);
}
.detail-desc {
  max-width: 600px;
  margin: 0 auto 30px;
  color: var(--text-main);
  line-height: 1.6;
  font-size: 15px;
  opacity: 0.9;
}
.detail-btn-join {
  display: inline-block;
  padding: 16px 50px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
  color: white !important;
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
  transition: transform 0.2s, box-shadow 0.2s;
}
.detail-btn-join:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.detail-note {
  margin-top: 15px;
  font-size: 13px;
  color: var(--text-muted);
}
.theme-channel .detail-badge {
  background: #fff3e0;
  color: #e65100;
}
.theme-channel .detail-btn-join {
  background: #e65100;
}
.theme-bot .detail-badge {
  background: #ede7f6;
  color: #673ab7;
}
.theme-bot .detail-btn-join {
  background: #673ab7;
}
.theme-group .detail-badge {
  background: #e3f2fd;
  color: #1565c0;
}
.theme-group .detail-btn-join {
  background: #24A1DE;
}
.detail-tag {
  display: inline-block;
  background: var(--bg-body);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 14px;
  margin: 3px;
  border: 1px solid var(--card-border);
}
.detail-related-title {
  margin-top: 50px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}
.detail-related-grid {
  margin-top: 20px;
  grid-template-columns: repeat(6, 1fr) !important;
}
.cat-hero-section {
  padding: 30px !important;
  background: var(--card-bg);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 25px;
  border-radius: 12px;
}
.cat-hero-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #24A1DE, #1677ff);
}
.cat-hero-body {
  display: flex;
  gap: 25px;
  align-items: flex-start;
}
.cat-hero-icon {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  background: var(--bg-body);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
.cat-hero-content {
  flex: 1;
}
.cat-hero-title {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}
.cat-hero-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 900px;
}
.cats-grid-page {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}
@media (min-width: 1200px) {
  .cats-grid-page {
    grid-template-columns: repeat(6, 1fr) !important;
  }
}
.cat-card-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 30px 20px;
  text-align: center;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s;
}
.cat-card-item:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}
.cat-icon-box {
  width: 64px;
  height: 64px;
  background: var(--bg-body);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 20px;
  transition: 0.3s;
}
.cat-card-item:hover .cat-icon-box {
  background: var(--primary);
  color: #fff;
  transform: scale(1.1);
}
.cat-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.cat-card-item:hover .cat-name {
  color: var(--text-main);
}
.static-page-box {
  background: var(--card-bg);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  margin-bottom: 40px;
  border: 1px solid var(--card-border);
}
.static-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--bg-body);
}
.static-content {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-main);
}
.static-content h2, .static-content h3 {
  color: var(--text-main);
  font-weight: 700;
  margin-top: 30px;
}
.static-content a {
  color: var(--primary);
  text-decoration: underline;
}
.contact-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.contact-form label {
  display: block;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
  font-size: 14px;
}
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: var(--bg-body);
  color: var(--text-main);
}
.contact-form button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  width: 100%;
}
.info-item {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}
.info-icon {
  width: 40px;
  height: 40px;
  background: var(--card-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  font-size: 18px;
  color: var(--primary);
}
.info-text h4 {
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}
.info-text p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}
.modal-active {
  display: flex;
}
.modal-box {
  background: var(--card-bg);
  width: 90%;
  max-width: 400px;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  color: var(--text-main);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 10px;
}
.modal-title {
  font-size: 18px;
  font-weight: 800;
}
.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-muted);
}
.report-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 13px;
}
.report-form select, .report-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  margin-bottom: 15px;
  background: var(--bg-body);
  color: var(--text-main);
}
.report-form button {
  width: 100%;
  padding: 12px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
#tagsBackdrop {
  z-index: 9999 !important;
  display: none;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}
#tagsBackdrop.active {
  display: flex !important;
}
#tagsBackdrop .modal {
  display: flex;
  flex-direction: column;
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
#tagsBackdrop .modal-head {
  padding: 15px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#tagsBackdrop .modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}
#tagsBackdrop .modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
}
#tagsBackdrop .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.modal-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-body);
  padding: 12px 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 1px solid var(--card-border);
}
.modal-search-box input {
  border: none;
  background: transparent;
  width: 100%;
  outline: none;
  color: var(--text-main);
  font-size: 15px;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}
.tag-loader {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  display: none;
}
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  min-width: 38px;
  padding: 0 10px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-muted);
  background: var(--card-bg);
  font-weight: 700;
}
.page-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.page-link.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
@media (min-width: 992px) {
  .modern-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 25px;
    align-items: start;
  }
  .main-content {
    grid-column: 1 / 2;
    min-width: 0;
  }
  .sidebar-wrapper-fix {
    grid-column: 2 / 3;
    position: static !important;
    height: auto !important;
    margin-top: 0;
    z-index: 1;
  }
  .live-feed-section,
    .home-tags-container,
    .home-tags-section {
    grid-column: 1 / -1;
    width: 100%;
    position: static;
    margin-top: 30px;
    clear: both;
  }
  .cats-grid {
    grid-template-columns: repeat(6, 1fr) !important;
  }
  .grid-groups {
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
  }
  .live-feed-grid {
    grid-template-columns: repeat(8, 1fr) !important;
    gap: 12px !important;
  }
  .filter-status-bar {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    max-width: 700px;
    margin: 20px auto 15px auto;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    padding: 12px 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}
.filter-status-bar:empty {
    display: none;
    padding: 0;
    border: none;
    margin: 0;
}
    .status-highlight {
    display: inline-block;
    background: #e0f2fe;
    color: #0284c7;
    padding: 4px 12px;
    border-radius: 20px;
    margin: 0 4px;
    font-size: 15px;
    border: 1px solid #bae6fd;
  }
  .sidebar-widget {
    padding: 20px !important;
    margin-bottom: 20px !important;
  }
  .widget-title {
    margin: 0 0 12px 0 !important;
    padding-bottom: 10px !important;
    font-size: 15px !important;
    border-bottom: 1px solid var(--card-border) !important;
  }
  .trending-list li {
    margin-bottom: 14px !important;
    padding-bottom: 14px !important;
    align-items: flex-start !important;
    gap: 12px !important;
    border-bottom: 1px dashed var(--card-border) !important;
    display: flex !important;
  }
  .trending-list li:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border: none !important;
  }
  .trending-list li .trend-info {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    flex: 1 !important;
    min-width: 0 !important;
    height: auto !important;
  }
  .trending-list li .trend-info a, .trending-list li .trend-info .top-link {
    margin: 0 0 2px 0 !important;
    padding: 0 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal !important;
  }
  .trending-list li .trend-info .top-meta {
    margin-top: 0 !important;
    padding-top: 0 !important;
    line-height: 1 !important;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px !important;
    height: auto !important;
  }
  .rank-num {
    width: 24px !important;
    height: 24px !important;
    font-size: 12px !important;
    margin-top: 2px !important;
    flex-shrink: 0 !important;
  }
  .badge-type {
    padding: 2px 5px !important;
    font-size: 9px !important;
    border-radius: 4px !important;
  }
}
@media (max-width: 991px) {
  .live-feed-grid.random-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
  .live-feed-grid.random-grid > .d-card:nth-child(n/**/+22) {
    display: none !important;
  }
}
@media (max-width: 991px) {
  .modern-layout {
    display: flex;
    flex-direction: column;
  }
  .main-content {
    order: 1;
  }
  .live-feed-section {
    order: 2;
  }
  .sidebar-wrapper-fix {
    order: 3;
    display: block !important;
    margin-top: 25px;
    background: var(--bg-body);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
  }
  .home-tags-container {
    order: 4;
  }
  .sidebar-widget {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: none;
  }
  .sidebar-widget h3.widget-title {
    color: var(--text-main);
    border-bottom-color: var(--card-border);
  }
  .trend-info a, .top-link {
    color: var(--text-main) !important;
  }
}
@media (max-width: 768px) {
  .header-content {
    flex-wrap: wrap;
    height: auto;
    padding-bottom: 10px;
  }
  .search-wrapper {
    order: 3;
    width: 100%;
    max-width: 100%;
  }
  .home-tags-section {
    order: 3;
    margin-top: 20px;
  }
  .nav-controls {
    flex-direction: column;
    gap: 12px;
    background: transparent;
    border: none;
    padding-bottom: 0;
    align-items: stretch !important;
  }
  .filters-group {
    flex-direction: column;
    width: 100%;
    gap: 12px;
    display: flex;
    align-items: center;
  }
  .nav-filters-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .filter-item-group:not(:last-child) {
    width: 100%;
    justify-content: space-between;
    margin: 0 !important;
  }
  .filter-item-group:not(:last-child) .dropdown-sort {
    flex-grow: 1;
    margin-left: 15px;
  }
  .filter-item-group:not(:last-child) .btn-sort-toggle {
    width: 100% !important;
    justify-content: space-between;
    padding: 10px 15px;
  }
  .filter-item-group:last-child {
    width: auto;
    margin-top: 5px;
  }
  .cat-hero-section {
    padding: 20px !important;
  }
  .cat-hero-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
  }
  .detail-stats {
    flex-direction: column;
    gap: 10px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .detail-box {
    padding: 25px 15px;
  }
  .detail-title {
    font-size: 22px;
  }
  .detail-btn-join {
    width: 100%;
    padding: 14px;
    font-size: 16px;
  }
}
@media (max-width: 480px) {
  .grid-groups, .search-grid, .grid-search {
    gap: 8px !important;
  }
  .gcard {
    border-radius: 12px;
  }
  .gcard-header {
    padding: 8px 8px 0 8px;
    margin-bottom: 4px;
  }
  .gcard-flag img {
    width: 14px;
  }
  .gcard-flag span {
    font-size: 10px;
  }
  .type-badge, .badge-access {
    font-size: 8px;
    padding: 2px 4px;
  }
  .gcard-body {
    padding: 4px 8px 8px 8px;
  }
  .gcard-avatar {
    width: 48px;
    height: 48px;
    border-width: 2px;
  }
  .gcard-name {
    font-size: 12px !important;
    margin-bottom: 4px;
    height: 2.6em;
  }
  .gcard-info-row {
    margin-bottom: 4px;
  }
  .badge-row {
    height: auto !important;
    min-height: 18px;
    gap: 3px;
    margin-bottom: 6px;
  }
  .meta-badge {
    font-size: 9px;
    padding: 1px 5px;
  }
  .member-count {
    font-size: 10px;
  }
  .gcard-footer {
    padding: 8px;
  }
  .btn-join-block {
    padding: 6px 0;
    font-size: 11px;
    height: 28px;
    margin-bottom: 0;
  }
  .gcard-bottom-actions {
    display: none;
  }
  .tab-nav-container {
    gap: 8px !important;
  }
  .tab-btn {
    flex: 1;
    width: auto !important;
    padding: 8px 4px !important;
    font-size: 13px !important;
    justify-content: center;
  }
  .tab-count {
    font-size: 10px !important;
    padding: 2px 5px !important;
  }
  .live-feed-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  .d-card {
    padding: 8px 2px !important;
    min-height: 90px;
    justify-content: flex-start;
  }
  .d-card-avatar {
    width: 36px !important;
    height: 36px !important;
    margin-bottom: 5px !important;
  }
  .d-card-name {
    font-size: 10px !important;
    line-height: 1.2 !important;
    height: 2.4em !important;
    margin-bottom: 4px !important;
    padding: 0 2px;
  }
  .d-card-mini-foot {
    margin-top: auto;
    font-size: 8px !important;
  }
  .chip-container {
    gap: 6px !important;
    justify-content: center;
  }
  .chip {
    font-size: 11px !important;
    padding: 4px 10px !important;
    height: 26px;
  }
}
.filter-status-bar {
  margin-top: 15px;
  padding: 10px 15px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  font-size: 11px;
  color: #64748b;
  display: block; 
  visibility: hidden; 
  min-height: 42px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.filter-status-bar.active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}
.status-icon {
  margin-right: 6px;
}
.status-highlight {
  font-weight: 700;
  color: #163d51;
  background: rgba(36, 161, 222, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  margin: 0 2px;
}
@media (min-width: 992px) {
  .filter-status-bar {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    margin-top: 25px;
    margin-bottom: 10px;
    padding: 10px 20px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    border-radius: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    min-height: 50px; 
  }
  
  .filter-status-bar .status-highlight {
    font-size: 16px;
    padding: 4px 12px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.dense-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (min-width: 600px) {
  .dense-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 992px) {
  .dense-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}
@media (min-width: 1400px) {
  .dense-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}
.dense-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #1e293b;
  padding: 12px 8px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
}
.dense-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: var(--primary);
}
.dense-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
  border: 2px solid #f8fafc;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.dense-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dense-meta {
  margin-top: auto;
  font-size: 11px;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.btn-act-round {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 50px;
  border: none;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  background: #f1f5f9;
  color: #64748b;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.btn-act-round:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.btn-act-round .icon {
  font-size: 16px;
}
.btn-like.liked {
  background: #ffe4e6;
  color: #e11d48;
}
.btn-like:hover {
  background: #ffe4e6;
  color: #e11d48;
}
.btn-report:hover {
  background: #fef2f2;
  color: #ef4444;
}
.section-vip-wrapper {
  background: transparent;
  margin-bottom: 20px;
}
.vip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}
.vip-heading {
  font-size: 16px;
  font-weight: 800;
  color: #db2777;
  margin: 0;
  letter-spacing: 0.5px;
}
.vip-badge-label {
  background: #db2777;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.vip-grid-modern {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 768px) {
  .vip-grid-modern {
    grid-template-columns: repeat(4, 1fr);
  }
}
.vip-card-modern {
  background: var(--card-bg);
  border: 1px solid #fbcfe8;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  box-shadow: 0 4px 10px rgba(219, 39, 119, 0.05);
}
.vip-card-modern:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(219, 39, 119, 0.15);
  border-color: #db2777;
}
.vip-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 10px;
  flex: 1;
}
.vip-avatar-box {
  position: relative;
  width: 70px;
  height: 70px;
  margin-bottom: 10px;
}
.vip-img-modern {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.vip-type-tag {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background: #0f172a;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  z-index: 2;
  border: 1px solid #fff;
}
.vip-name-modern {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin: 0 0 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em;
}
.vip-meta {
  font-size: 11px;
  color: #db2777;
  font-weight: 600;
}
.vip-action {
  margin-top: auto;
}
.vip-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: linear-gradient(90deg, #ec4899, #db2777);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 0;
  border-radius: 8px;
  transition: opacity 0.2s;
}
.vip-card-modern:hover .vip-btn {
  opacity: 0.9;
}
.trending-grid-modern {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 991px) {
  .trending-grid-modern {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }
}
.trend-avatar {
  flex-shrink: 0;
}
.trend-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.trend-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.trend-badge {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}
.trend-badge.channel {
  background: #fff7ed;
  color: #c2410c;
}
.trend-badge.group {
  background: #eff6ff;
  color: #1d4ed8;
}
.trend-count {
  color: var(--text-muted);
  font-weight: 500;
}
.chip-container-modern {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-modern {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px; 
  margin: 4px; 
  
  border-radius: 20px;
  font-size: 14px; 
  
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid transparent;
}

.chip-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  filter: brightness(0.95);
}
.btn-browse-tags {
  background: #023281;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(59,130,246,0.3);
  transition: all 0.2s;
}
.btn-browse-tags:hover {
  background: #2563eb;
  transform: translateY(-2px);
}
body.dark-mode .vip-badge-label {
  background: #be185d;
}
body.dark-mode .vip-card-modern {
  border-color: #831843;
  background: #1e293b;
}
body.dark-mode .vip-name-modern {
  color: #fce7f3;
}
body.dark-mode .trend-card-modern:hover {
  background: #334155;
}
.bento-wrapper {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 15px;
  margin-bottom: 25px;
}
.bento-big {
  background: radial-gradient(circle at top right, #1e293b, #0f172a);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  height: 100%;
  text-decoration: none;
}
.bento-big::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #f43f5e, #f59e0b);
}
.bento-stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
  height: 100%;
}
.bento-small {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.2s, border-color 0.2s;
  text-decoration: none;
  position: relative;
}
.bento-small:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}
.b-tag {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.tag-vip {
  background: #f59e0b;
  color: #000;
}
.tag-ad {
  background: var(--bg-body);
  color: var(--text-muted);
  border: 1px solid var(--card-border);
}
.bento-big .b-title {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  margin: 0;
  line-height: 1.3;
}
.bento-big .b-desc {
  color: #94a3b8;
  font-size: 13px;
  margin: 10px 0 20px 0;
}
.bento-small .b-title {
  color: var(--text-main);
  font-weight: 700;
  font-size: 15px;
  margin: 0;
}
.bento-small .b-desc {
  color: var(--text-muted);
  font-size: 12px;
  margin: 5px 0 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.btn-action-vip {
  margin-top: auto;
  padding: 10px 30px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: white;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  transition: transform 0.2s;
}
.btn-action-vip:hover {
  transform: scale(1.05);
}
@media (max-width: 991px) {
  .trending-grid-modern {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
    row-gap: 35px;
    margin-top: 25px;
    padding: 0 5px;
  }
  .trend-card-modern {
    display: flex;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 28px 6px 10px 6px;
    height: auto;
    position: relative;
    overflow: visible !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
  }
  .trend-avatar {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0 !important;
    z-index: 5;
  }
  .trend-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-body);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: var(--card-bg);
  }
  .trend-rank {
    position: absolute;
    top: -8px;
    left: -4px;
    width: auto !important;
    font-size: 12px !important;
    font-weight: 800;
    padding: 2px 6px;
    background: #fff;
    color: #fff;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 6;
  }
  body.dark-mode .trend-rank {
    background: #334155;
    border-color: #475569;
  }
  .trend-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }
  .trend-name {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    width: 100%;
    height: 2.6em;
    white-space: normal !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }
  .trend-stats {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
  }
  .trend-badge {
    font-size: 9px;
    padding: 2px 6px;
  }
  .trend-count {
    font-size: 10px;
  }
}
@media (max-width: 991px) {
  .detail-related-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
}
.gcard.status-dead .gcard-header::after {
  content: "CLOSED";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  font-weight: 900;
  color: #ef4444;
  border: 2px solid #ef4444;
  padding: 5px 10px;
  border-radius: 6px;
  opacity: 0.8;
  font-size: 12px;
  pointer-events: none;
}
.gcard.status-dead {
  opacity: 0.7;
  filter: grayscale(100%);
  transition: 0.3s;
}
.gcard.status-dead:hover {
  opacity: 1;
  filter: grayscale(0%);
}
.gcard.status-pending {
  border: 1px dashed #3b82f6;
  background: #eff6ff;
}
.origin-box {
  margin-top: 25px;
  padding: 16px 20px;
  background: var(--bg-body);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  transition: all 0.3s ease;
}
.origin-box:hover {
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border-color: var(--primary);
}
.origin-flag {
  width: 32px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-top: 3px;
  flex-shrink: 0;
}
.origin-content {
  flex: 1;
  text-align: left;
}
.origin-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.4;
}
.origin-hl {
  color: var(--primary);
}
.origin-note {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
body.dark-mode .origin-box {
  background: rgba(30, 41, 59, 0.5);
  border-color: #334155;
}
.detail-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 25px;
  color: var(--text-muted);
  font-size: 15px;
}
.detail-stats span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-body);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
}
.meta-timeline-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed var(--card-border);
}
/* ========================================================================== 
   5. Utilities & Helpers
   Small helper classes and last-mile overrides.
   ========================================================================== */
.mt-item {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-body);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.mt-check {
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  font-weight: 600;
}
.source-alert-box {
  margin: 20px auto 25px auto;
  max-width: 600px;
  background: #fff7ed;
  border: 1px dashed #f97316;
  border-radius: 12px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
  box-shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.1);
}
.sa-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.sa-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sa-title {
  font-size: 13px;
  font-weight: 600;
  color: #9a3412;
  line-height: 1.4;
}
.sa-highlight {
  color: #ea580c;
  font-weight: 700;
  word-break: break-word;
}
.sa-note {
  font-size: 12px;
  color: #7c2d12;
  opacity: 0.9;
}
body.dark-mode .detail-stats span {
  background: #1e293b;
  border-color: #334155;
}
body.dark-mode .mt-item {
  background: #1e293b;
  border-color: #334155;
}
body.dark-mode .mt-check {
  background: rgba(21, 128, 61, 0.2);
  border-color: rgba(21, 128, 61, 0.3);
  color: #86efac;
}
body.dark-mode .source-alert-box {
  background: rgba(67, 20, 7, 0.4);
  border-color: #ea580c;
}
body.dark-mode .sa-title {
  color: #ffedd5;
}
body.dark-mode .sa-note {
  color: #fed7aa;
}
@media (max-width: 480px) {
  .source-alert-box {
    flex-direction: row;
    font-size: 12px;
    padding: 10px;
  }
  .sa-icon {
    font-size: 20px;
  }
}
.gcard .gcard-body .gcard-stats-row {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 6px !important;
  margin-top: 10px !important;
  width: 100% !important;
}
.gcard .gcard-body .gcard-stats-row .meta-badge {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 94% !important;
  margin: 0 auto !important;
  height: 28px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}
.gcard .gcard-body .gcard-stats-row .badge-member {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.gcard .gcard-body .gcard-stats-row .badge-verified {
  background-color: #dcfce7 !important;
  border: 1px solid #86efac !important;
}
.gcard .gcard-body .gcard-stats-row .badge-updated {
  background-color: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #7dd3fc !important;
}
body.dark-mode .gcard .gcard-body .gcard-stats-row .badge-member {
  background-color: #334155 !important;
  color: #ffffff !important;
  border: 1px solid #475569 !important;
}
body.dark-mode .gcard .gcard-body .gcard-stats-row .badge-verified {
  background-color: rgba(22, 163, 74, 0.2) !important;
  color: #86efac !important;
  border-color: rgba(22, 163, 74, 0.5) !important;
}
body.dark-mode .gcard .gcard-body .gcard-stats-row .badge-updated {
  background-color: rgba(2, 132, 199, 0.2) !important;
  color: #7dd3fc !important;
  border-color: rgba(2, 132, 199, 0.5) !important;
}
@media (max-width: 480px) {
  .gcard .gcard-body .gcard-stats-row {
    gap: 4px !important;
    margin-top: 8px !important;
  }
  .gcard .gcard-body .gcard-stats-row .meta-badge {
    font-size: 10px !important;
    height: 24px !important;
    width: 96% !important;
  }
  .gcard .gcard-body .gcard-stats-row .meta-badge img,
    .gcard .gcard-body .gcard-stats-row .meta-badge svg {
    width: 10px !important;
    height: 10px !important;
  }
}
.trend-card-modern {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 12px;
  padding: 10px;
  position: relative;
  overflow: hidden;
  background: #1e293b;
  border: 1px solid #334155;
  text-decoration: none;
  transition: transform 0.2s, border-color 0.2s;
  box-sizing: border-box;
}
.trend-card-modern:hover {
  background: var(--bg-body);
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}
.trend-avatar img {
  border: 2px solid var(--bg-body);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.trend-rank {
  font-size: 16px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.6;
  position: absolute;
  font-weight: 900;
  background: var(--bg-body);
  color: var(--text-main);
  border: 1px solid var(--card-border);
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 10;
}
.trend-rank.rank-1 {
  opacity: 1;
  font-size: 20px;
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}
.trend-rank.rank-2 {
  opacity: 1;
  font-size: 18px;
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}
.trend-rank.rank-3 {
  opacity: 1;
  font-size: 17px;
  background: #fffbeb;
  color: #fb9a50;
  border-color: #fde68a;
}
.trend-name {
  font-size: 13px;
  margin: 0;
  text-overflow: ellipsis;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.3;
  white-space: normal;
  word-wrap: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  flex-shrink: 0;
}
.t-badge {
  display: block;
  width: 100%;
  text-align: center;
  border-radius: 6px;
  white-space: nowrap;
}
.t-type {
  font-weight: 800;
  text-transform: uppercase;
  background: #0f172a;
  color: #94a3b8;
  border: 1px solid #334155;
  width: fit-content;
  margin: 0 auto;
}
.t-type.channel {
  color: #fdba74;
  border-color: #fb923c;
}
.t-type.group {
  color: #7dd3fc;
  border-color: #38bdf8;
}
.t-mem {
  font-weight: 800;
  color: #fff;
  background: rgba(255,255,255,0.05);
  border: 1px dashed #475569;
}
.t-time {
  color: #4ade80;
  font-weight: 600;
}
@media (max-width: 991px) {
  .trending-grid-modern {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    row-gap: 40px !important;
    padding-top: 25px !important;
    padding-bottom: 10px !important;
  }
  .trend-card-modern {
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 1;
    border-radius: 12px !important;
    margin-top: 0 !important;
    padding: 25px 3px 10px 3px !important;
    width: 100% !important;
    height: 100% !important;
  }
  .trend-avatar {
    position: absolute;
    width: 42px !important;
    height: 42px !important;
    top: -21px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    padding: 3px !important;
    border-radius: 50% !important;
    z-index: 2;
    box-shadow: 0 -3px 6px rgba(0,0,0,0.2) !important;
  }
  .trend-rank {
    top: -8px !important;
    left: -4px !important;
    width: 22px !important;
    height: 22px !important;
    font-size: 10px !important;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3) !important;
  }
  .trend-name {
    font-size: 11px !important;
    margin-top: 5px !important;
    margin-bottom: 4px !important;
    height: 2.6em !important;
  }
  .trend-stats-stack {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    justify-content: center !important;
    gap: 4px !important;
    width: 100% !important;
    margin-top: 0 !important;
  }
  .t-type {
    font-size: 8px !important;
    padding: 1px 6px !important;
  }
  .t-mem {
    font-size: 11px !important;
    padding: 2px 0 !important;
  }
  .t-time {
    font-size: 9px !important;
  }
}
@media (min-width: 992px) {
  .trending-grid-modern {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 12px !important;
    row-gap: 50px !important;
    padding-top: 35px !important;
    padding-bottom: 15px !important;
  }
  .trend-card-modern {
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 1;
    border-radius: 12px !important;
    margin-top: 0 !important;
    padding: 28px 4px 12px 4px !important;
    width: 100% !important;
    height: 100% !important;
  }
  .trend-avatar {
    position: absolute;
    width: 48px !important;
    height: 48px !important;
    top: -24px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    padding: 3px !important;
    border-radius: 50% !important;
    z-index: 2;
    box-shadow: 0 -3px 8px rgba(0,0,0,0.3) !important;
  }
  .trend-rank {
    top: -12px !important;
    left: -6px !important;
    width: 24px !important;
    height: 24px !important;
    font-size: 11px !important;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3) !important;
  }
  .trend-name {
    font-size: 11px !important;
    margin-top: 4px !important;
    margin-bottom: 4px !important;
    height: 2.6em !important;
  }
  .trend-stats-stack {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 100% !important;
    margin-top: 0 !important;
  }
  .t-type {
    font-size: 8px !important;
    padding: 2px 8px !important;
  }
  .t-mem {
    font-size: 11px !important;
    padding: 2px 0 !important;
  }
  .t-time {
    font-size: 9px !important;
  }
}
#statsCriteriaBtn {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  margin-left: 5px;
  user-select: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}
#statsCriteriaBtn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: #38bdf8;
}
#statsCriteriaPanel {
  display: none;
  position: absolute;
  z-index: 9999;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 12px;
  background: #1e293b;
  border: 1px solid #475569;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  width: 280px;
  max-width: 90vw;
  text-align: left;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.stats-arrow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
}
.stats-arrow.outer {
  top: -6px;
  border-bottom: 6px solid #475569;
}
.stats-arrow.inner {
  top: -5px;
  border-bottom: 6px solid #1e293b;
}
.stats-header {
  margin: 0 0 10px 0;
  font-size: 0.9rem;
  color: #fff;
  border-bottom: 1px solid #334155;
  padding-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stats-close-mobile {
  cursor: pointer;
  opacity: 0.6;
  font-size: 16px;
}
.stats-list {
  margin: 0;
  padding-left: 20px;
  color: #e2e8f0;
  font-size: 0.8rem;
  list-style-type: disc;
  line-height: 1.5;
}
.stats-list li {
  margin-bottom: 4px;
}
.stats-footer {
  margin-top: 10px;
  font-size: 0.7rem;
  color: #94a3b8;
  font-style: italic;
  border-top: 1px dashed #334155;
  padding-top: 8px;
}
.group-card-modern {
  content-visibility: auto;
  contain-intrinsic-size: 1px 380px;
}
.home-tags-section {
  margin-top: 20px;
  content-visibility: auto;
  contain-intrinsic-size: 1px 200px;
}
.gcard-avatar {
  border: 3px solid var(--card-bg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  background: #f1f5f9;
}
.d-card-avatar {
  border: 1px solid var(--card-border);
  margin-bottom: 8px;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  background: #f1f5f9;
}
.trend-avatar, 
.trending-grid-modern .tech-avatar {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  box-shadow: none !important;
}
.trend-avatar img,
.trending-grid-modern img {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #f1f5f9;
}

/* =========================
   Info page mobile tuning
   ========================= */
@media (min-width: 992px) {
  .info-layout .info-breadcrumb {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .info-layout .main-content {
    grid-column: 1 / 2;
    grid-row: 2;
  }
  .info-layout .info-sidebar {
    grid-column: 2 / 3;
    grid-row: 2;
  }
  .info-layout .info-related-wrap {
    grid-column: 1 / -1;
    grid-row: 3;
  }
}

@media (max-width: 991px) {
  .info-layout .info-breadcrumb {
    order: 1;
  }
  .info-layout .main-content {
    order: 2;
  }
  .info-layout .info-related-wrap {
    order: 3;
  }
  .info-layout .info-sidebar {
    order: 4;
  }
  .info-layout .detail-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }
  .info-layout .detail-stats span {
    justify-content: center;
  }
  .info-layout .detail-stats .stat-members {
    grid-column: 1 / -1;
    justify-self: center;
    width: max-content;
  }
}

/* Make like button clearly actionable (+1) */
.btn-like .like-burst {
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
}
.btn-like .like-cta {
  display: inline-block;
  min-width: auto;
  height: auto;
  padding: 0;
  border-radius: 0;
  margin-left: -6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  background: transparent;
  color: #e11d48;
  transform: translateY(-5px);
}
.btn-action-small.btn-like .like-cta {
  margin-left: 0;
  transform: translateY(-4px);
}

/* =========================
   Safety UX (Safe Mode + Age Gate)
   ========================= */
.safe-mode-toggle {
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(30, 41, 59, 0.72);
  color: #e2e8f0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", "Noto Sans Devanagari", "Noto Sans JP", "Noto Sans KR", "Noto Sans SC", "Arial Unicode MS", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 92px;
  text-align: center;
}
.safe-mode-toggle .safe-mode-label {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.95;
}
.safe-mode-toggle .safe-mode-state {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}
.safe-mode-toggle:hover {
  border-color: #38bdf8;
  color: #fff;
  background: rgba(37, 99, 235, 0.35);
}
.safe-mode-toggle:disabled,
.safe-mode-toggle.is-busy {
  opacity: 0.58;
  cursor: not-allowed;
  filter: saturate(0.7);
}
.footer-safe-mode-toggle {
  min-height: 38px;
}

.report-form input[type="text"],
.report-form input[type="email"],
.report-form input[type="url"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 12px;
  background: #fff;
  color: #0f172a;
}

.age-gate-overlay {
  z-index: 12000;
  background: rgba(2, 6, 23, 0.84);
}

body.age-gate-required {
  overflow: hidden !important;
}
body.age-gate-required > *:not(#ageGateModal) {
  visibility: hidden !important;
}
body.age-gate-required #ageGateModal {
  display: flex !important;
}
.age-gate-box {
  max-width: 460px;
  width: calc(100% - 24px);
}
.age-gate-content {
  padding: 18px 20px 22px;
  color: #cbd5e1;
}
.age-gate-content p {
  margin: 0;
  line-height: 1.55;
}
.age-gate-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.age-btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.age-btn-primary {
  background: #2563eb;
  color: #fff;
}
.age-btn-primary:hover {
  background: #1d4ed8;
}
.age-btn-secondary {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #334155;
}
.age-btn-secondary:hover {
  background: #0f172a;
}

@media (max-width: 991px) {
  .header-right .safe-mode-toggle {
    min-width: 84px;
    padding: 6px 8px;
  }
  .header-right .safe-mode-toggle .safe-mode-label {
    font-size: 13px;
  }
  .header-right .safe-mode-toggle .safe-mode-state {
    font-size: 11px;
  }
  .age-gate-actions {
    flex-direction: column-reverse;
  }
  .age-btn {
    width: 100%;
  }
}
/* Footer mobile alignment: safe mode + language */
@media (max-width: 768px) {
  .main-footer .footer-lang-switch {
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 10px;
  }

  .main-footer .footer-lang-switch .safe-mode-toggle:disabled,
.safe-mode-toggle.is-busy {
  opacity: 0.58;
  cursor: not-allowed;
  filter: saturate(0.7);
}
.footer-safe-mode-toggle {
    margin-left: 0;
    margin-right: 0;
  }

  .main-footer .footer-lang-switch .footer-lang-dropdown {
    display: flex;
    justify-content: center;
  }
}
