[data-titlebar-tab] [data-slot="tab-close"] {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  height: 20px;
  width: 20px;
  align-items: center;
  justify-content: center;
}

[data-titlebar-tab][data-editing="true"] [data-slot="tab-close"] {
  display: none;
}

[data-titlebar-tab-list] {
  gap: 13.5px;
}

[data-titlebar-tab-slot] {
  position: relative;
}

[data-titlebar-tab-slot]:not(:first-child):not([data-active="true"])::before {
  content: "";
  position: absolute;
  top: 8px;
  left: -6.75px;
  width: 1.5px;
  height: 12px;
  border-radius: 9999px;
  background: var(--v2-background-bg-layer-02);
}

[data-titlebar-tab-slot][data-active="true"] + [data-titlebar-tab-slot]::before {
  display: none;
}

[data-titlebar-tab] [data-slot="tab-close"]::before {
  content: "";
  position: absolute;
  top: 0;
  height: 28px;
  width: 16px;
  pointer-events: none;
  background: linear-gradient(to right, transparent, var(--tab-bg));
  display: none;
}

[data-titlebar-tab][data-title-overflow="true"]:not([data-editing="true"]) [data-slot="tab-close"]::before {
  display: block;
  right: 0;
}

[data-titlebar-tab][data-title-overflow="true"]:hover:not([data-editing="true"]) [data-slot="tab-close"]::before,
[data-titlebar-tab][data-title-overflow="true"][data-active="true"]:not([data-editing="true"])
  [data-slot="tab-close"]::before {
  right: 100%;
}

[data-titlebar-tab][data-title-overflow="true"]:not(:hover):not([data-active="true"]):not([data-editing="true"])
  [data-slot="tab-link"] {
  padding-right: 0;
}

[data-titlebar-tab] [data-slot="tab-title"] {
  min-width: 0;
}

[data-titlebar-tab][data-editing="true"] [data-slot="tab-title"] {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
}

[data-titlebar-tab][data-editing="true"] [data-slot="tab-title"]::-webkit-scrollbar {
  display: none;
}

@container (max-width: 64px) {
  [data-titlebar-tab-link] {
    justify-content: center;
    gap: 0;
    padding-inline: 0;
  }

  [data-titlebar-tab-title] {
    display: none;
  }

  [data-slot="tab-close"] {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
}
