/* Canonical tab geometry uses digiradius-controls.css role tokens. */
html body .nav:is(.nav-tabs, .nav-pills) {
  --dg-tab-height: var(--dg-ui-compact-height, 28.375px);
  --dg-responsive-tab-background: var(--bs-tertiary-bg, rgba(var(--bs-secondary-rgb), .1));
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: flex-start;
  align-items: center;
  gap: var(--dg-tab-gap, var(--dg-ui-control-gap, 8px)) !important;
  width: 100%;
  max-width: 100%;
  padding: .25rem 0 .5rem;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 1rem;
  scroll-snap-type: inline proximity;
  scrollbar-width: none !important;
  touch-action: pan-x pan-y;
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-overflow-scrolling: touch;
}

/* Hide only navigation scrollbars, not table/dialog scrollbars. Scrolling and
 * keyboard focus remain native, including wrappers with overflow-auto. */
html body .dg-tab-scroll,
html body :is(.settings-tabs-wrap, .nav-align-top):has(> .nav:is(.nav-tabs, .nav-pills)) {
  scrollbar-width: none !important;
}
html body .nav:is(.nav-tabs, .nav-pills)::-webkit-scrollbar,
html body .dg-tab-scroll::-webkit-scrollbar,
html body :is(.settings-tabs-wrap, .nav-align-top):has(> .nav:is(.nav-tabs, .nav-pills))::-webkit-scrollbar {
  display: none !important;
  width: 0;
  height: 0;
}

@media (max-width: 767.98px) {
  html body .nav:is(.nav-tabs, .nav-pills) {
    --dg-tab-gap: 4px;
    /* Two pixels of clearance for the compact keyboard focus ring. */
    padding-block: 2px;
  }

  html body .dg-ticket-tabs,
  html body :is(.settings-tabs-wrap, .nav-align-top):has(> .nav:is(.nav-tabs, .nav-pills)) {
    --dg-tab-surface-gap: 2px;
    /* Override Bootstrap mb/mt utilities on navigation wrappers only. */
    margin-block: var(--dg-tab-surface-gap) !important;
  }
}


html body .nav:is(.nav-tabs, .nav-pills) > .nav-item {
  flex: 0 0 auto !important;
  width: auto;
  min-width: 0;
  max-width: none;
  scroll-snap-align: center;
}

/* Equal specificity for direct links and list-item links overrides Vuexy's
 * full-width links without changing their content-sized layout. */
html body :is(.nav:is(.nav-tabs, .nav-pills) > .nav-link,
             .nav:is(.nav-tabs, .nav-pills) > .nav-item > .nav-link) {
  display: inline-flex;
  flex: 0 0 auto !important;
  align-items: center;
  justify-content: center;
  width: auto;
  margin-inline: 0;
  min-width: max-content;
  max-width: none;
  box-sizing: border-box;
  height: var(--dg-tab-height);
  min-height: var(--dg-tab-height);
  padding: var(--dg-ui-compact-padding-y, 4px) var(--dg-ui-compact-padding-x, 8px) !important;
  overflow: visible;
  border: 1px solid transparent !important;
  border-radius: var(--dg-ui-compact-radius, 3.2px) !important;
  background: var(--dg-responsive-tab-background) !important;
  box-shadow: none !important;
  color: var(--bs-body-color);
  font-family: var(--dg-ui-font, inherit);
  font-size: var(--dg-ui-compact-font, 12.25px);
  font-weight: 400;
  line-height: var(--dg-ui-compact-line, 18.375px);
  letter-spacing: 0;
  text-transform: uppercase;
  text-overflow: clip;
  white-space: nowrap;
  /* Active/focus borders are immediate; theme transitions must not delay state. */
  transition: background-color .15s ease, color .15s ease;
  scroll-snap-align: center;
}

html body .nav:is(.nav-tabs, .nav-pills) > .nav-link:hover:not(.disabled):not([aria-disabled="true"]):not(:disabled),
html body .nav:is(.nav-tabs, .nav-pills) > .nav-item > .nav-link:hover:not(.disabled):not([aria-disabled="true"]):not(:disabled) {
  border-color: rgba(var(--bs-primary-rgb), .45) !important;
  background: rgba(var(--bs-primary-rgb), .06) !important;
  color: var(--bs-primary);
}

html body .nav:is(.nav-tabs, .nav-pills) > .nav-link.active:not(.disabled):not([aria-disabled="true"]):not(:disabled),
html body .nav:is(.nav-tabs, .nav-pills) > .nav-item > .nav-link.active:not(.disabled):not([aria-disabled="true"]):not(:disabled) {
  border-color: var(--bs-primary) !important;
  background: rgba(var(--bs-primary-rgb), .08) !important;
  box-shadow: none !important;
  color: var(--bs-primary) !important;
  font-weight: 400;
}

html body .nav:is(.nav-tabs, .nav-pills) > .nav-link:focus-visible,
html body .nav:is(.nav-tabs, .nav-pills) > .nav-item > .nav-link:focus-visible {
  z-index: 2;
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

@media (max-width: 767.98px) {
  html body .nav:is(.nav-tabs, .nav-pills) > .nav-link:focus-visible,
  html body .nav:is(.nav-tabs, .nav-pills) > .nav-item > .nav-link:focus-visible {
    outline-offset: 0;
  }
}

html body .nav:is(.nav-tabs, .nav-pills) .nav-link.disabled,
html body .nav:is(.nav-tabs, .nav-pills) .nav-link[aria-disabled="true"],
html body .nav:is(.nav-tabs, .nav-pills) .nav-link:disabled {
  opacity: .55;
}

@media (prefers-reduced-motion: reduce) {
  html body .nav:is(.nav-tabs, .nav-pills) {
    scroll-behavior: auto;
  }
}

html body .nav:is(.nav-tabs, .nav-pills) > .tab-slider { display: none; }
html body .nav:is(.nav-tabs, .nav-pills) .nav-link > i { font-size: var(--dg-ui-control-icon, 1em); margin-inline-end: 0; }
