/* ===========================================
   Tabs (design §D.7; shared/_tabs renders aria-current="page")

   One scrollable row with a hairline. The active tab is neutral: emphasis
   text, weight 600 and an inset 2px bottom bar (the selection pattern), not
   the accent.
   =========================================== */

.tabs {
  position: relative;
  display: flex;
  margin-bottom: var(--spacing-xl);
  overflow-x: auto;
  border-bottom: 1px solid var(--color-border);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs__list {
  display: flex;
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tabs__item {
  flex-shrink: 0;
  margin: 0;
  scroll-snap-align: start;
}

.tabs__link {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  min-height: var(--touch-target);
  padding: 0 var(--spacing-md);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-decoration: none;
  white-space: nowrap;
  transition:
    color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.tabs__link:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
  text-decoration: none;
}

/* .tabs scrolls (overflow-x), which clips anything drawn outside a tab, so
   the global ring is drawn inset here instead of 2px outside. */
.tabs__link:focus-visible {
  outline-offset: -2px;
}

.tabs__link--active,
.tabs__link[aria-current="page"] {
  color: var(--color-text-emphasis);
  font-weight: var(--font-semibold);
  box-shadow: inset 0 -2px 0 var(--color-text-emphasis);
}

.tabs__link--active:hover {
  background: transparent;
  color: var(--color-text-emphasis);
}

.tabs__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* A neutral count (needs-you counts use .badge--count instead). */
.tabs__count {
  padding: 0 var(--spacing-xs);
  border: 1px solid var(--color-neutral-border);
  border-radius: var(--radius-sm);
  background: var(--color-neutral-surface);
  color: var(--color-neutral);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
  .tabs__link {
    padding: 0 var(--spacing-lg);
  }
}

@media (forced-colors: active) {
  .tabs__link--active,
  .tabs__link[aria-current="page"] {
    border-bottom: 2px solid Highlight;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tabs__link {
    transition: none;
  }
}
