@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;600;700&family=Onest:wght@400;500;600&display=swap');

  :root {
    --bg: #0a0a0f;
    --bg2: #111118;
    --bg3: #1a1a24;
    --card: #16161f;
    --border: rgba(255,255,255,0.07);
    --border2: rgba(255,255,255,0.12);
    --text: #f0f0f8;
    --muted: #7a7a99;
    --accent: #5b5bd6;
    --accent2: #7c6af5;
    --accent-glow: rgba(91,91,214,0.25);
    --teal: #22c9a0;
    --amber: #f5a623;
    --pink: #e05c8a;
    --green: #3ecf8e;
    --radius: 16px;
    --radius-sm: 10px;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

  body {
    font-family: 'Onest', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 80px;
  }

  /* ─── HEADER ─── */
  .header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10,10,15,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px 10px;
  }
  .header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .logo {
    font-family: 'Unbounded', sans-serif;
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #7c6af5 0%, #22c9a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
  }
  .header-actions {
    display: flex;
    gap: 8px;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg3);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.18s;
  }
  .icon-btn:active { transform: scale(0.93); background: var(--card); }
  .icon-btn svg { width: 18px; height: 18px; }

  /* ─── SEARCH ─── */
  .search-wrap {
    margin-top: 10px;
    position: relative;
  }
  .search-input {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px 10px 40px;
    color: var(--text);
    font-family: 'Onest', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
  }
  .search-input::placeholder { color: var(--muted); }
  .search-input:focus { border-color: var(--accent); }
  .search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
  }
  .search-icon svg { width: 16px; height: 16px; }

  /* ─── BANNER ─── */
  .banner-section {
    padding: 16px 16px 0;
  }
  .banner-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 8px;
  }
  .banner-slider {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
  }
  .banner-slider::-webkit-scrollbar { display: none; }

  .banner-card {
    flex: 0 0 calc(100% - 32px);
    scroll-snap-align: start;
    border-radius: var(--radius);
    padding: 10px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.18s;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    isolation: isolate;
  }
  .banner-card:active { transform: scale(0.98); }

  .banner-card.promo-1 { background: linear-gradient(135deg, #1a0f3d 0%, #2d1b69 50%, #1a3a4d 100%); }
  .banner-card.promo-2 { background: linear-gradient(135deg, #0d2b1a 0%, #1a4d2e 50%, #0d3b2b 100%); }
  .banner-card.promo-3 { background: linear-gradient(135deg, #2b1a0d 0%, #4d2e1a 50%, #3b2b0d 100%); }

  .banner-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    letter-spacing: 0.5px;
  }
  .banner-icon {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
  }
  .banner-bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    z-index: -2;
  }
  .banner-card.has-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(180deg, rgba(8, 8, 12, 0.18) 0%, rgba(8, 8, 12, 0.36) 45%, rgba(8, 8, 12, 0.78) 100%),
      linear-gradient(90deg, rgba(8, 8, 12, 0.46) 0%, rgba(8, 8, 12, 0.18) 42%, rgba(8, 8, 12, 0.42) 100%);
    z-index: -1;
  }
  .banner-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 4px;
  }
  .banner-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    line-height: 1.4;
  }
  .banner-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
  }
  .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border2);
    transition: all 0.2s;
  }
  .dot.active {
    background: var(--accent);
    width: 18px;
    border-radius: 3px;
  }

  /* ─── CATEGORIES ─── */
  .section {
    padding: 20px 16px 0;
  }
  .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }
  .section-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.3px;
  }
  .see-all {
    font-size: 12px;
    color: var(--accent2);
    cursor: pointer;
    font-weight: 500;
  }

  .cats-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
  }
  .cats-scroll::-webkit-scrollbar { display: none; }

  .cat-pill {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
  }
  .cat-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }
  .cat-pill:active { transform: scale(0.95); }
  .cat-emoji { font-size: 15px; }

  /* ─── NAV TABS ─── */
  .nav-tabs {
    display: flex;
    gap: 6px;
    background: var(--bg3);
    border-radius: 12px;
    padding: 3px;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-tab {
    flex: 0 0 auto;
    text-align: center;
    padding: 8px 10px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
  }
  .nav-tab svg { width: 14px; height: 14px; }
  .nav-tab.active {
    background: var(--card);
    color: var(--text);
    box-shadow: 0 1px 8px rgba(0,0,0,0.4);
  }

  /* ─── CARDS GRID ─── */
  .cards-grid {
    padding: 14px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .item-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.18s;
    position: relative;
    overflow: hidden;
  }
  .item-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.18s;
    pointer-events: none;
  }
  .item-card:active::before { background: rgba(255,255,255,0.03); }
  .item-card:active { transform: scale(0.99); }

  .card-avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    position: relative;
  }
  .card-avatar.verified::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: var(--teal);
    border-radius: 50%;
    border: 2px solid var(--card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 6l3 3 5-5' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 10px;
    background-repeat: no-repeat;
    background-position: center;
  }

  .card-body { flex: 1; min-width: 0; }
  .card-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
  }
  .card-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
  }

  .icon-action {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    position: relative;
    z-index: 1;
  }

  .icon-action.active {
    color: #ff6b81;
    border-color: rgba(255, 107, 129, 0.35);
    background: rgba(255, 107, 129, 0.12);
  }
  .card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
  }
  .card-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    letter-spacing: 0.3px;
  }
  .tag-app { background: rgba(91,91,214,0.18); color: #9b9cf5; }
  .tag-bot { background: rgba(34,201,160,0.18); color: #22c9a0; }
  .tag-channel { background: rgba(229,96,138,0.18); color: #e8699a; }
  .tag-group { background: rgba(245,166,35,0.18); color: #f5a623; }

  .card-stat {
    font-size: 11px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 3px;
  }
  .card-stat svg { width: 11px; height: 11px; }

  .card-action {
    flex-shrink: 0;
  }
  .btn-add {
    background: rgba(91,91,214,0.2);
    border: 1px solid rgba(91,91,214,0.4);
    color: #9b9cf5;
    border-radius: 10px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    font-family: 'Onest', sans-serif;
    position: relative;
    z-index: 1;
  }
  .btn-add:active { background: rgba(91,91,214,0.35); transform: scale(0.95); }

  .btn-open {
    background: transparent;
    border: 1px solid var(--border2);
    color: var(--muted);
    border-radius: 10px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    font-family: 'Onest', sans-serif;
    position: relative;
    z-index: 1;
  }
  .btn-open:active { background: var(--bg3); transform: scale(0.95); }

  /* ─── BOTTOM NAV ─── */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10,10,15,0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    display: flex;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 200;
  }
  .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 0;
    color: var(--muted);
    transition: color 0.18s;
    font-size: 10px;
    font-weight: 500;
  }
  .nav-item svg { width: 22px; height: 22px; }
  .nav-item.active { color: var(--accent2); }
  .nav-item.active svg path,
  .nav-item.active svg circle { stroke: var(--accent2); }

  /* ─── FEATURED ROW ─── */
  .featured-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 16px 4px;
  }
  .featured-scroll::-webkit-scrollbar { display: none; }

  .feat-card {
    flex: 0 0 140px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 12px;
    cursor: pointer;
    transition: transform 0.18s;
  }
  .feat-card:active { transform: scale(0.96); }
  .feat-icon {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
  }
  .feat-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .feat-subs {
    font-size: 11px;
    color: var(--muted);
  }

  /* ─── DIVIDER ─── */
  .divider {
    height: 1px;
    background: var(--border);
    margin: 20px 16px 0;
  }

  /* ─── EMPTY ─── */
  .empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--muted);
    display: none;
  }
  .empty-state .emoji { font-size: 40px; margin-bottom: 12px; display: block; }
  .empty-state p { font-size: 14px; }

  /* ─── SKELETON ─── */
  @keyframes shimmer {
    0% { background-position: -300px 0; }
    100% { background-position: 300px 0; }
  }
  .skel {
    background: linear-gradient(90deg, var(--bg3) 25%, var(--card) 50%, var(--bg3) 75%);
    background-size: 600px 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 8px;
  }

  /* ─── TOAST ─── */
  .toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #2a2a3d;
    border: 1px solid var(--border2);
    border-radius: 50px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    opacity: 0;
    transition: all 0.25s;
    z-index: 300;
    white-space: nowrap;
    pointer-events: none;
  }
  .toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

