.catalog-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.catalog-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--pub-card-border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 250, 253, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.catalog-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.catalog-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--pub-text);
}

.catalog-nav-logo-img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.catalog-nav-logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.catalog-nav-divider {
  width: 1px;
  height: 20px;
  background: var(--pub-card-border);
  margin: 0 6px;
}

.catalog-nav-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--pub-text2);
}

.catalog-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.catalog-nav-link {
  color: var(--pub-text2);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  transition: all 0.2s;
  font-weight: 500;
}

.catalog-nav-link:hover {
  color: var(--pub-text);
  background: rgba(37, 99, 235, 0.06);
}

.catalog-search-bar {
  margin: 28px 0 24px;
  position: relative;
}

.catalog-search-bar svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94A3B8;
  pointer-events: none;
}

.catalog-search-bar input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  font-size: 15px;
  border-radius: 14px;
  border: 1px solid var(--pub-card-border);
  background: #fff;
  color: var(--pub-text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.catalog-search-bar input:focus {
  border-color: var(--pub-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.catalog-search-bar input::placeholder {
  color: #94A3B8;
}

.catalog-filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  align-items: center;
}

.catalog-filter-row select {
  background: #fff;
  border: 1px solid var(--pub-card-border);
  color: var(--pub-text);
  padding: 10px 32px 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  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='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s;
  font-weight: 500;
}

.catalog-filter-row select:focus {
  outline: none;
  border-color: var(--pub-blue);
}

.catalog-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.catalog-chip {
  padding: 7px 14px;
  border-radius: 9999px;
  border: 1px solid var(--pub-card-border);
  background: #fff;
  color: var(--pub-text2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.catalog-chip:hover {
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--pub-blue);
  background: rgba(37, 99, 235, 0.03);
}

.catalog-chip.active {
  background: var(--pub-chip-active);
  color: var(--pub-blue);
  border-color: rgba(37, 99, 235, 0.3);
  font-weight: 600;
}

.explore-view {
  display: block;
}

.grid-view {
  display: none;
}

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

.explore-view.hidden {
  display: none;
}

.featured-card {
  display: flex;
  border-radius: 20px;
  overflow: hidden;
  background: var(--pub-card);
  border: 1px solid var(--pub-card-border);
  margin-bottom: 40px;
  transition: box-shadow 0.3s, border-color 0.3s;
  cursor: pointer;
  min-height: 280px;
  text-decoration: none;
  color: inherit;
}

.featured-card:hover {
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 12px 40px rgba(37, 99, 235, 0.08);
}

.featured-card-image {
  width: 50%;
  min-height: 280px;
  max-height: 360px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.featured-card-image img,
.featured-card-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.featured-card:hover .featured-card-image img,
.featured-card:hover .featured-card-image video {
  transform: scale(1.03);
}

.featured-card-image .featured-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  background: linear-gradient(135deg, #DBEAFE 0%, #93C5FD 100%);
}

.featured-card-body {
  flex: 1;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-card-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--pub-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.featured-card-label .featured-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pub-blue);
}

.featured-card-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--pub-text);
  margin: 0 0 10px;
}

.featured-card-subtitle {
  font-size: 15px;
  color: var(--pub-text2);
  margin: 0 0 16px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-card-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.featured-card-meta span {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--pub-bg2);
  color: var(--pub-text2);
  font-weight: 500;
}

.featured-card-meta span.featured-cat-tag {
  background: var(--pub-blue-soft);
  color: var(--pub-blue);
}

.featured-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: 12px;
  border: none;
  background: var(--pub-gradient);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
  align-self: flex-start;
}

.featured-card-cta:hover {
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.explore-section {
  margin-bottom: 40px;
}

.explore-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--pub-card-border);
}

.explore-section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--pub-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.explore-section-title .section-icon {
  font-size: 18px;
}

.explore-section-count {
  font-size: 13px;
  color: var(--pub-text3);
  font-weight: 400;
  margin-left: 6px;
}

.explore-section-more {
  font-size: 13px;
  color: var(--pub-blue);
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 8px;
  transition: all 0.2s;
  border: none;
  background: none;
}

.explore-section-more:hover {
  background: rgba(37, 99, 235, 0.06);
  text-decoration: none;
}

.popular-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--pub-card-border);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--pub-card-border);
}

.popular-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--pub-card);
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  color: inherit;
}

.popular-item:hover {
  background: rgba(37, 99, 235, 0.02);
}

.popular-item-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.popular-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.popular-item-thumb .popular-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: 12px;
}

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

.popular-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--pub-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.popular-item-desc {
  font-size: 12px;
  color: var(--pub-text2);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.popular-item-meta span {
  font-size: 11px;
  color: var(--pub-text3);
  font-weight: 500;
}

.popular-item-meta .meta-tag {
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--pub-bg2);
  font-size: 10px;
}

.popular-item-meta .meta-cat {
  background: var(--pub-blue-soft);
  color: var(--pub-blue);
}

