.pill-tabs-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    justify-content: flex-start;
    width: 100%;
    flex-wrap: wrap-reverse;
    z-index: 10;
    position: relative; 
}

.pill-tabs-wrapper.center-tabs {
    justify-content: center;
}

.pill-tab-back-btn {
    display: flex;
    align-items: center;
    gap: 8px; 
    border-radius: 999px;
    background: var(--bg-container-small);
    color: var(--text-color) !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    background-image: none !important;
}

.pill-tab-back-btn:hover {
    background: var(--bg-container-medium);
    color: var(--primary) !important;
    border-radius: 999px !important; /* Override global anchor hover */
}

.pill-tab-back-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.pill-tabs-nav {
    display: flex;
    position: relative;
    background: var(--bg-container-small);
    border-radius: 999px;
    padding: 2px;
    border: 1px solid var(--border-color);
    
    /* Global scrollable setup */
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    width: max-content;
    margin: 0;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    min-width: 0; /* Allow flex shrinking below content size */
}

.pill-tabs-nav::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.pill-tabs-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: 0;
    background: rgb(from var(--border-color) r g b / 0.9);
    border-radius: 999px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    pointer-events: none;
}

.pill-tab {
    position: relative;
    z-index: 2;
    padding: 8px 24px;
    border-radius: 999px;
    color: var(--text-color) !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    background-image: none !important;
    flex-shrink: 0;
}

.pill-tab:hover, .pill-tab:focus {
    color: var(--title-color) !important;
    background-image: none !important;
    border-radius: 999px !important;
}

.pill-tab.active {
    color: var(--title-color) !important;
    filter: brightness(1.152);
    font-weight: 600;
}

@media (max-width: 600px) {
    .pill-tabs-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    .pill-tabs-nav {
        width: 100%;
        border-radius: 24px; 
    }
}
