.tabs {
    position: -webkit-sticky;
    position: sticky;
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    padding: 7px;
    background: rgba(20, 20, 30, 0.75);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    scrollbar-width: none;
    z-index: 30;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tabs button {
    flex: 1 1 0;
    justify-content: space-around;
    padding: 10px 20px;
    text-align: center;
    border: none;
    background: transparent;
    color: rgb(170, 175, 185);
    font-weight: 600;
    font-family: 'Segoe UI', sans-serif;
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
    z-index: 32; /* FIX: removed duplicate z-index: 50 */
    transition: color 0.3s ease;
}

.tabs button.active {
    color: #1f1f20;
}

.tab-indicator-main {
    position: absolute;
    top: 6px;
    left: 0;
    height: calc(100% - 12px);
    border-radius: 999px;
    background: linear-gradient(135deg, #8f91ff, #e0aaff, #ffa1b5, #ffbdb4);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 31;
}

.tab-indicator-main::before {
  content: "";
  position: absolute; 
  inset: 0px;
  background: linear-gradient(135deg, #8f91ffa1, #e0aaffb2, #ffa1b5a4, #ffbdb49d);
  filter: blur(5px);
  transform: translate3d(0px,2px,-1px);
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
}

/* panels */
.tab-panel {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-panel.active {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    z-index: var(--z-content); /* FIX: defined in :root now */
}

/* =========================
   FAB DOCK
========================= */

.fab-dock {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hidden state — JS toggles data-state="hidden" / "visible" */
.fab-dock[data-state="hidden"] {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(12px);
}

.fab-dock[data-state="visible"] {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

.fab-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(20, 20, 30, 0.88);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 999px;
    padding: 8px 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

/* FIX: all groups hidden by default; JS shows the active one */
.fab-group {
    display: none;
    gap: 2px;
    align-items: center;
}

.fab-group a {
    color: rgba(216, 221, 231, 0.70);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Segoe UI', sans-serif;
    padding: 4px 10px;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.fab-group a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgb(216, 221, 231);
}

.fab-sep {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 6px;
    flex-shrink: 0;
}

.fab-top {
    color: rgba(216, 221, 231, 0.70);
    text-decoration: none;
    font-size: 13px;
    font-family: 'Segoe UI', sans-serif;
    padding: 4px 8px;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
}

.fab-top:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgb(216, 221, 231);
}

/* =========================
   MOBILE
========================= */

@media screen and (max-width: 900px) {
    .tabs {
        overflow-x: hidden;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar { display: none; }

    .tabs button {
        flex: 1;
        font-size: 11px;
        padding: 8px 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* FAB: anchor to edges, not centered */
    .fab-dock {
        left: 0;
        right: 0;
        width: 100%;
        transform: none;
        display: flex;
        bottom: 12px;
        justify-content: center;
        padding: 0 8px;
        box-sizing: border-box;
    }

    .fab-dock[data-state="hidden"] {
        opacity: 0;
        pointer-events: none;
        transform: translateY(12px);
    }

    .fab-dock[data-state="visible"] {
        opacity: 1;
        pointer-events: all;
        transform: translateY(0);
    }

    .fab-pill {
        padding: 6px 10px;
        max-width: 100%;
        overflow: hidden;
        flex-wrap: nowrap;
    }

    .fab-group a {
        font-size: 12px;
        padding: 3px 8px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .fab-sep  { flex-shrink: 0; }
    .fab-top  { flex-shrink: 0; }
}

/* =========================
   TABS WRAP MODE
   JS adds .wrap when buttons overflow
========================= */
.tabs.wrap {
    flex-wrap: wrap;        /* 👈 this was missing — allows 2 rows */
    border-radius: 16px;    /* 👈 was missing */
    gap: 4px;               /* 👈 was missing */
    padding: 6px;           /* 👈 was missing */
    overflow: visible;      /* 👈 was missing */
}

.tabs.wrap button {
    flex: 1 1 auto;
    border-radius: 999px;
    min-width: fit-content;
    flex-shrink: 0;
    position: relative;
    transition: color 0.3s ease;
}

.tabs.wrap button::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #8f91ff, #e0aaff, #ffa1b5, #ffbdb4);
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: -1;
}

.tabs.wrap button.active::before {
    opacity: 1;
}

.tabs.wrap button.active {
    color: #1f1f20;
}

.tabs.wrap .tab-indicator-main { display: none; }
/* =========================
   FAB WRAP MODE
   JS adds .wrap when pill overflows
========================= */
.fab-pill.wrap {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 16px;
    row-gap: 4px;
    padding: 8px 10px;
    max-width: calc(100vw - 16px);
}

.fab-pill.wrap .fab-group {
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 2px;
}

.fab-pill.wrap .fab-sep { display: none; }

.fab-pill.wrap .fab-top {
    width: 100%;
    justify-content: center;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 6px;
    margin-top: 2px;
}