  * { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
  
  :root {
    --bg: #0a0e1a;
    --surface: #151b2e;
    --surface-2: #1f2940;
    --surface-3: #2a3654;
    --text: #f1f5f9;
    --text-dim: #94a3b8;
    --primary: #6366f1;
    --primary-light: #818cf8;
    --border: rgba(255,255,255,0.08);
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  }
  
  [data-theme="light"] {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --surface-3: #e2e8f0;
    --text: #0f172a;
    --text-dim: #64748b;
    --border: rgba(0,0,0,0.08);
    --shadow: 0 8px 32px rgba(0,0,0,0.08);
  }
  
  body {
    font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
  }
  

  .icon-btn {
    width: 44px; 
    height: 44px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s;
    font-weight: 600;
  }
  
  .icon-btn:hover { 
    background: var(--surface-2); 
    transform: translateY(-2px);
  }
  
  .search-box {
    position: relative;
  }
  
  .search-box input {
    width: 100%;
    padding: 14px 48px 14px 16px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 16px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    transition: all 0.2s;
  }
  
  .search-box input:focus { 
    border-color: var(--primary);
    background: var(--surface-2);
  }
  
  .search-box::before {
    content: "🔍";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
  }
  
  /* Category Dropdown for Mobile */
  .cat-dropdown {
    position: relative;
    margin: 0 16px 16px;
  }
  
  .cat-dropdown-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
  }
  
  .cat-dropdown-btn:hover {
    background: var(--surface-2);
  }
  
  .cat-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 8px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 50;
    box-shadow: var(--shadow);
  }
  
  .cat-dropdown-menu.show {
    display: block;
    animation: slideDown 0.2s;
  }
  
  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .cat-item {
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .cat-item:hover {
    background: var(--surface-2);
  }
  
  .cat-item.active {
    background: var(--primary);
    color: white;
  }
  
  .cat-count {
    background: var(--surface-3);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
  }
  
  .cat-item.active .cat-count {
    background: rgba(255,255,255,0.2);
  }
  
  /* Desktop Categories */
  .cat-chips {
    display: none;
    gap: 8px;
    padding: 0 16px 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  
  .cat-chips::-webkit-scrollbar { display: none; }
  
  @media (min-width: 768px) {
    .cat-dropdown { display: none; }
    .cat-chips { display: flex; }
  }
  
  .cat-chip {
    padding: 10px 18px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 14px;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
  }
  
  .cat-chip:hover {
    background: var(--surface-2);
    color: var(--text);
  }
  
  .cat-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
  }
  
  /* Stats */
  .stats {
    padding: 0 16px 12px;
    display: flex;
    justify-content: space-between;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
  }
  
  /* Grid */
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 0 16px 100px;
  }
  
  .site-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 18px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-height: 140px;
    justify-content: center;
  }
  
  .site-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
  }
  
  .site-card:active { 
    transform: scale(0.96); 
  }
  
  .site-card.hidden {
    display: none;
  }
  
  .site-icon {
    width: 56px; 
    height: 56px;
    border-radius: 14px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: white;
    letter-spacing: -1px;
    flex-shrink: 0;
  }
  
  .site-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    max-width: 100%;
    word-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: font-size 0.2s;
  }
  
  .pin-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary);
    color: white;
    width: 24px; 
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(99,102,241,0.4);
  }
  
  /* Empty state */
  .empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-dim);
    grid-column: 1/-1;
    display: none;
  }
  
  .empty.show {
    display: block;
  }
  
  .empty-icon { 
    font-size: 72px; 
    margin-bottom: 16px; 
    opacity: 0.5;
  }
  
  .empty-text {
    font-size: 16px;
    font-weight: 600;
  }
  
  /* Toast */
  .toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-2);
    color: var(--text);
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 300;
    pointer-events: none;
    border: 2px solid var(--border);
  }
  
  .toast.show { 
    opacity: 1; 
  }
  
  /* Context menu */
  .ctx-menu {
    position: fixed;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 8px;
    box-shadow: var(--shadow);
    z-index: 250;
    display: none;
    min-width: 180px;
  }
  
  .ctx-menu.show { 
    display: block;
    animation: fadeIn 0.2s;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  .ctx-item {
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
  }
  
  .ctx-item:hover { 
    background: var(--surface-2); 
  }
  
  /* Responsive */
  @media (min-width: 768px) {
    .grid { 
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 16px;
    }
    .site-card {
      min-height: 160px;
    }
    .site-icon {
      width: 64px;
      height: 64px;
      font-size: 24px;
    }
  }
  
  @media (min-width: 1024px) {
    .grid { 
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
  }
  
  /* Auto-resize text */
  .auto-resize {
    display: inline-block;
    max-width: 100%;
  }

.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 16px 20px;
  margin-top: 40px;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.footer-col h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

.footer-about {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-logo {
  font-size: 20px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.footer-about p {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}

.contact-icon {
  width: 28px;
  height: 28px;
  background: var(--surface-2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.footer-bottom {
  max-width: 1200px;
  margin: 28px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.header {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.logo {
  font-size: 18px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
}
