﻿/* ============================================================
   Ospaces — Multi-Page Tabs Bar
   ============================================================ */

.tabs-bar {
  display: flex;
  align-items: center;
  height: 34px;
  background: var(--frame-deep, var(--bg-hover));
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
  gap: 2px;
  user-select: none;
  overflow: hidden;
  flex-shrink: 0;
}

.tabs-scroll {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.tabs-scroll::-webkit-scrollbar { display: none; }

.tab-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px 0 10px;
  border-radius: 7px 7px 0 0;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  font-family: var(--font, -apple-system, sans-serif);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  white-space: nowrap;
  max-width: 190px;
  min-width: 80px;
  transition: background .12s, color .12s;
  position: relative;
}

.tab-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.tab-item.active {
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  border-color: var(--border);
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.04);
}

.tab-item.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--bg);
}

.tab-ic {
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-close {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  color: var(--text-faint);
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s, background .12s, color .12s;
  flex-shrink: 0;
}

.tab-item:hover .tab-close,
.tab-item.active .tab-close {
  opacity: 0.7;
}

.tab-close:hover {
  opacity: 1 !important;
  background: var(--bg-active);
  color: var(--text);
}

.tabs-new-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--text-light);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .12s, color .12s;
  flex-shrink: 0;
  margin-left: 2px;
}

.tabs-new-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.tab-item.tab-pinned {
  min-width: auto;
  padding: 0 8px;
}
.tab-item.tab-pinned .tab-close {
  display: none;
}

@media (max-width: 760px) {
  .tabs-bar {
    height: 30px;
  }
  .tab-item {
    max-width: 140px;
    font-size: 12px;
    height: 26px;
  }
}
