/* Tab Bar - 앱 내부 탭 UI (Step 1) */
.tab-bar {
    display: flex;
    align-items: stretch;
    background: var(--ui-surface-sunken);
    border-bottom: 1px solid var(--ui-divider);
    min-height: 36px;
    padding: 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
    user-select: none;
}

.tab-bar::-webkit-scrollbar { height: 4px; }
.tab-bar::-webkit-scrollbar-thumb { background: var(--ui-control-border); border-radius: 2px; }

.tab-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 12px;
    margin: 4px 2px 0 2px;
    background: var(--ui-surface-sunken);
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    font-size: 13px;
    color: var(--ui-text-muted);
    cursor: pointer;
    white-space: nowrap;
    max-width: 220px;
    transition: background 0.12s;
}

.tab-item:hover {
    background: var(--ui-control-bg-hover);
}

.tab-item.active {
    background: var(--ui-surface);
    border-color: var(--ui-divider);
    color: var(--ui-text-strong);
    font-weight: 500;
    position: relative;
    z-index: 2;
}

.tab-item .tab-title {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.tab-item .tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: transparent;
    color: var(--ui-text-muted);
    font-size: 12px;
    line-height: 1;
}

.tab-item .tab-close:hover {
    background: var(--ui-danger-solid);
    color: var(--ui-on-accent);
}

.tab-item.is-dirty .tab-title::after {
    content: " •";
    color: var(--ui-warning);
    font-weight: bold;
}

/* 드래그 표시선은 탭의 너비와 위치를 바꾸지 않는다. */
.tab-item.dragging { opacity: 0.45; }

.tab-item.drop-before::before,
.tab-item.drop-after::after {
    content: "";
    position: absolute;
    top: 2px;
    bottom: 2px;
    width: 3px;
    background: var(--ui-accent);
    border-radius: 2px;
    pointer-events: none;
}

.tab-item.drop-before::before { left: -3px; }
.tab-item.drop-after::after { right: -3px; }