.empty-state-static {
  margin: 0 16px;
}

.load-more-wrap {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 8px;
}

.load-more-btn {
  min-width: 160px;
  justify-content: center;
  background: rgba(91,91,214,0.2);
  border: 1px solid rgba(91,91,214,0.4);
  color: #9b9cf5;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  font-family: 'Onest', sans-serif;
}

.load-more-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.load-more-status {
  font-size: 12px;
  color: var(--muted);
}

.profile-page {
  padding-bottom: 100px;
}

  .profile-card,
  .profile-stats {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .profile-card {
    padding: 24px 18px;
    text-align: center;
  }

  .profile-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--teal) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Unbounded', sans-serif;
    font-size: 28px;
    color: #fff;
  }

  .profile-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
  }

  .profile-subtitle {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
  }

  .profile-stats {
    margin-top: 14px;
    padding: 8px 16px;
  }

  .profile-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }

  .profile-stat:last-child {
    border-bottom: 0;
  }

  .profile-stat-label {
    color: var(--muted);
    font-size: 13px;
  }

  .profile-stat-value {
    font-size: 14px;
    font-weight: 600;
    text-align: right;
  }

  .spacer-top { height: 16px; }
/* ─── CATALOG SORT & META ─── */
.meta-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px 10px;
}
.meta-count { font-size: 12px; color: var(--muted); }
.meta-count b { color: var(--text); font-weight: 600; }
.sort-btn {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; color: var(--muted);
  cursor: pointer; padding: 5px 10px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  transition: all 0.15s;
}
.sort-btn:active { background: var(--card); }
.sort-btn svg { width: 13px; height: 13px; }

