/* =============================================================================
   Tabs: the one tab strip every page uses.

   Modelled on the My Profile tabs: a soft grey track holding rounded tabs, the
   selected one lifted onto a white surface with a hairline shadow. Pages keep
   their own JavaScript and active-class names; they only add
   `synx-tabs` to the strip and `synx-tab` to each tab.

       <div class="synx-tabs" role="tablist">
           <button type="button" class="synx-tab active" role="tab">Overview</button>
           <a class="synx-tab" href="?tab=history">History</a>
       </div>

   Selected state: .active, .is-active or .rp-tab-active (the class each page's
   own tab script already toggles), never aria-selected, which some scripts
   leave stale.

   Tabs share the strip's width equally and never shrink below their label; a
   strip with more tabs than fit scrolls sideways instead of wrapping.
   `.synx-tabs--fit` sizes the strip to its tabs, for a strip that shares a row
   with other controls.
   ============================================================================= */

.synx-tabs {
    display: flex;
    align-items: stretch;
    gap: 4px;
    width: 100%;
    max-width: 100%;
    margin: 0 0 24px;
    padding: 4px;
    list-style: none;
    background: var(--theme-surface-subtle, #f1f5f9);
    border: 0;
    border-radius: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.synx-tabs::-webkit-scrollbar {
    display: none;
}

/* Bootstrap nav markup (<ul><li><button>) lays its buttons out as if the
   list items were not there. */
.synx-tabs > li {
    display: contents;
}

.synx-tabs--fit {
    display: inline-flex;
    width: auto;
}

.synx-tabs .synx-tab {
    position: relative;
    flex: 1 1 0;
    min-width: max-content;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: auto;
    min-height: 32px;
    margin: 0;
    padding: 7px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    color: var(--theme-muted, #64748b);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.synx-tabs--fit .synx-tab {
    flex: 0 0 auto;
}

/* The underline bars the old strips drew. */
.synx-tabs .synx-tab::after {
    content: none;
}

.synx-tabs .synx-tab:hover {
    color: var(--theme-text, #0f172a);
    background: color-mix(in srgb, var(--theme-surface, #ffffff) 45%, transparent);
    text-decoration: none;
}

.synx-tabs .synx-tab:is(.active, .is-active, .rp-tab-active) {
    color: var(--theme-text, #0f172a);
    background: var(--theme-surface, #ffffff);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.synx-tabs .synx-tab:focus-visible {
    outline: 2px solid var(--theme-primary-text, #2563eb);
    outline-offset: -2px;
}

.synx-tabs .synx-tab:disabled,
.synx-tabs .synx-tab[aria-disabled="true"] {
    opacity: .5;
    cursor: not-allowed;
}

.synx-tabs .synx-tab:disabled:hover,
.synx-tabs .synx-tab[aria-disabled="true"]:hover {
    color: var(--theme-muted, #64748b);
    background: transparent;
}

.synx-tabs .synx-tab :is(i, svg) {
    flex-shrink: 0;
    font-size: 14px;
    line-height: 1;
}

.synx-tabs .synx-tab svg {
    width: 14px;
    height: 14px;
}

[data-bs-theme="dark"] .synx-tabs .synx-tab:is(.active, .is-active, .rp-tab-active) {
    box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}

@media (prefers-reduced-motion: reduce) {
    .synx-tabs .synx-tab {
        transition: none;
    }
}
