html::before {
  content: "";
  position: fixed;
  z-index: 200;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  pointer-events: none;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--orange), var(--orange-2));
  box-shadow: 0 0 14px rgba(255, 138, 0, 0.72);
}

html.is-navigating::before {
  opacity: 1;
  animation: navigation-progress 3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

a[href],
button {
  -webkit-tap-highlight-color: transparent;
}

a[href]:active,
button:active {
  filter: brightness(0.82);
}

a[data-navigation-pending="true"] {
  opacity: 0.62;
}

.sort-tabs {
  max-width: 100% !important;
  overflow-x: auto;
  scrollbar-width: none;
}

.sort-tabs button {
  flex: 0 0 auto !important;
  white-space: nowrap;
}

.tag-filter-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  margin-bottom: 20px;
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  /* Keep the collapsed view to one row without clipping the pill border. */
  max-height: 44px;
  padding-bottom: 2px;
  overflow: hidden;
}

.tag-filter-shell.is-expanded .tag-filters {
  max-height: none;
}

.tag-filter-toggle {
  height: 32px;
  border: 1px solid #414141;
  border-radius: 5px;
  background: #222;
  color: #bbb;
  padding: 0 12px;
  cursor: pointer;
  white-space: nowrap;
}

.tag-filter-toggle:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.tag-filters[hidden] {
  display: none;
}

.tag-filter {
  flex: 0 0 auto;
  min-height: 36px;
  line-height: 1.25;
  border: 1px solid #333;
  border-radius: 999px;
  background: #171717;
  color: #aaa;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.tag-filter-placeholder {
  flex: 0 0 70px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(90deg, #171717 25%, #242424 50%, #171717 75%);
  background-size: 200% 100%;
  animation: tag-loading 1.2s ease-in-out infinite;
}

.tag-filter-placeholder-wide {
  flex-basis: 96px;
}

.tag-filter-empty {
  flex: 0 0 auto;
  color: #666;
  font-size: 12px;
}

.tag-filter.active,
.tag-filter:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.card-tags {
  display: flex;
  gap: 5px;
  margin-top: 7px;
  overflow: hidden;
}

.card-tag {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #303030;
  border-radius: 4px;
  color: #8b8b8b;
  padding: 2px 6px;
  font-size: 10px;
}

.ranking-status {
  min-height: 24px;
  margin: 14px 0 0;
}

.client-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
}

.page-ellipsis {
  display: inline-grid;
  min-width: 24px;
  height: 36px;
  place-items: center;
  color: #777;
}

.page-button.active:disabled {
  opacity: 1;
}

@media (max-width: 480px) {
  .client-pagination {
    gap: 3px;
  }

  .page-button {
    min-width: 30px;
  }

  .page-ellipsis {
    min-width: 14px;
  }
}

@keyframes tag-loading {
  to {
    background-position: -200% 0;
  }
}

@keyframes navigation-progress {
  0% {
    transform: scaleX(0.08);
  }

  45% {
    transform: scaleX(0.72);
  }

  100% {
    transform: scaleX(0.92);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.is-navigating::before {
    animation: none;
    transform: scaleX(0.85);
  }
}
