@keyframes settings-nav-spin {
    to { transform: rotate(360deg); }
}

.settings-nav-wrap {
    flex: 0 0 auto;
    width: 100%;
    background: var(--field-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow-card);
    position: relative;
    overflow: hidden;

    &::before,
    &::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 24px;
        pointer-events: none;
        z-index: 2;
        opacity: 0;
        transition: opacity var(--transition-fast);
    }

    &::before {
        left: 0;
        background: linear-gradient(to right, var(--settings-nav-fade-color, var(--field-bg)), transparent);
    }

    &::after {
        right: 0;
        background: linear-gradient(to left, var(--settings-nav-fade-color, var(--field-bg)), transparent);
    }

    &.settings-nav-wrap--scroll-start::before,
    &.settings-nav-wrap--scroll-end::after {
        opacity: 1;
    }
}

.settings-nav {
    display: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 4px;
    padding: 12px 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;

    &::-webkit-scrollbar {
        display: none;
    }
}

.settings-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    background: var(--field-bg);
    border: 1px solid var(--border-color);
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
    flex-shrink: 0;

    &:hover,
    &:focus,
    &:active {
        text-decoration: none;
    }

    &:hover {
        border-color: var(--accent);
        color: var(--accent);
        background: linear-gradient(135deg, var(--accent-tint-subtle) 0%, var(--accent-tint-hover) 100%);
    }

    &.active {
        background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
        color: var(--text-on-accent);
        border-color: var(--accent);
        box-shadow: 0 2px 8px var(--accent-shadow-soft);
    }

    &:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px var(--accent-border);
    }

    &.loading {
        pointer-events: none;
        opacity: 0.85;

        &::after {
            content: '';
            display: inline-block;
            width: 14px;
            height: 14px;
            min-width: 14px;
            min-height: 14px;
            flex-shrink: 0;
            aspect-ratio: 1 / 1;
            margin-left: 8px;
            border: 2px solid currentColor;
            border-top-color: transparent;
            border-radius: 50%;
            animation: settings-nav-spin 0.6s linear infinite;
            vertical-align: middle;
        }
    }
}

.settings-nav-mobile-panel {
    display: block;
}

.settings-nav-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;

    &::-webkit-scrollbar {
        display: none;
    }
}

.settings-nav-mobile {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-width: 100%;
    width: -moz-max-content;
    width: max-content;
    box-sizing: border-box;
    padding: 8px 12px;
}

.settings-nav-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
    color: var(--text-color);
    background: var(--field-bg);
    border: 1px solid var(--border-color);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition:
        background 0.12s ease,
        color 0.12s ease,
        border-color 0.12s ease,
        box-shadow 0.12s ease;

    &:hover,
    &:focus,
    &:active {
        text-decoration: none;
    }

    &:is(:active, &.settings-nav-tab--pressed),
    &.active {
        background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
        color: var(--text-on-accent);
        border-color: var(--accent);
        box-shadow: 0 2px 8px var(--accent-shadow-soft);
    }

    &:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px var(--accent-border);
    }
}