.popular-item-cta {
  padding: 6px 16px;
  border-radius: 8px;
  border: 1px solid var(--pub-card-border);
  background: #fff;
  color: var(--pub-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.popular-item-cta:hover {
  border-color: var(--pub-blue);
  color: var(--pub-blue);
  background: rgba(37, 99, 235, 0.04);
}

.category-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.cat-section {
  background: var(--pub-card);
  border: 1px solid var(--pub-card-border);
  border-radius: 16px;
  overflow: hidden;
}

.cat-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--pub-card-border);
}

.cat-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--pub-text);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.cat-section-title .cat-icon {
  font-size: 16px;
}

.cat-section-count {
  font-size: 12px;
  color: var(--pub-text3);
  font-weight: 400;
}

.cat-section-show-all {
  font-size: 12px;
  color: var(--pub-blue);
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
  border: none;
  background: none;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.2s;
}

.cat-section-show-all:hover {
  background: rgba(37, 99, 235, 0.06);
}

.cat-section-items {
  display: flex;
  flex-direction: column;
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--pub-card-border);
  text-decoration: none;
  color: inherit;
}

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

.cat-item:hover {
  background: rgba(37, 99, 235, 0.02);
}

.cat-item-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.cat-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cat-item-thumb .cat-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border-radius: 10px;
}

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

.cat-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--pub-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-item-desc {
  font-size: 11px;
  color: var(--pub-text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.cat-item-provider {
  font-size: 10px;
  color: var(--pub-text3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.grid-view .catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

.grid-view .catalog-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--pub-text3);
  font-size: 14px;
  grid-column: 1 / -1;
}

.grid-view .catalog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
  padding: 20px 0;
}

.grid-view .catalog-pagination button {
  background: var(--pub-card);
  border: 1px solid var(--pub-card-border);
  color: var(--pub-text);
  padding: 10px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.grid-view .catalog-pagination button:hover:not(:disabled) {
  border-color: var(--pub-blue);
  background: rgba(37, 99, 235, 0.04);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.grid-view .catalog-pagination button:disabled {
  opacity: 0.3;
  cursor: default;
}

.grid-view .page-info {
  padding: 8px 20px;
  color: var(--pub-text2);
  font-size: 13px;
  background: var(--pub-card);
  border-radius: 12px;
  border: 1px solid var(--pub-card-border);
}

.grid-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.grid-view-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--pub-text);
  margin: 0;
}

.grid-view-count {
  font-size: 13px;
  color: var(--pub-text3);
  font-weight: 400;
}

.grid-view-clear {
  font-size: 13px;
  color: var(--pub-blue);
  cursor: pointer;
  border: none;
  background: none;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 8px;
  transition: all 0.2s;
}

.grid-view-clear:hover {
  background: rgba(37, 99, 235, 0.06);
}

.skeleton-featured {
  display: flex;
  border-radius: 20px;
  overflow: hidden;
  background: var(--pub-card);
  border: 1px solid var(--pub-card-border);
  margin-bottom: 40px;
  min-height: 280px;
}

.skeleton-featured .skel-image {
  width: 50%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-featured .skel-body {
  flex: 1;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

.skel-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skel-line.skel-title { height: 24px; width: 60%; }
.skel-line.skel-sub { width: 80%; }
.skel-line.skel-desc { width: 90%; }
.skel-line.skel-btn { height: 40px; width: 120px; border-radius: 12px; }

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--pub-card-border);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--pub-card-border);
}

.skeleton-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--pub-card);
}

.skel-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  flex-shrink: 0;
}