/* ─── SORT SHEET ─── */
.sort-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: var(--bg2); border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--border2);
  padding: 0 0 max(16px, env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.sort-sheet.open { transform: translateY(0); }
.sheet-drag {
  width: 38px; height: 4px; border-radius: 2px;
  background: var(--border2); margin: 10px auto 16px;
}
.sheet-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 14px; font-weight: 700;
  padding: 0 16px 12px; color: var(--muted);
  letter-spacing: 0.5px; text-transform: uppercase;
}
.sort-opt {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; cursor: pointer; transition: background 0.15s;
  font-size: 14px; font-weight: 500;
}
.sort-opt:active { background: var(--bg3); }
.sort-opt.active { color: var(--accent2); }
.sort-check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border2); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sort-opt.active .sort-check {
  background: var(--accent); border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-size: 10px; background-repeat: no-repeat; background-position: center;
}
.sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 299;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.sheet-overlay.open { opacity: 1; pointer-events: all; }

/* CLEAR BUTTON */
.si-clear {
  position: absolute; right: 25px; top: 50%; transform: translateY(-50%);
  color: var(--muted); cursor: pointer; display: none; padding: 4px;
}
.si-clear svg { width: 13px; height: 13px; }

/* HOT & NEW TAGS */
.tag-hot { background: rgba(255,118,117,0.15); color: #ff7675; }
.tag-new { background: rgba(85,239,196,0.15); color: #55efc4; }

/* CAT SECTIONS */
.cat-section { margin-bottom: 4px; }
.cat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 10px;
}
.cat-label {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Unbounded', sans-serif; font-size: 13px; font-weight: 600;
  letter-spacing: -0.2px;
}
.cat-emoji-badge {
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.cat-more {
  font-size: 12px; color: var(--accent2); cursor: pointer;
  font-weight: 500; display: flex; align-items: center; gap: 3px;
}
.cat-more svg { width: 12px; height: 12px; }

/* LIST CARDS */
.list-cards { display: flex; flex-direction: column; gap: 0; }
.list-cards .item-card {
    border-left: none; border-right: none; border-radius: 0;
    border-top: none;
    border-bottom: 1px solid var(--border);
}
.list-cards .item-card:last-child { border-bottom: none; }
.lc-num {
  font-family: 'Unbounded', sans-serif;
  font-size: 11px; font-weight: 700;
  color: var(--muted); width: 18px; flex-shrink: 0; text-align: right;
}
