.anp-alternate-tab-toggle,
.anp-default-tab,
.anp-safari-tab-toggle {
    --header-height: var(--anp-alt-tab-custom-height, 40px);
    --tab-stacked-header-width: var(--anp-stacked-header-width, 40px);
}

.anp-alternate-tab-toggle .workspace-tabs:not(.mod-stacked),
.anp-safari-tab-toggle .workspace-tabs:not(.mod-stacked) {
    --tab-background: var(--background-secondary);
    --tab-background-active: var(--background-primary);
    --tab-font-size: 12px;
    --tab-height: calc(var(--header-height)*0.7);
    --tab-max-width: 200px;
    --tab-max-width-active: 300px
}

.anp-alternate-tab-toggle .workspace-ribbon.mod-left {
    margin-top: var(--header-height);
}

.anp-alternate-tab-toggle .workspace-ribbon.mod-left:before {
    padding-bottom: 0px;
}

.anp-alternate-tab-toggle .workspace-tabs:not(.mod-stacked) .workspace-tab-header::before,
.anp-alternate-tab-toggle .workspace-tabs:not(.mod-stacked) .workspace-tab-header::after,
.anp-alternate-tab-toggle .workspace .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header-inner::after {
    display: none;
}

.anp-alternate-tab-toggle .mod-vertical:not(.mod-left-split):not(.mod-right-split) .workspace-tabs:not(.mod-stacked) .workspace-tab-header-container-inner,
.anp-alternate-tab-toggle .mod-horizontal:not(.mod-left-split):not(.mod-right-split) .workspace-tabs:not(.mod-stacked) .workspace-tab-header-container-inner {
    align-items: center;
    justify-content: var(--anp-safari-tab-align, center);
    margin: 0;
    width: 100%;
    gap: var(--anp-safari-tab-gap, 10px);
}

.anp-disable-newtab-align.anp-alternate-tab-toggle .mod-vertical:not(.mod-left-split):not(.mod-right-split) .workspace-tabs:not(.mod-stacked) .workspace-tab-header-container-inner,
.anp-disable-newtab-align.anp-alternate-tab-toggle .mod-horizontal:not(.mod-left-split):not(.mod-right-split) .workspace-tabs:not(.mod-stacked) .workspace-tab-header-container-inner {
    width: unset;
    gap: var(--anp-safari-tab-gap, 10px);
}

.anp-alternate-tab-toggle .mod-vertical:not(.mod-left-split):not(.mod-right-split) .workspace-tabs:not(.mod-stacked) .workspace-tab-header,
.anp-alternate-tab-toggle .mod-horizontal:not(.mod-left-split):not(.mod-right-split) .workspace-tabs:not(.mod-stacked) .workspace-tab-header {
    background: var(--tab-background);
    border-radius: var(--anp-safari-tab-radius, 6px);
    box-shadow: none !important;
    height: var(--tab-height);
    padding: 0 !important;
    transition: 400ms, background-color 150ms ease-in-out;
}

.anp-alternate-tab-toggle .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header {
    max-width: var(--tab-max-width);
    border: var(--anp-safari-border-width, 1px) solid var(--tab-outline-color);
}

.anp-alternate-tab-toggle.anp-alt-tab-anim-toggle .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header {
    transition: 400ms, background-color 150ms ease-in-out;
}

.anp-alternate-tab-toggle .workspace-tabs:not(.mod-stacked) .workspace-tab-header:first-child {
    margin-left: 0;
}

.anp-alternate-tab-toggle .mod-root:not(.mod-left-split):not(.mod-right-split) .workspace-tabs:not(.mod-stacked) .workspace-tab-header-inner {
    padding: 7px 8px;
}

.anp-alternate-tab-toggle .mod-root:not(.mod-left-split):not(.mod-right-split) .workspace-tabs:not(.mod-stacked) {
    .workspace-tab-header-inner {
        padding: 0 4px 0 8px;
        transition: 400ms, background-color 150ms ease-in-out, max-width 400ms;
    }

    .workspace-tab-header-inner,
    .workspace-tab-header-inner-close-button,
    .workspace-tab-header-inner-icon {
        color: var(--text-muted);
    }
}

.anp-alternate-tab-toggle .workspace .mod-root .workspace-tab-header-inner::after {
    display: none;
}

.anp-alternate-tab-toggle .mod-root:not(.mod-left-split):not(.mod-right-split) .workspace-tabs:not(.mod-stacked) .workspace-tab-header.is-active {
    flex-grow: 1.67;
    max-width: var(--tab-max-width-active);
    background-color: var(--background-primary);
}

.anp-alternate-tab-toggle .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header.is-active .workspace-tab-header-inner-title {
    color: var(--color-accent);
}

.anp-alternate-tab-toggle .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header.is-active {

    .workspace-tab-header-inner,
    .workspace-tab-header-inner-title,
    .workspace-tab-header-inner-close-button,
    .workspace-tab-header-inner-icon {
        color: var(--text-faint);
    }

    .workspace-tab-header-inner:hover {
        background-color: rgba(var(--ctp-surface1), 0.4);
    }
}

.anp-alternate-tab-toggle .mod-root .workspace-tabs:not(.mod-stacked).mod-active .workspace-tab-header.is-active {

    .workspace-tab-header-inner,
    .workspace-tab-header-inner-title,
    .workspace-tab-header-inner-close-button,
    .workspace-tab-header-inner-icon {
        color: var(--color-accent) !important;
    }
}

.anp-alternate-tab-toggle .mod-root .workspace-tabs:not(.mod-stacked) .workspace-tab-header.is-active:hover {
    background-color: var(--background-modifier-border);
}

.anp-alternate-tab-toggle .sidebar-toggle-button.mod-left,
.anp-alternate-tab-toggle .sidebar-toggle-button.mod-right {
    align-items: center;
}

.anp-alternate-tab-toggle .sidebar-toggle-button.mod-left .clickable-icon,
.anp-alternate-tab-toggle .sidebar-toggle-button.mod-right .clickable-icon {
    height: var(--tab-height);
}

.is-focused:not(.anp-mini-tab-toggle.anp-colorful-frame) .mod-active .workspace-tab-header.is-active .workspace-tab-header-inner-icon,
.is-focused .mod-active .workspace-tab-header.is-active .workspace-tab-header-inner-title {
    color: var(--color-accent);
}