/* ═══════════════════════════════════════════════════════════════════════════
   API Store — Lumora (Premium Glass Design)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --apistore-accent: #8b5cf6;
  --apistore-accent2: #6366f1;
  --apistore-accent-rgb: 139, 92, 246;
  --apistore-gradient: linear-gradient(135deg, #8b5cf6, #6366f1);
  --apistore-green: #10b981;
  --apistore-amber: #f59e0b;
  --ast-sidebar-w: 270px;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.apistore-body {
  background: #000;
  color: #fff;
  min-height: 100vh;
  font-family: 'Syne', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  margin-left: 0 !important;
}

.view-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

/* ── Sidebar (Dashboard-style Collapsible) ─────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--ast-sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg, #000);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border, rgba(139, 92, 246, 0.12));
  display: flex;
  flex-direction: column;
  z-index: 1001;
  transform: translateX(calc(var(--ast-sidebar-w) * -1));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.6);
}

#sidebar.open {
  transform: translateX(0);
}

#sidebar .sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border, rgba(139, 92, 246, 0.12));
  flex-shrink: 0;
}

#sidebar .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #c084fc, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#sidebar .logo svg {
  width: 26px;
  height: 26px;
  -webkit-text-fill-color: #8b5cf6;
  color: #8b5cf6;
  flex-shrink: 0;
}

#sidebar .close-sidebar {
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text2, #aaa);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  background: none;
  border: none;
}

#sidebar .close-sidebar:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #fff);
}

#sidebar .close-sidebar svg {
  width: 18px;
  height: 18px;
}

#sidebar .sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

#sidebar .sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--border, rgba(139, 92, 246, 0.12));
  flex-shrink: 0;
}

/* ── Sidebar Overlay ───────────────────────────────────────── */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#overlay.visible {
  display: block;
  opacity: 1;
}

/* ── Desktop: sidebar visible by default, main-content shifted ── */
@media (min-width: 64rem) {
  #sidebar {
    transform: none;
  }
  .main-content {
    margin-left: var(--ast-sidebar-w) !important;
  }
  .menu-toggle,
  #closeSidebar {
    display: none;
  }
}

@media (max-width: 63.99rem) {
  #sidebar {
    transform: translateX(calc(var(--ast-sidebar-w) * -1));
  }
  #sidebar.open {
    transform: translateX(0);
  }
}

/* ── Sidebar Nav Items ─────────────────────────────────────────────────────── */
.ast-nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.78rem 1rem;
  border-radius: 0.625rem;
  color: var(--text2, #aaa);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  width: 100%;
}

.ast-nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.ast-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text, #fff);
}

.ast-nav-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.05));
  color: var(--accent2, #a78bfa);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.ast-nav-item.active svg {
  color: var(--accent, #8b5cf6);
  opacity: 1;
}

/* ── Top Bar ───────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg, #000);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid var(--border, rgba(139, 92, 246, 0.12));
  z-index: 100;
  height: 3.5rem;
  flex-shrink: 0;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.menu-toggle span {
  width: 1.375rem;
  height: 2px;
  background: var(--text2, #aaa);
  border-radius: 2px;
  transition: all 0.3s ease;
  display: block;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
}

.menu-toggle:hover span {
  background: var(--text, #fff);
}

.page-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #fff);
  letter-spacing: -0.2px;
  flex: 1;
  margin-left: 0.75rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ast-coins {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(234, 179, 8, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 100px;
  color: #fbbf24;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.ast-coins svg {
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.4));
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--apistore-accent), #6366f1);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.action-btn:active {
  transform: translateY(0) scale(0.97);
}

.action-btn svg {
  flex-shrink: 0;
}

/* ── Views ──────────────────────────────────────────────────────────────────── */
.ast-view {
  display: none;
  animation: astFadeIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ast-view.active {
  display: block;
}

@keyframes astFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.ast-stat-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius-lg, 20px);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: var(--transition, 0.22s cubic-bezier(0.4, 0, 0.2, 1));
  cursor: default;
}

.ast-stat-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent, #8b5cf6);
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.ast-stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ast-stat-icon svg {
  width: 28px;
  height: 28px;
}

.ast-stat-info {
  display: flex;
  flex-direction: column;
}

.ast-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text, #fff);
  letter-spacing: -0.02em;
}

.ast-stat-label {
  font-size: 0.85rem;
  color: var(--text2, #aaa);
  margin-top: 0.2rem;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SECTION
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius-lg, 20px);
  padding: 1.75rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ast-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.ast-section-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text, #fff);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BROWSE — TOOLBAR
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.ast-search-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg2, #000);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius, 14px);
  padding: 0.65rem 1.15rem;
  flex: 1;
  min-width: 220px;
  transition: var(--transition, 0.22s);
}

