/* =====================================
   Tabs
===================================== */

.eb-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid var(--eb-border-default);
}

.eb-tabs--scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.eb-tabs--scroll .eb-tabs__item {
    flex: 0 0 auto;
}

.eb-tabs--stretch {
    gap: 0;
}

.eb-tabs--stretch .eb-tabs__item {
    flex: 1 1 0;
    min-width: 0;
}

.eb-tabs--stretch .eb-tabs__link {
    justify-content: center;
    width: 100%;
}

.eb-tabs__item {
    display: flex;
}

.eb-tabs__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    color: var(--eb-tabs-link-text);
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition:
        color var(--eb-duration-fast) var(--eb-ease-standard),
        border-color var(--eb-duration-fast) var(--eb-ease-standard),
        box-shadow var(--eb-duration-fast) var(--eb-ease-standard);
}

.eb-tabs__link:hover {
    color: var(--eb-tabs-link-active-text);
}

.eb-tabs__link:focus-visible {
    color: var(--eb-tabs-link-active-text);
    outline: none;
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.16);
}

.eb-tabs__link.is-active {
    color: var(--eb-tabs-link-active-text);
    border-bottom: 2px solid var(--eb-tabs-link-active-border);
    background: transparent;
}

.eb-tabs__link.is-disabled,
.eb-tabs__link[aria-disabled='true'] {
    color: var(--eb-gray-500);
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.eb-tabs__icon {
    font-size: 0.95em;
    line-height: 1;
}

.eb-tabs .eb-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: var(--eb-radius-0);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--eb-tabs-count-text);
    background: var(--eb-tabs-count-bg);
}

.eb-tabs__link.is-active .eb-tab-count {
    background: rgb(37 99 235 / 0.18);
}

/* =====================================
   Segmented control (x-segmented)
   Same-page view switch, two or three options. Square, 1px stroke, blue only on the
   selected option. URL-backed sections use .eb-tabs above.
===================================== */

.eb-segmented {
    display: inline-flex;
    max-width: 100%;
    border: 1px solid var(--eb-border-strong);
    background: var(--eb-bg-card);
}

.eb-segmented--stretch {
    display: flex;
    width: 100%;
}

.eb-segmented__option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0 1.125rem;
    border: 0;
    border-radius: var(--eb-radius-0);
    background: transparent;
    color: var(--eb-gray-700);
    font-size: 0.9375rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background var(--eb-duration-fast) var(--eb-ease-standard),
        color var(--eb-duration-fast) var(--eb-ease-standard);
}

.eb-segmented--stretch .eb-segmented__option {
    flex: 1 1 0;
    min-width: 0;
}

.eb-segmented__option + .eb-segmented__option {
    border-left: 1px solid var(--eb-border-strong);
}

.eb-segmented__option:hover {
    background: var(--eb-bg-hover);
    color: var(--eb-gray-900);
}

.eb-segmented__option[aria-selected="true"] {
    background: var(--eb-primary-700);
    color: var(--eb-white);
}

.eb-segmented__option:focus-visible {
    position: relative;
    z-index: 1;
    outline: 2px solid var(--eb-border-focus);
    outline-offset: 2px;
}

.eb-segmented__icon,
.eb-segmented__option svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.eb-segmented__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--eb-surface-subtle);
    color: var(--eb-gray-700);
}

.eb-segmented__option[aria-selected="true"] .eb-segmented__count {
    background: var(--eb-white-20);
    color: var(--eb-white);
}

.eb-segmented-panel:focus-visible {
    outline: 2px solid var(--eb-border-focus);
    outline-offset: 4px;
}

/* Phones: the control spans the width so each option stays a comfortable tap target. */
@media (max-width: 575.98px) {
    .eb-segmented {
        display: flex;
        width: 100%;
    }

    .eb-segmented__option {
        flex: 1 1 0;
        min-width: 0;
        padding: 0 0.75rem;
    }
}