.skel-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skel-info .skel-line:first-child { width: 50%; }
.skel-info .skel-line:last-child { width: 70%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.image-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.featured-card:focus-visible,
.popular-item:focus-visible,
.cat-item:focus-visible,
.tool-card:focus-visible {
  outline: 2px solid var(--pub-blue);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .category-sections {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .catalog-page { padding: 0 16px 40px; }

  .catalog-nav { flex-wrap: wrap; gap: 8px; padding: 12px 0; }
  .catalog-nav-right { gap: 4px; }
  .catalog-nav-link { font-size: 12px; padding: 6px 8px; }
  .catalog-nav-divider { display: none; }
  .catalog-nav-title { display: none; }

  .featured-card {
    flex-direction: column;
    min-height: auto;
  }

  .featured-card-image {
    width: 100%;
    min-height: 200px;
    max-height: 220px;
  }

  .featured-card-body {
    padding: 24px;
  }

  .featured-card-title {
    font-size: 22px;
  }

  .popular-item { padding: 12px 14px; gap: 12px; }
  .popular-item-thumb { width: 48px; height: 48px; }
  .popular-item-cta { display: none; }

  .category-sections { grid-template-columns: 1fr; gap: 16px; }

  .grid-view .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .catalog-search-bar { margin: 20px 0 16px; }
  .catalog-filter-row { gap: 8px; }

  .skeleton-featured { flex-direction: column; min-height: auto; }
  .skeleton-featured .skel-image { width: 100%; height: 200px; }
  .skeleton-featured .skel-body { padding: 24px; }
}

@media (max-width: 480px) {
  .catalog-page { padding: 0 12px 30px; }
  .catalog-nav { justify-content: space-between; }
  .catalog-nav-right { gap: 2px; }
  .catalog-nav-link { font-size: 11px; padding: 5px 6px; }

  .featured-card-image { max-height: 180px; min-height: 160px; }
  .featured-card-body { padding: 18px; }
  .featured-card-title { font-size: 20px; }
  .featured-card-subtitle { font-size: 14px; }

  .popular-item-thumb { width: 42px; height: 42px; border-radius: 10px; }
  .popular-item-name { font-size: 13px; }

  .cat-item { padding: 10px 16px; gap: 10px; }
  .cat-item-thumb { width: 36px; height: 36px; border-radius: 8px; }

  .grid-view .catalog-grid { grid-template-columns: 1fr; }

  .explore-section-title { font-size: 17px; }
}

/* =====================================================================
 * Phase 3: hero rail, dedupe groups, quality labels, badges (visual-only)
 * ===================================================================== */

/* Hero rail — small curated head shown above the regular grid for
 * categories with a hero list. */
.catalog-hero-rail {
  margin: 0 0 20px 0;
  padding: 16px;
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(168,85,247,0.06));
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 12px;
}
.catalog-hero-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.catalog-hero-rail-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--pub-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.catalog-hero-rail-title::before {
  content: "★";
  color: #a855f7;
  font-size: 14px;
}
.catalog-hero-rail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.hero-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--pub-bg2, #fff);
  border: 1px solid var(--pub-border, rgba(0,0,0,0.08));
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.hero-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.10);
}
.hero-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
}
.hero-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-card-rank {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(168, 85, 247, 0.92);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.4px;
}
.hero-card-body {
  padding: 8px 10px 10px;
}
.hero-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--pub-text);
  margin: 0 0 4px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 10px;
  color: var(--pub-text3, #888);
}

/* Quality pill (FREE_SAFE / PRO / EXPERIMENTAL). Visual-only. */
.q-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  line-height: 1.3;
  vertical-align: middle;
  white-space: nowrap;
}
.q-pill-free {
  background: rgba(34,197,94,0.16);
  color: #16a34a;
  border: 1px solid rgba(34,197,94,0.35);
}
.q-pill-pro {
  background: rgba(99,102,241,0.16);
  color: #6366f1;
  border: 1px solid rgba(99,102,241,0.40);
}
.q-pill-exp {
  background: rgba(217,119,6,0.14);
  color: #c2750a;
  border: 1px solid rgba(217,119,6,0.35);
}

/* Hero/Official mini badges shown on tool cards. */
.tool-card-hero-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 4;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(99,102,241,0.45);
}
.tool-card-official-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(16,185,129,0.92);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 3;
  line-height: 1.4;
}
.tool-card-hero-badge ~ .tool-card-official-badge,
.tool-card-hero-badge ~ .tool-card-beta-badge,
.tool-card-hero-badge ~ .tool-card-unverified-badge {
  top: 30px;
}

/* "More variants" expander attached to dedupe primaries. */
.tool-card-variants-expander {
  margin-top: 8px;
  border-top: 1px dashed var(--pub-border, rgba(0,0,0,0.08));
  padding-top: 8px;
}
.tool-card-variants-toggle {
  background: none;
  border: none;
  color: var(--pub-text3, #888);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tool-card-variants-toggle:hover {
  color: var(--pub-text);
}
.tool-card-variants-list {
  display: none;
  margin-top: 6px;
  padding: 6px;
  background: var(--pub-bg, rgba(0,0,0,0.02));
  border-radius: 6px;
  font-size: 11px;
}
.tool-card-variants-list.open {
  display: block;
}
.tool-card-variants-list a {
  display: block;
  color: var(--pub-text2, #444);
  padding: 3px 4px;
  text-decoration: none;
  border-radius: 4px;
}
.tool-card-variants-list a:hover {
  background: rgba(99,102,241,0.08);
  color: var(--pub-text);
}

/* ---------------------------------------------------------------------------
 * Phase 3 (final) — primary storefront label.
 *
 * Exactly four customer-facing primary labels are allowed. At most ONE per
 * card. Rendered as a small inline pill inside the tags row of a tool card
 * (and inside the meta row of a hero card). Replaces the legacy
 * FREE / PRO / EXPERIMENTAL pill — those classes (.q-pill*) are kept in
 * stylesheet history but are no longer emitted anywhere.
 * ------------------------------------------------------------------------- */
.tool-card-primary-label {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  line-height: 1.4;
  vertical-align: middle;
  white-space: nowrap;
}
.tool-card-primary-label-top-rated {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.tool-card-primary-label-premium {
  background: linear-gradient(135deg, rgba(99,102,241,0.16), rgba(168,85,247,0.16));
  color: #6d28d9;
  border: 1px solid rgba(168, 85, 247, 0.4);
}
.tool-card-primary-label-new-arrival {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.tool-card-primary-label-creator-choice {
  background: rgba(236, 72, 153, 0.12);
  color: #be185d;
  border: 1px solid rgba(236, 72, 153, 0.35);
}