.ast-search-box:focus-within {
  border-color: var(--accent, #8b5cf6);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.ast-search-box svg {
  width: 20px;
  height: 20px;
  color: var(--text3, #777);
  flex-shrink: 0;
}

.ast-search-box input {
  background: transparent;
  border: none;
  color: var(--text, #fff);
  font-size: 0.9rem;
  outline: none;
  width: 100%;
  font-family: inherit;
}

.ast-search-box input::placeholder {
  color: var(--text3, #777);
}

.ast-filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ast-filter-select {
  background: var(--bg2, #000);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius-sm, 9px);
  padding: 0.5rem 1rem;
  color: var(--text, #fff);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: var(--transition, 0.22s);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239090a8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.ast-filter-select:focus {
  border-color: var(--accent, #8b5cf6);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   API GRID
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.ast-api-card {
  background: var(--surface, #000);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius-lg, 20px);
  padding: 1.5rem;
  cursor: pointer;
  transition: var(--transition, 0.22s cubic-bezier(0.4, 0, 0.2, 1));
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.ast-api-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), transparent 60%);
  pointer-events: none;
}

.ast-api-card:hover::before {
  opacity: 1;
}

.ast-api-card:hover {
  border-color: var(--accent, #8b5cf6);
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(139, 92, 246, 0.08);
}

.ast-api-card:active {
  transform: translateY(-2px) scale(0.99);
}

.ast-api-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.ast-api-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ast-api-card:hover .ast-api-card-icon {
  transform: scale(1.05);
}

.ast-api-card-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--apistore-accent);
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.1);
  white-space: nowrap;
}

.ast-api-card-price.free {
  color: var(--apistore-green);
  background: rgba(16, 185, 129, 0.1);
}

.ast-api-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #fff);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.01em;
}

.ast-api-card-desc {
  font-size: 0.85rem;
  color: var(--text3, #777);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  flex: 1;
}

.ast-api-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text2, #aaa);
  flex-wrap: wrap;
}

.ast-api-card-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.ast-api-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ast-api-card-badge.owned {
  background: rgba(16, 185, 129, 0.15);
  color: var(--apistore-green);
}

.ast-api-card-badge.paid {
  background: rgba(139, 92, 246, 0.15);
  color: var(--apistore-accent);
}

/* ── Compare toggle button ──────────────────────────────────────── */
.ast-compare-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  background: var(--surface, #000);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius-sm, 9px);
  color: var(--text2, #aaa);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition, 0.22s);
  font-family: inherit;
  white-space: nowrap;
  position: relative;
}

.ast-compare-toggle-btn:hover {
  border-color: var(--accent, #8b5cf6);
  color: var(--accent, #8b5cf6);
  background: rgba(139, 92, 246, 0.06);
}

.ast-compare-toggle-btn.active {
  background: rgba(139, 92, 246, 0.12);
  border-color: var(--accent, #8b5cf6);
  color: var(--accent, #a78bfa);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.ast-compare-toggle-btn.active .ast-compare-count {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--apistore-accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
}

.ast-compare-toggle-btn svg {
  flex-shrink: 0;
}

/* ── Compare checkbox on cards ──────────────────────────────────── */
.ast-compare-check {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--text3, #777);
  background: var(--surface, #000);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition, 0.22s);
  opacity: 0;
  transform: scale(0.8);
  z-index: 2;
}

.ast-compare-check svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  transition: opacity 0.2s;
}

.ast-compare-mode .ast-compare-check {
  opacity: 1;
  transform: scale(1);
}

.ast-compare-check.selected {
  background: var(--apistore-accent);
  border-color: var(--apistore-accent);
}

.ast-compare-check.selected svg {
  opacity: 1;
}

.ast-compare-check:hover {
  border-color: var(--apistore-accent);
}

/* ── Compare Bar (floating bottom) ──────────────────────────────── */
.ast-compare-bar {
  position: fixed;
  bottom: -72px;
  left: 0;
  right: 0;
  background: var(--card-bg, #000);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border, rgba(139, 92, 246, 0.2));
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 999;
  transition: bottom 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
}

.ast-compare-bar.show {
  bottom: 0;
}

.ast-compare-bar-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text2, #aaa);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.ast-compare-bar-count {
  color: var(--accent2, #a78bfa);
  font-size: 0.78rem;
  font-weight: 700;
}

.ast-compare-bar-apis {
  flex: 1;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.25rem 0;
}

.ast-compare-bar-api {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem 0.2rem 0.65rem;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text, #fff);
  white-space: nowrap;
  flex-shrink: 0;
}

.ast-compare-bar-api-remove {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text3, #777);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  padding: 0;
  transition: var(--transition, 0.15s);
}

.ast-compare-bar-api-remove:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.ast-compare-bar-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ast-compare-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm, 9px);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition, 0.22s);
  font-family: inherit;
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  background: var(--surface, #000);
  color: var(--text2, #aaa);
  white-space: nowrap;
}

.ast-compare-bar-btn:hover:not(:disabled) {
  border-color: var(--accent, #8b5cf6);
  color: var(--accent, #8b5cf6);
}

.ast-compare-bar-btn-primary {
  background: linear-gradient(135deg, var(--apistore-accent), #6366f1);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.ast-compare-bar-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.ast-compare-bar-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ── Compare Overlay ────────────────────────────────────────────── */
.ast-compare-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ast-compare-overlay.open {
  display: block;
  opacity: 1;
}

/* ── Compare Modal ──────────────────────────────────────────────── */
.ast-compare-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: min(95vw, 1100px);
  max-height: 85vh;
  background: var(--bg, #000);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.2));
  border-radius: var(--radius-lg, 20px);
  z-index: 1001;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.ast-compare-modal.open {
  display: flex;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.ast-compare-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.ast-compare-modal-header h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text, #fff);
}

.ast-compare-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--surface, #000);
  color: var(--text2, #aaa);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition, 0.22s);
}

.ast-compare-modal-close:hover {
  background: var(--surface2, #111);
  color: var(--text, #fff);
  transform: rotate(90deg);
}

.ast-compare-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.ast-compare-modal-body::-webkit-scrollbar {
  width: 4px;
}

.ast-compare-modal-body::-webkit-scrollbar-thumb {
  background: var(--border, rgba(139, 92, 246, 0.15));
  border-radius: 10px;
}

/* ── Compare Table ──────────────────────────────────────────────── */
.ast-compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.ast-compare-table th {
  padding: 0.75rem 0.85rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text3, #777);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border, rgba(139, 92, 246, 0.1));
  white-space: nowrap;
}

.ast-compare-table th:first-child {
  width: 110px;
  position: sticky;
  left: 0;
  background: var(--bg, #000);
  z-index: 1;
}

.ast-compare-table .ast-compare-api-header {
  text-align: center;
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid var(--border, rgba(139, 92, 246, 0.1));
  min-width: 130px;
}

.ast-compare-table .ast-compare-api-header .api-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text, #fff);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ast-compare-table .ast-compare-api-header .api-category {
  font-size: 0.65rem;
  color: var(--text3, #777);
  margin-top: 0.15rem;
}

.ast-compare-table td {
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text2, #aaa);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  text-align: center;
  vertical-align: middle;
}

.ast-compare-table td:first-child {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text3, #777);
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--bg, #000);
  z-index: 1;
  white-space: nowrap;
}

.ast-compare-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

.ast-compare-table tr:hover td:first-child {
  background: var(--bg, #000);
}

.ast-compare-best {
  color: var(--apistore-green) !important;
  font-weight: 700 !important;
  position: relative;
}

.ast-compare-best::after {
  content: '\u2713';
  font-size: 0.6rem;
  margin-left: 0.3rem;
  opacity: 0.7;
}

.ast-compare-best.free-badge {
  color: var(--apistore-green) !important;
  font-weight: 800 !important;
}

.ast-compare-rating-stars {
  letter-spacing: 1px;
}

.ast-compare-uptime-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.3rem;
  vertical-align: middle;
}

.ast-compare-uptime-dot.excellent { background: var(--apistore-green); }
.ast-compare-uptime-dot.good { background: #34d399; }
.ast-compare-uptime-dot.fair { background: var(--apistore-amber); }
.ast-compare-uptime-dot.poor { background: #ef4444; }

.ast-compare-table-empty {
  text-align: center;
  padding: 3rem;
  color: var(--text3, #777);
}

.ast-compare-table-empty svg {
  width: 48px;
  height: 48px;
  opacity: 0.15;
  margin-bottom: 1rem;
}

.ast-compare-table-empty h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text2, #aaa);
  margin-bottom: 0.25rem;
}

.ast-compare-table-empty p {
  font-size: 0.85rem;
}

/* ── Tags on cards ─────────────────────────────────────────────────── */
.ast-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.ast-tag {
  padding: 0.15rem 0.5rem;
  background: rgba(var(--apistore-accent-rgb), 0.1);
  color: var(--accent2, #a78bfa);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border, rgba(139, 92, 246, 0.1));
}

.ast-page-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius-sm, 9px);
  background: var(--surface, #000);
  color: var(--text2, #aaa);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition, 0.22s);
  font-family: inherit;
}

.ast-page-btn:hover:not(:disabled) {
  border-color: var(--accent, #8b5cf6);
  color: var(--accent, #8b5cf6);
  background: rgba(139, 92, 246, 0.08);
  transform: translateY(-2px);
}

.ast-page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.ast-page-btn.active {
  background: var(--apistore-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.ast-page-info {
  font-size: 0.85rem;
  color: var(--text3, #777);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DETAIL DRAWER
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1100;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ast-detail-overlay.open {
  display: block;
  opacity: 1;
}

.ast-detail-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  background: var(--bg, #000);
  z-index: 1101;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  overflow: hidden;
}

.ast-detail-drawer.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ast-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.ast-detail-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text, #fff);
}

.ast-detail-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--surface, #000);
  color: var(--text2, #aaa);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition, 0.22s);
}

.ast-detail-close:hover {
  background: var(--surface2, #111);
  color: var(--text, #fff);
  transform: rotate(90deg);
}

.ast-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.ast-detail-body::-webkit-scrollbar {
  width: 4px;
}

.ast-detail-body::-webkit-scrollbar-thumb {
  background: var(--border, rgba(139, 92, 246, 0.15));
  border-radius: 10px;
}

/* detail-section replaced by detail-card */

/* ── Detail Hero ──────────────────────────────────────────────── */
.ast-detail-hero {
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(99,102,241,0.06));
  border: 1px solid rgba(139,92,246,0.12);
  border-radius: var(--radius-lg, 20px);
}

.ast-detail-hero-info {
  min-width: 0;
}

.ast-detail-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.ast-detail-hero-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text, #fff);
  line-height: 1.3;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}

.ast-detail-hero-price {
  flex-shrink: 0;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  background: rgba(var(--apistore-accent-rgb), 0.15);
  border: 1px solid rgba(var(--apistore-accent-rgb), 0.25);
  color: var(--accent2, #a78bfa);
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
}

.ast-detail-hero-price.free {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--apistore-green);
}

.ast-detail-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.ast-detail-hero-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem 0.45rem;
  border-radius: 100px;
  background: var(--surface, #000);
  border: 1px solid var(--border, rgba(139,92,246,0.1));
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text2, #aaa);
  white-space: nowrap;
}

.ast-detail-hero-ver {
  font-size: 0.7rem;
  color: var(--text3, #777);
  font-weight: 600;
}

/* ── Quick Stats Row ──────────────────────────────────────────── */
.ast-detail-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ast-detail-stat {
  text-align: center;
  padding: 0.75rem 0.5rem;
  background: var(--surface, #000);
  border: 1px solid var(--border, rgba(139,92,246,0.08));
  border-radius: var(--radius, 14px);
}

.ast-detail-stat-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text, #fff);
}

.ast-detail-stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text3, #777);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

/* ── Seller Row ───────────────────────────────────────────────── */
.ast-detail-seller-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.65rem 1rem;
  background: var(--surface, #000);
  border: 1px solid var(--border, rgba(139,92,246,0.08));
  border-radius: var(--radius, 14px);
}

.ast-detail-seller-id {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ast-detail-seller-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text3, #777);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ast-detail-seller-code {
  font-size: 0.82rem;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  color: var(--text, #fff);
  background: var(--bg2, #000);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.ast-copy-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 7px;
  background: var(--bg2, #000);
  color: var(--text2, #aaa);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition, 0.22s);
}

.ast-copy-btn:hover {
  background: var(--accent, #8b5cf6);
  color: #fff;
}

.ast-report-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.12);
  color: #ef4444;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition, 0.22s);
  font-family: inherit;
}

.ast-report-btn:hover {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.25);
}

/* ── Detail Card ──────────────────────────────────────────────── */
.ast-detail-card {
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
  background: var(--surface, #000);
  border: 1px solid var(--border, rgba(139,92,246,0.08));
  border-radius: var(--radius, 14px);
}

.ast-detail-card h3 {
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text2, #aaa);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ast-detail-card p {
  font-size: 0.88rem;
  color: var(--text, #fff);
  line-height: 1.6;
  margin: 0;
}

.ast-detail-card pre {
  background: var(--bg2, #000);
  border: 1px solid var(--border, rgba(139,92,246,0.1));
  border-radius: var(--radius-sm, 9px);
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--text2, #aaa);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

.ast-detail-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem 0 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius, 14px);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition, 0.22s cubic-bezier(0.4, 0, 0.2, 1));
  border: none;
  font-family: inherit;
  white-space: nowrap;
}

.ast-btn-primary {
  background: linear-gradient(135deg, var(--apistore-accent), #6366f1);
  color: #fff;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.ast-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.45);
}

.ast-btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.ast-btn-primary:disabled {
  opacity: 0.5;
  cursor: default;
}

.ast-btn-secondary {
  background: var(--surface, #000);
  color: var(--text2, #aaa);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
}

.ast-btn-secondary:hover {
  border-color: var(--accent, #8b5cf6);
  color: var(--accent, #8b5cf6);
  background: rgba(139, 92, 246, 0.06);
  transform: translateY(-2px);
}

.ast-btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.ast-btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.ast-btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.ast-btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}

.ast-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm, 9px);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  background: var(--surface, #000);
  color: var(--text2, #aaa);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition, 0.22s);
  font-family: inherit;
}

.ast-icon-btn:hover {
  border-color: var(--accent, #8b5cf6);
  color: var(--accent, #8b5cf6);
  background: rgba(139, 92, 246, 0.06);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MY APIs
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-my-api-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ast-my-api-item {
  background: var(--surface, #000);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius-lg, 20px);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  transition: var(--transition, 0.22s);
}

.ast-my-api-item:hover {
  border-color: rgba(139, 92, 246, 0.25);
  background: rgba(255, 255, 255, 0.02);
}

.ast-my-api-info {
  flex: 1;
  min-width: 220px;
}

.ast-my-api-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
  color: var(--text, #fff);
}

.ast-my-api-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text2, #aaa);
  flex-wrap: wrap;
  align-items: center;
}

.ast-my-api-key {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg2, #000);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius-sm, 9px);
  padding: 0.45rem 0.75rem;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--text2, #aaa);
  margin-top: 0.5rem;
}

.ast-my-api-key code {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent2, #a78bfa);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ast-badge.most_popular {
  background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(245,158,11,0.05));
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.3);
}

.ast-badge.popular {
  background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(139,92,246,0.05));
  color: #a78bfa;
  border: 1px solid rgba(139,92,246,0.3);
}

.ast-badge.og {
  background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(59,130,246,0.05));
  color: #60a5fa;
  border: 1px solid rgba(59,130,246,0.3);
}

.ast-badge.new {
  background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(16,185,129,0.05));
  color: #34d399;
  border: 1px solid rgba(16,185,129,0.3);
}

.ast-badge.leaving_soon {
  background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(239,68,68,0.05));
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
}

.ast-icon-btn.undelete-btn {
  color: #34d399;
}

.ast-icon-btn.undelete-btn:hover {
  background: rgba(16,185,129,0.12);
  color: #34d399;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ANALYTICS SECTION
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-analytics-row {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ast-analytics-chart {
  min-height: 160px;
  position: relative;
}

.ast-analytics-summary {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ast-analytics-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border, rgba(139,92,246,0.1));
  border-radius: var(--radius-sm, 9px);
}

.ast-analytics-summary-item .label {
  font-size: 0.82rem;
  color: var(--text2, #aaa);
}

.ast-analytics-summary-item .value {
  font-size: 0.9rem;
  font-weight: 700;
}

.ast-analytics-summary-item .value.good { color: var(--apistore-green); }
.ast-analytics-summary-item .value.fair { color: var(--apistore-amber); }
.ast-analytics-summary-item .value.poor { color: #ef4444; }

/* ═══════════════════════════════════════════════════════════════════════════════
   CHART BARS
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 150px;
  padding: 1rem 0.5rem 0;
}

.ast-chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  height: 100%;
  justify-content: flex-end;
}

.ast-chart-bar {
  width: 100%;
  max-width: 40px;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--apistore-accent), #6366f1);
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0.85;
}

.ast-chart-bar-wrap:hover .ast-chart-bar {
  opacity: 1;
}

.ast-chart-bar-label {
  font-size: 0.6rem;
  color: var(--text3, #777);
  white-space: nowrap;
  text-align: center;
}

.ast-chart-bar-value {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text2, #aaa);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DETAIL ANALYTICS
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-detail-analytics {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border, rgba(139,92,246,0.1));
}

.ast-detail-analytics-header h3 {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text2, #aaa);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ast-detail-analytics-chart {
  min-height: 100px;
  margin-bottom: 1rem;
}

.ast-detail-analytics-chart .ast-chart-bars {
  height: 100px;
}

.ast-detail-analytics-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ast-detail-analytic-stat {
  text-align: center;
  padding: 0.6rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border, rgba(139,92,246,0.1));
  border-radius: var(--radius-sm, 9px);
}

.ast-detail-analytic-stat .stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text, #fff);
}

.ast-detail-analytic-stat .stat-label {
  font-size: 0.7rem;
  color: var(--text3, #777);
  margin-top: 0.15rem;
}

.ast-detail-analytic-stat .stat-value.excellent { color: var(--apistore-green); }
.ast-detail-analytic-stat .stat-value.good { color: #34d399; }
.ast-detail-analytic-stat .stat-value.warning { color: var(--apistore-amber); }
.ast-detail-analytic-stat .stat-value.fair { color: var(--apistore-amber); }
.ast-detail-analytic-stat .stat-value.poor { color: #ef4444; }
.ast-detail-analytic-stat .stat-value.unknown { color: var(--text3, #777); }

.ast-detail-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
}

.ast-detail-status-badge.excellent { background: rgba(16,185,129,0.15); color: var(--apistore-green); }
.ast-detail-status-badge.good { background: rgba(52,211,153,0.15); color: #34d399; }
.ast-detail-status-badge.warning { background: rgba(245,158,11,0.15); color: var(--apistore-amber); }
.ast-detail-status-badge.fair { background: rgba(245,158,11,0.15); color: var(--apistore-amber); }
.ast-detail-status-badge.poor { background: rgba(239,68,68,0.15); color: #ef4444; }
.ast-detail-status-badge.unknown { background: rgba(90,90,114,0.15); color: var(--text3, #777); }

/* ═══════════════════════════════════════════════════════════════════════════════
   TOP USERS
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-detail-top-users h3 {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text2, #aaa);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ast-top-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.ast-top-user:last-child { border-bottom: none; }

.ast-top-user-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(139,92,246,0.1);
  color: var(--accent2, #a78bfa);
  flex-shrink: 0;
}

.ast-top-user-rank.top1 { background: linear-gradient(135deg, rgba(245,158,11,0.3), rgba(245,158,11,0.1)); color: #f59e0b; }
.ast-top-user-rank.top2 { background: rgba(148,163,184,0.2); color: #94a3b8; }
.ast-top-user-rank.top3 { background: rgba(180,83,9,0.2); color: #d97706; }

.ast-top-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--apistore-accent), #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.ast-top-user-info {
  flex: 1;
  min-width: 0;
}

.ast-top-user-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ast-top-user-company {
  font-size: 0.72rem;
  color: var(--text3, #777);
}

.ast-top-user-usage {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent2, #a78bfa);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   COMPOSE API SELECTOR
   ═══════════════════════════════════════════════════════════════════════════════ */
.comp-api-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
}

.comp-api-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  background: var(--bg2, #000);
  border: 1px solid var(--border, rgba(139,92,246,0.15));
  border-radius: var(--radius-sm, 9px);
  cursor: pointer;
  transition: var(--transition, 0.22s);
}

.comp-api-item:hover {
  border-color: rgba(139,92,246,0.3);
  background: rgba(255,255,255,0.03);
}

.comp-api-item.selected {
  border-color: var(--apistore-accent);
  background: rgba(139,92,246,0.1);
  box-shadow: 0 0 0 2px rgba(139,92,246,0.2);
}

.comp-api-item-check {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--text3, #777);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition, 0.22s);
}

.comp-api-item.selected .comp-api-item-check {
  background: var(--apistore-accent);
  border-color: var(--apistore-accent);
}

.comp-api-item-check svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}

.comp-api-item.selected .comp-api-item-check svg {
  opacity: 1;
}

.comp-api-item-info {
  flex: 1;
  min-width: 0;
}

.comp-api-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text, #fff);
}

.comp-api-item-category {
  font-size: 0.7rem;
  color: var(--text3, #777);
}

/* ── Composition list ──────────────────────────────────────────── */
.ast-composition-item {
  background: var(--bg2, #000);
  border: 1px solid var(--border, rgba(139,92,246,0.15));
  border-radius: var(--radius, 14px);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  transition: var(--transition, 0.22s);
}

.ast-composition-item:hover {
  border-color: rgba(139,92,246,0.25);
}

.ast-composition-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.ast-composition-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139,92,246,0.08);
  border-radius: 10px;
}

.ast-composition-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text, #fff);
}

.ast-composition-apis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.ast-composition-api-tag {
  padding: 0.2rem 0.6rem;
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.15);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--accent2, #a78bfa);
}

.ast-composition-desc {
  font-size: 0.82rem;
  color: var(--text3, #777);
  margin-top: 0.3rem;
}

.ast-composition-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LUMA AI BUTTON
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.ast-form-label-row label {
  margin-bottom: 0;
}

.ast-luma-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(99,102,241,0.1));
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: 100px;
  color: var(--accent2, #a78bfa);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition, 0.22s);
  font-family: inherit;
  white-space: nowrap;
}

.ast-luma-btn:hover {
  background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(99,102,241,0.15));
  border-color: rgba(139,92,246,0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139,92,246,0.2);
}

.ast-luma-btn:active {
  transform: translateY(0);
}

.ast-luma-btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

.ast-luma-btn svg {
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE ADDITIONS
   ═══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .ast-detail-analytics-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .comp-api-selector {
    grid-template-columns: 1fr;
  }
  /* Detail view mobile */
  .ast-detail-drawer {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
  }
  .ast-detail-body {
    padding: 1rem;
  }
  .ast-detail-header {
    padding: 1rem 1.15rem;
  }
  .ast-detail-hero {
    padding: 0.85rem 1rem;
  }
  .ast-detail-hero-name {
    font-size: 0.95rem;
  }
  .ast-detail-hero-price {
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
  }
  .ast-detail-stats-row {
    gap: 0.4rem;
  }
  .ast-detail-stat {
    padding: 0.6rem 0.4rem;
  }
  .ast-detail-stat-val {
    font-size: 0.95rem;
  }
  .ast-detail-seller-row {
    padding: 0.55rem 0.75rem;
    gap: 0.5rem;
  }
  .ast-detail-seller-code {
    font-size: 0.75rem;
  }
  .ast-detail-card {
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
  }
  .ast-detail-card p,
  .ast-detail-card pre {
    font-size: 0.82rem;
  }
  .ast-detail-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  .ast-detail-actions .ast-btn {
    width: 100%;
    justify-content: center;
  }
}

.ast-my-api-actions {
  display: flex;
  gap: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SELL FORM
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-sell-form {
  max-width: 640px;
}

.ast-form-group {
  margin-bottom: 1.5rem;
}

.ast-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text2, #aaa);
}

.ast-form-group input,
.ast-form-group textarea,
.ast-form-group select {
  width: 100%;
  padding: 0.85rem 1.15rem;
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius, 14px);
  background: var(--bg2, #000);
  color: var(--text, #fff);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition, 0.22s);
  box-sizing: border-box;
}

.ast-form-group input:focus,
.ast-form-group textarea:focus,
.ast-form-group select:focus {
  border-color: var(--accent, #8b5cf6);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.ast-form-group textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.ast-form-group select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239090a8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.ast-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MY LISTINGS
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-listing-item {
  background: var(--surface, #000);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius-lg, 20px);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  transition: var(--transition, 0.22s);
}

.ast-listing-item:hover {
  border-color: rgba(139, 92, 246, 0.25);
}

.ast-listing-info {
  flex: 1;
  min-width: 220px;
}

.ast-listing-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
  color: var(--text, #fff);
}

.ast-listing-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text2, #aaa);
  flex-wrap: wrap;
  align-items: center;
}

.ast-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ast-status-badge.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--apistore-green);
}

.ast-status-badge.suspended {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.ast-status-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--apistore-amber);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TEST CONSOLE
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-test-console {
  background: var(--surface, #000);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius-lg, 20px);
  overflow: hidden;
  margin-top: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.ast-test-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  background: rgba(10, 10, 15, 0.6);
}

.ast-test-header span {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text, #fff);
}

.ast-test-header select {
  background: var(--bg2, #000);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius-sm, 9px);
  padding: 0.35rem 0.75rem;
  color: var(--text, #fff);
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  font-family: inherit;
  margin-left: auto;
}

.ast-test-body {
  padding: 1.25rem;
}

.ast-test-json {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.82rem;
  background: var(--bg, #000);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius-sm, 9px);
  padding: 0.85rem 1rem;
  min-height: 100px;
  width: 100%;
  color: var(--text, #fff);
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  line-height: 1.5;
}

.ast-test-json:focus {
  border-color: var(--accent, #8b5cf6);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.08);
}

.ast-test-output {
  background: #000;
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius-sm, 9px);
  padding: 1rem 1.25rem;
  margin-top: 0.75rem;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.8rem;
  color: #ddd;
  overflow-x: auto;
  white-space: pre-wrap;
  max-height: 350px;
  overflow-y: auto;
  line-height: 1.6;
}

.ast-test-output .success { color: var(--apistore-green); }
.ast-test-output .error { color: #ef4444; }
.ast-test-output .key { color: #818cf8; }
.ast-test-output .string { color: #34d399; }
.ast-test-output .number { color: #fbbf24; }

/* ═══════════════════════════════════════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text3, #777);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.ast-empty svg {
  width: 56px;
  height: 56px;
  opacity: 0.15;
  margin-bottom: 0.5rem;
}

.ast-empty h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text2, #aaa);
}

.ast-empty p {
  font-size: 0.9rem;
  color: var(--text3, #777);
  max-width: 300px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LOADING
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
}

.ast-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border, rgba(139, 92, 246, 0.15));
  border-top-color: var(--accent, #8b5cf6);
  border-radius: 50%;
  animation: astSpin 0.7s linear infinite;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
}

@keyframes astSpin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BACK BUTTON
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius-sm, 9px);
  background: var(--surface, #000);
  color: var(--text2, #aaa);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition, 0.22s);
  font-family: inherit;
}

.ast-back-btn:hover {
  border-color: var(--accent, #8b5cf6);
  color: var(--accent, #8b5cf6);
  background: rgba(139, 92, 246, 0.06);
  transform: translateX(-4px);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LUMA AI MODAL
   ═══════════════════════════════════════════════════════════════════════════════ */

.ast-luma-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1100;
  display: none !important;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ast-luma-overlay.open {
  display: block !important;
  opacity: 1;
}

.ast-luma-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: min(95vw, 600px);
  max-height: 85vh;
  background: var(--bg, #000);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.2));
  border-radius: var(--radius-lg, 20px);
  z-index: 1101;
  display: none !important;
  flex-direction: column;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.ast-luma-modal.open {
  display: flex !important;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.ast-luma-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.ast-luma-modal-header h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #fff);
}

.ast-luma-modal-header h2 svg {
  color: var(--accent2, #a78bfa);
}

.ast-luma-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--surface, #000);
  color: var(--text2, #aaa);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition, 0.22s);
}

.ast-luma-modal-close:hover {
  background: var(--surface2, #111);
  color: var(--text, #fff);
  transform: rotate(90deg);
}

.ast-luma-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.ast-luma-modal-body::-webkit-scrollbar {
  width: 4px;
}

.ast-luma-modal-body::-webkit-scrollbar-thumb {
  background: var(--border, rgba(139, 92, 246, 0.15));
  border-radius: 10px;
}

/* ── Loading State ────────────────────────────────── */
.ast-luma-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 3rem;
  color: var(--text2, #aaa);
  font-size: 0.9rem;
  font-weight: 600;
}

.ast-luma-loading .ast-spinner {
  width: 48px;
  height: 48px;
}

/* ── Prompt Stage ─────────────────────────────────── */
.ast-luma-prompt {
  padding: 1rem 0;
}

.ast-luma-prompt-text {
  font-size: 0.95rem;
  color: var(--text, #fff);
  margin-bottom: 1rem;
  line-height: 1.5;
  font-weight: 500;
}

.ast-luma-prompt-input {
  width: 100%;
  min-height: 100px;
  padding: 0.85rem 1.15rem;
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius, 14px);
  background: var(--bg2, #000);
  color: var(--text, #fff);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition, 0.22s);
  box-sizing: border-box;
  resize: vertical;
  line-height: 1.5;
}

.ast-luma-prompt-input:focus {
  border-color: var(--accent, #8b5cf6);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.ast-luma-prompt-input::placeholder {
  color: var(--text3, #777);
}

.ast-luma-prompt-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

/* ── Result Stage ─────────────────────────────────── */
.ast-luma-result {
  animation: astFadeIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ast-luma-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.ast-luma-result-content {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.12));
  border-radius: var(--radius, 14px);
  padding: 1.25rem;
  max-height: 50vh;
  overflow-y: auto;
  line-height: 1.7;
  font-size: 0.9rem;
  color: var(--text, #fff);
}

.ast-luma-result-content::-webkit-scrollbar {
  width: 4px;
}

.ast-luma-result-content::-webkit-scrollbar-thumb {
  background: var(--border, rgba(139, 92, 246, 0.15));
  border-radius: 10px;
}

.ast-luma-paragraph {
  margin: 0 0 0.75rem 0;
  line-height: 1.7;
  color: var(--text, #fff);
}

.ast-luma-paragraph:last-child {
  margin-bottom: 0;
}

.ast-luma-heading {
  font-weight: 700;
  color: var(--text, #fff);
  margin: 1.25rem 0 0.5rem 0;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
  line-height: 1.4;
}

.ast-luma-heading:first-child {
  margin-top: 0;
}

h2.ast-luma-heading {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

h3.ast-luma-heading {
  font-size: 1.05rem;
}

h4.ast-luma-heading {
  font-size: 0.95rem;
}

/* ── Inline formatting within result content ──────────────────── */
.ast-luma-result-content strong {
  color: var(--text, #fff);
  font-weight: 700;
}

.ast-luma-result-content em {
  font-style: italic;
  color: var(--accent4, #c4b5fd);
}

.ast-luma-result-content code {
  background: rgba(139, 92, 246, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.08);
}

.ast-luma-result-content a {
  color: #60a5fa;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.ast-luma-result-content a:hover {
  color: #93bbfd;
}

.ast-luma-list-item {
  padding: 0.15rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  color: var(--text, #fff);
  line-height: 1.6;
}

.ast-luma-bullet {
  color: var(--accent2, #a78bfa);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Code blocks ─────────────────────────────────────────────────── */
.ast-code-wrapper {
  position: relative;
  margin: 0.75rem 0;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(139, 92, 246, 0.12);
}

.ast-code-lang {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.2rem 0.6rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.12);
  border-radius: 0 10px 0 8px;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.ast-code-block {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  background: transparent;
}

.ast-code-block code {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #fff;
  white-space: pre;
  background: none !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}

/* ── Tables ─────────────────────────────────────────────────────── */
.ast-table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.12);
}

.ast-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  line-height: 1.5;
}

.ast-table th {
  background: rgba(139, 92, 246, 0.08);
  color: var(--text, #fff);
  font-weight: 700;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.12);
  white-space: nowrap;
}

.ast-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.06);
  color: var(--text, #e0e0e8);
}

.ast-table tbody tr:last-child td {
  border-bottom: none;
}

.ast-table tbody tr:hover {
  background: rgba(139, 92, 246, 0.04);
}

/* ── Horizontal rule ────────────────────────────────────────────── */
.ast-hr {
  border: none;
  height: 1px;
  background: rgba(139, 92, 246, 0.15);
  margin: 1rem 0;
}

/* ── Blockquote ─────────────────────────────────────────────────── */
.ast-blockquote {
  margin: 0.5rem 0;
  padding: 0.6rem 1rem;
  border-left: 3px solid rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.04);
  border-radius: 0 8px 8px 0;
  color: var(--text, #fff);
  font-style: italic;
  line-height: 1.6;
}

/* ── Lists ──────────────────────────────────────────────────────── */
.ast-ul {
  margin: 0.5rem 0;
  padding-left: 0;
  list-style: none;
}

.ast-li {
  padding: 0.15rem 0 0.15rem 1.2rem;
  position: relative;
  color: var(--text, #fff);
  line-height: 1.6;
}

.ast-li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent2, #a78bfa);
  font-weight: 700;
}

/* ── Inline code override ───────────────────────────────────────── */
.ast-inline-code {
  background: rgba(139, 92, 246, 0.12);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.08);
}

.ast-luma-result-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, rgba(139, 92, 246, 0.1));
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TOGGLE SWITCH
   ═══════════════════════════════════════════════════════════════════════════════ */

.ast-toggle-label,
.ast-form-group .ast-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text, #fff);
  user-select: none;
  margin-bottom: 0;
}

.ast-toggle-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.ast-toggle-slider {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
  background: var(--text3, #777);
  border-radius: 11px;
  transition: background 0.25s ease;
}

.ast-toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ast-toggle-label input:checked + .ast-toggle-slider {
  background: var(--apistore-accent, #8b5cf6);
}

.ast-toggle-label input:checked + .ast-toggle-slider::after {
  transform: translateX(16px);
}

.ast-toggle-label:hover .ast-toggle-slider {
  opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PING — Health Check
   ═══════════════════════════════════════════════════════════════════════════════ */

.ast-ping-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.ast-ping-result {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--text2, #aaa);
  flex: 1;
  min-width: 160px;
}

.ast-ping-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.85rem;
}

.ast-ping-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-online {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  animation: astPingPulse 2s ease-in-out infinite;
}

.dot-offline {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

@keyframes astPingPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
  50% { box-shadow: 0 0 16px rgba(16, 185, 129, 0.8); }
}

.ast-ping-status.online {
  color: #10b981;
}

.ast-ping-status.offline {
  color: #ef4444;
}

.ast-ping-details {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text3, #777);
  flex-wrap: wrap;
}

.ast-ping-details strong {
  color: var(--text2, #aaa);
  font-weight: 700;
}

.ast-ping-error {
  color: #ef4444;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RATING — Star Rating
   ═══════════════════════════════════════════════════════════════════════════════ */

.ast-stars {
  display: inline-flex;
  gap: 0.25rem;
}

.ast-star {
  font-size: 1.5rem;
  color: var(--text3, #777);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.ast-star.active,
.ast-star.hover {
  color: #f59e0b;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.ast-star:hover {
  transform: scale(1.2);
}

.ast-star:active {
  transform: scale(0.85);
}

.ast-rating-info {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--text2, #aaa);
}

.ast-rating-count {
  color: var(--text3, #777);
  font-size: 0.78rem;
}

.ast-rating-no {
  font-size: 0.82rem;
  color: var(--text3, #777);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   COMMENTS & REVIEWS
   ═══════════════════════════════════════════════════════════════════════════════ */

.ast-comments-list {
  margin-bottom: 1rem;
}

.ast-comment-empty {
  text-align: center;
  padding: 1.5rem 0;
  color: var(--text3, #777);
  font-size: 0.88rem;
}

.ast-comment-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.ast-comment-item:last-child {
  border-bottom: none;
}

.ast-comment-item.deleted {
  opacity: 0.4;
  padding: 0.5rem 0;
}

.ast-comment-deleted-msg {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text3, #777);
  padding-left: 2.5rem;
}

.ast-comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--apistore-accent), #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.ast-comment-avatar.small {
  width: 28px;
  height: 28px;
  font-size: 0.6rem;
}

.ast-comment-body {
  flex: 1;
  min-width: 0;
}

.ast-comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.ast-comment-author {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text, #fff);
}

.ast-comment-date {
  font-size: 0.72rem;
  color: var(--text3, #777);
  margin-left: auto;
}

.ast-comment-text {
  font-size: 0.88rem;
  color: var(--text2, #aaa);
  line-height: 1.6;
  word-wrap: break-word;
}

.ast-comment-action {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text3, #777);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0;
}

.ast-comment-item:hover .ast-comment-action {
  opacity: 1;
}

.ast-comment-action.delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.ast-comment-reply-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text3, #777);
  cursor: pointer;
  margin-top: 0.35rem;
  transition: color 0.2s ease;
}

.ast-comment-reply-toggle:hover {
  color: var(--accent2, #a78bfa);
}

.ast-comment-reply-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  align-items: flex-start;
}

.ast-reply-input {
  flex: 1;
  min-height: 36px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border, rgba(139,92,246,0.15));
  border-radius: var(--radius-sm, 9px);
  background: var(--bg2, #000);
  color: var(--text, #fff);
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
  resize: vertical;
  box-sizing: border-box;
}

.ast-reply-input:focus {
  border-color: var(--accent, #8b5cf6);
}

.ast-comment-reply {
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 0 0.65rem 1.25rem;
  margin-top: 0.5rem;
  border-left: 2px solid rgba(139,92,246,0.1);
}

.ast-comment-reply.deleted {
  opacity: 0.4;
  border-left-color: transparent;
}

.ast-comment-reply .ast-comment-header {
  margin-bottom: 0.1rem;
}

.ast-comment-reply .ast-comment-text {
  font-size: 0.84rem;
}

.ast-comment-owner-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(139,92,246,0.12);
  color: #a78bfa;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ── Comment Form ──────────────────────────────────────────────── */
.ast-comment-form {
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.03);
}

.ast-comment-input {
  width: 100%;
  min-height: 56px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border, rgba(139,92,246,0.15));
  border-radius: var(--radius, 14px);
  background: var(--bg2, #000);
  color: var(--text, #fff);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
  resize: vertical;
  box-sizing: border-box;
  line-height: 1.5;
}

.ast-comment-input:focus {
  border-color: var(--accent, #8b5cf6);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.08);
}

.ast-comment-input::placeholder {
  color: var(--text3, #777);
}

.ast-comment-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.65rem;
}

.ast-comment-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.15rem;
  border: none;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--apistore-accent, #8b5cf6), #6366f1);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition, 0.22s);
  font-family: inherit;
}

.ast-comment-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139,92,246,0.3);
}

.ast-comment-submit:active {
  transform: scale(0.96);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius, 14px);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 2100;
  animation: astToastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
}

.ast-toast.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95));
  color: #fff;
}

.ast-toast.error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95));
  color: #fff;
}

.ast-toast.info {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(79, 70, 229, 0.95));
  color: #fff;
}

@keyframes astToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PROXY CALL — API Proxy Call Modal
   ═══════════════════════════════════════════════════════════════════════════════ */

.ast-proxy-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1100;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ast-proxy-overlay.open {
  display: block;
  opacity: 1;
}

.ast-proxy-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: min(95vw, 680px);
  max-height: 90vh;
  background: var(--bg, #000);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.2));
  border-radius: var(--radius-lg, 20px);
  z-index: 1101;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.ast-proxy-modal.open {
  display: flex;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.ast-proxy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.ast-proxy-modal-header h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text, #fff);
}

.ast-proxy-modal-header h2 svg {
  color: var(--apistore-green);
}

.ast-proxy-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--surface, #000);
  color: var(--text2, #aaa);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition, 0.22s);
}

.ast-proxy-modal-close:hover {
  background: var(--surface2, #111);
  color: var(--text, #fff);
  transform: rotate(90deg);
}

.ast-proxy-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

.ast-proxy-modal-body::-webkit-scrollbar {
  width: 4px;
}

.ast-proxy-modal-body::-webkit-scrollbar-thumb {
  background: var(--border, rgba(139, 92, 246, 0.15));
  border-radius: 10px;
}

.ast-proxy-api-info {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: rgba(139,92,246,0.06);
  border: 1px solid rgba(139,92,246,0.12);
  border-radius: var(--radius, 14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ast-proxy-api-info .api-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text, #fff);
}

.ast-proxy-api-info .api-key {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--accent2, #a78bfa);
  background: var(--bg2, #000);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(139,92,246,0.1);
  word-break: break-all;
}

.ast-proxy-api-info .api-endpoint {
  font-size: 0.78rem;
  color: var(--text3, #777);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.ast-proxy-form-row {
  display: flex;
  gap: 0.75rem;
}

.ast-proxy-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.ast-proxy-response {
  margin-top: 1rem;
  background: #000;
  border: 1px solid var(--border, rgba(139, 92, 246, 0.15));
  border-radius: var(--radius, 14px);
  overflow: hidden;
}

.ast-proxy-response-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  background: rgba(10, 10, 15, 0.6);
  border-bottom: 1px solid var(--border, rgba(139, 92, 246, 0.1));
}

.ast-proxy-response-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text, #fff);
}

.ast-proxy-response-meta {
  font-size: 0.75rem;
  color: var(--text3, #777);
  margin-left: auto;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.ast-proxy-response-meta .status-good {
  color: var(--apistore-green);
  font-weight: 700;
}

.ast-proxy-response-meta .status-bad {
  color: #ef4444;
  font-weight: 700;
}

.ast-proxy-response-body {
  padding: 1rem;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.78rem;
  color: #ddd;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 350px;
  overflow-y: auto;
  line-height: 1.6;
  margin: 0;
}

.ast-proxy-error {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius, 14px);
  color: #ef4444;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ── cURL Box (OpenRouter-style) ───────────────────────────────────────── */
.ast-curl-box {
  margin-bottom: 1rem;
  background: #000;
  border: 1px solid var(--border, rgba(139,92,246,0.15));
  border-radius: var(--radius, 14px);
  overflow: hidden;
}

.ast-curl-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  background: rgba(10,10,15,0.6);
  border-bottom: 1px solid var(--border, rgba(139,92,246,0.1));
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text, #fff);
}

.ast-curl-header svg {
  color: var(--apistore-green);
}

.ast-curl-body {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
}

.ast-curl-url {
  flex: 1;
  min-width: 0;
}

.ast-curl-url code {
  display: block;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.75rem;
  color: #ddd;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
  background: transparent;
  padding: 0;
}

.ast-copy-curl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border, rgba(139,92,246,0.15));
  border-radius: var(--radius-sm, 9px);
  background: var(--surface, #000);
  color: var(--text2, #aaa);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition, 0.22s);
  font-family: inherit;
  flex-shrink: 0;
  white-space: nowrap;
}

.ast-copy-curl-btn:hover {
  border-color: var(--apistore-accent);
  color: var(--accent2, #a78bfa);
  background: rgba(139,92,246,0.06);
  transform: translateY(-1px);
}

.ast-copy-curl-btn:active {
  transform: translateY(0);
}

.ast-copy-curl-btn svg {
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CONFIRM MODAL
   ═══════════════════════════════════════════════════════════════════════════════ */
.ast-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ast-confirm-overlay.open {
  opacity: 1;
}

.ast-confirm-modal {
  background: var(--bg, #000);
  border: 1px solid var(--border, rgba(139, 92, 246, 0.2));
  border-radius: var(--radius-lg, 20px);
  padding: 1.5rem;
  width: min(90vw, 380px);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ast-confirm-overlay.open .ast-confirm-modal {
  transform: scale(1);
}

.ast-confirm-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #fff);
  margin-bottom: 0.5rem;
}

.ast-confirm-msg {
  font-size: 0.88rem;
  color: var(--text2, #aaa);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.ast-confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.ast-confirm-actions .ast-btn {
  padding: 0.55rem 1.25rem;
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PARTICLES BACKGROUND
   ═══════════════════════════════════════════════════════════════════════════════ */
#astParticles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CATEGORY COLOR HELPERS
   ═══════════════════════════════════════════════════════════════════════════════ */
.cat-ai { background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(139,92,246,0.05)); color: #8b5cf6; }
.cat-storage { background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(16,185,129,0.05)); color: #10b981; }
.cat-communication { background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(59,130,246,0.05)); color: #3b82f6; }
.cat-analytics { background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(245,158,11,0.05)); color: #f59e0b; }
.cat-media { background: linear-gradient(135deg, rgba(236,72,153,0.2), rgba(236,72,153,0.05)); color: #ec4899; }
.cat-tools { background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(99,102,241,0.05)); color: #6366f1; }
.cat-weather { background: linear-gradient(135deg, rgba(6,182,212,0.2), rgba(6,182,212,0.05)); color: #06b6d4; }
.cat-finance { background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(34,197,94,0.05)); color: #22c55e; }
.cat-gaming { background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(168,85,247,0.05)); color: #a855f7; }
.cat-social { background: linear-gradient(135deg, rgba(249,115,22,0.2), rgba(249,115,22,0.05)); color: #f97316; }
.cat-ecommerce { background: linear-gradient(135deg, rgba(20,184,166,0.2), rgba(20,184,166,0.05)); color: #14b8a6; }
.cat-other { background: linear-gradient(135deg, rgba(148,163,184,0.2), rgba(148,163,184,0.05)); color: #94a3b8; }

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .view-content { padding: 1.25rem; }
  .ast-toolbar { flex-direction: column; align-items: stretch; }
  .ast-filter-group { flex-wrap: wrap; }
  .ast-api-grid { grid-template-columns: 1fr; }
  /* detail drawer is now fullscreen by default */
  .ast-form-row { grid-template-columns: 1fr; gap: 0; }
  .ast-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .ast-my-api-item { flex-direction: column; align-items: stretch; }
  .ast-my-api-actions { justify-content: flex-end; }
  .ast-listing-item { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
  .view-content { padding: 1rem; }
  .ast-stats-grid { grid-template-columns: 1fr; }
  .ast-stat-card { padding: 1.25rem; }
  .ast-stat-value { font-size: 1.4rem; }
  .ast-stat-icon { width: 44px; height: 44px; }
  .ast-stat-icon svg { width: 22px; height: 22px; }
  .ast-api-card { padding: 1.15rem; }
  .ast-section { padding: 1.25rem; }
  .ast-my-api-item,
  .ast-listing-item { padding: 1.15rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Light Mode Overrides
   ═══════════════════════════════════════════════════════════════════════════ */
body.light {
  --bg: #ffffff;
  --bg2: #f5f5f7;
  --surface: #ffffff;
  --surface2: #e8e8ed;
  --card-bg: #ffffff;
  --sidebar-bg: #f8f9fa;
  --border: rgba(0, 0, 0, 0.08);
  --text: #1a1a2e;
  --text2: #555;
  --text3: #999;
}
body.light.apistore-body {
  background: var(--bg);
  color: var(--text);
}
body.light #sidebar {
  background: var(--sidebar-bg);
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.1);
}
body.light #sidebar .close-sidebar:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}
body.light .ast-nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}
body.light .topbar {
  background: var(--card-bg);
}
body.light .ast-stat-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
}
body.light .ast-stat-card:hover {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}
body.light .ast-section {
  background: rgba(255, 255, 255, 0.5);
}
body.light .ast-api-card {
  background: var(--surface);
}
body.light .ast-api-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}
body.light .ast-compare-bar {
  background: var(--card-bg);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.08);
}
body.light .ast-compare-overlay {
  background: rgba(0, 0, 0, 0.25);
}
body.light .ast-compare-modal {
  background: var(--bg);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.15);
}
body.light .ast-compare-modal-header {
  background: var(--surface);
}
body.light .ast-detail-overlay {
  background: rgba(0, 0, 0, 0.2);
}
body.light .ast-detail-drawer {
  background: var(--bg);
}
body.light .ast-detail-header {
  background: var(--surface);
}
body.light .ast-detail-close {
  background: var(--surface);
  color: var(--text2);
}
body.light .ast-detail-close:hover {
  background: var(--surface2);
  color: var(--text);
}
body.light .ast-detail-stat,
body.light .ast-detail-seller-row,
body.light .ast-detail-card {
  background: var(--surface);
}
body.light .ast-detail-card pre {
  background: var(--bg2);
  color: var(--text2);
}
body.light .ast-detail-hero {
  background: linear-gradient(135deg, rgba(139,92,246,0.04), rgba(99,102,241,0.03));
  border-color: rgba(139,92,246,0.08);
}
body.light .ast-test-header {
  background: rgba(255, 255, 255, 0.6);
}
body.light .ast-test-header select {
  background: var(--bg2);
  color: var(--text);
}
body.light .ast-test-output {
  background: var(--bg2);
  color: var(--text2);
}
body.light .ast-luma-modal {
  background: var(--bg);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.15);
}
body.light .ast-luma-modal-header {
  background: var(--surface);
}
body.light .ast-luma-modal-close {
  background: var(--surface);
  color: var(--text2);
}
body.light .ast-luma-modal-close:hover {
  background: var(--surface2);
  color: var(--text);
}
body.light .ast-proxy-overlay {
  background: rgba(0, 0, 0, 0.2);
}
body.light .ast-proxy-modal {
  background: var(--bg);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.15);
}
body.light .ast-proxy-modal-header {
  background: var(--surface);
}
body.light .ast-proxy-modal-close {
  background: var(--surface);
  color: var(--text2);
}
body.light .ast-proxy-modal-close:hover {
  background: var(--surface2);
  color: var(--text);
}
body.light .ast-proxy-response {
  background: var(--surface);
}
body.light .ast-proxy-response-header {
  background: var(--surface2);
}
body.light .ast-proxy-response-body {
  color: var(--text2);
}
body.light .ast-proxy-api-info {
  background: rgba(139,92,246,0.04);
  border-color: rgba(139,92,246,0.08);
}
body.light .ast-curl-box {
  background: var(--bg2);
}
body.light .ast-curl-header {
  background: rgba(0,0,0,0.03);
  color: var(--text);
}
body.light .ast-code-wrapper {
  background: var(--bg2);
}
body.light .ast-code-block code {
  color: var(--text2);
}
body.light .ast-confirm-overlay {
  background: rgba(0, 0, 0, 0.2);
}
body.light .ast-confirm-modal {
  background: var(--bg);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.15);
}
body.light #overlay {
  background: rgba(0, 0, 0, 0.2);
}
body.light ::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
}
body.light .ast-compare-table th:first-child,
body.light .ast-compare-table td:first-child,
body.light .ast-compare-table tr:hover td:first-child {
  background: var(--bg);
}
