/* ============================================
   LineupIQ Navigation
   ============================================ */

/* Slate Tabs Container */
.slate-tabs-container {
    background: var(--liq-bg-secondary);
    border-bottom: 1px solid var(--liq-border-color);
    padding: 0.375rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lineupiq-brand {
    align-items: center;
    padding: 0 1rem;
    flex-shrink: 0;
}

    .lineupiq-brand .flagship-title {
        font-size: 1.25rem;
        font-weight: 700;
        margin: 0;
        color: var(--liq-text-primary);
    }

    .lineupiq-brand .text-accent {
        color: var(--liq-accent-green);
    }

.slate-date-filter {
    display: flex;
    align-items: center;
    margin-right: 0.75rem;
    padding-right: 0.75rem;
    border-right: 1px solid var(--liq-border-color);
    flex-shrink: 0;
}

/* ============================================
   Date Stepper — shared segmented control
   Used in the main-view date filter and the
   slate modal toolbar: [‹][📅 date][›]
   ============================================ */

.date-stepper {
    display: inline-flex;
    align-items: stretch;
    height: 32px;
    background: var(--liq-bg-primary);
    border: 1px solid var(--liq-border-color);
    border-radius: 6px;
    overflow: hidden;
}

    .date-stepper .date-nav-btn {
        width: 30px;
        height: auto;
        min-width: 0;
        min-height: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        color: var(--liq-text-secondary);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        cursor: pointer;
        transition: background 0.15s ease, color 0.15s ease;
    }

        .date-stepper .date-nav-btn:hover {
            background: var(--liq-bg-hover);
            color: var(--liq-accent-green);
        }

        .date-stepper .date-nav-btn i {
            font-size: 0.7rem;
            line-height: 1;
        }

        /* Hairline dividers so the segments read as one control */
        .date-stepper .date-nav-btn:first-child {
            border-right: 1px solid var(--liq-border-color);
        }

        .date-stepper .date-nav-btn:last-child {
            border-left: 1px solid var(--liq-border-color);
        }

    .date-stepper .date-display,
    .date-stepper .date-display-small {
        border: none;
        border-radius: 0;
        background: transparent;
        height: auto;
        display: flex;
        align-items: center;
        gap: 0.375rem;
        padding: 0 0.75rem;
        font-size: 0.8rem;
        white-space: nowrap;
        color: var(--liq-text-primary);
        cursor: pointer;
    }

        .date-stepper .date-display:hover,
        .date-stepper .date-display-small:hover {
            background: var(--liq-bg-hover);
        }

/* ============================================
   Enhanced Slate Tabs Scrolling
   Premium scroll experience with arrow navigation
   ============================================ */

/* Scroll wrapper - position relative for arrow buttons */
.slate-tabs-scroll-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    position: relative;
}

/* Arrow buttons removed — the overflow chip handles discovery/jumping,
   wheel/drag/keyboard handle scrolling. Edge fades signal overflow. */

/* Fade indicators at the strip edges */
.slate-tabs-scroll-wrapper::before,
.slate-tabs-scroll-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 32px;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.slate-tabs-scroll-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--liq-bg-secondary) 0%, transparent 100%);
}

.slate-tabs-scroll-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--liq-bg-secondary) 0%, transparent 100%);
}

.slate-tabs-scroll-wrapper.can-scroll-left::before {
    opacity: 1;
}

.slate-tabs-scroll-wrapper.can-scroll-right::after {
    opacity: 1;
}

/* Inner container: NOT user-scrollable — tabs that don't fit live in the
   overflow chip's dropdown instead, so a slate is either visible or one
   chip-click away (never "somewhere off-screen"). Programmatic scrolling
   (scroll-into-view on switch) still works via JS. */
.slate-tabs-inner {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    overflow-x: hidden;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 0.125rem 0;
    flex: 1;
    min-width: 0;
}

/* Mobile - narrower fades, rely on touch scroll */
@media (max-width: 768px) {
    .slate-tabs-scroll-wrapper::before,
    .slate-tabs-scroll-wrapper::after {
        width: 20px;
    }

    .slate-tabs-inner {
        cursor: default;
    }
}

/* ============================================
   Slate Tabs Overflow Chip + Dropdown
   Shows a "··· N" chip when tabs are scrolled
   out of view; clicking lists them for a jump
   ============================================ */

.slate-tabs-overflow-chip {
    display: none;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
    padding: 0.3125rem 0.5rem;
    background: var(--liq-bg-primary);
    border: 1px solid var(--liq-border-color);
    border-radius: 6px;
    color: var(--liq-text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    transition: all 0.15s ease;
}

    .slate-tabs-overflow-chip.has-overflow {
        display: inline-flex;
    }

    .slate-tabs-overflow-chip:hover {
        border-color: var(--liq-accent-green);
        color: var(--liq-accent-green);
    }

    .slate-tabs-overflow-chip .overflow-count {
        font-size: 0.65rem;
        font-weight: 600;
        padding: 0.15rem 0.4rem;
        border-radius: 10px;
        background: var(--liq-bg-tertiary);
        color: var(--liq-text-primary);
    }

.slate-overflow-menu {
    position: fixed;
    display: none;
    flex-direction: column;
    min-width: 240px;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--liq-bg-secondary);
    border: 1px solid var(--liq-border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--liq-shadow);
    z-index: 10000;
    padding: 0.25rem;
}

    .slate-overflow-menu.show {
        display: flex;
    }

.slate-overflow-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--liq-text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    text-align: left;
    transition: background 0.15s ease;
}

    .slate-overflow-item:hover {
        background: var(--liq-bg-hover);
    }

/* Slate tabs */
.slate-tab {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--liq-text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

    .slate-tab:hover {
        color: var(--liq-text-primary);
        background: var(--liq-bg-hover);
    }

    .slate-tab.active {
        color: var(--liq-accent-green);
        border-bottom-color: var(--liq-accent-green);
        /* Bottom-weighted tint reinforces the underline without shifting
           layout — bolding would change tab width and jump the strip */
        background: linear-gradient(180deg, transparent 20%, rgba(16, 185, 129, 0.12) 100%);
    }

    .slate-tab i.bi-x-lg {
        font-size: 0.7rem;
        padding: 0.125rem;
        border-radius: 3px;
        transition: background 0.15s ease;
    }

        .slate-tab i.bi-x-lg:hover {
            background: var(--liq-bg-tertiary);
        }

/* Demoted by the whole-tab layout: doesn't fully fit the strip, lives in
   the overflow chip instead. !important beats the date filter's inline
   display from jQuery .show(). */
.slate-tab.slate-tab-overflowed {
    display: none !important;
}

/* Site indicator in slate tabs */
.slate-tab-site {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .slate-tab-site .site-logo {
        height: 18px;
        width: auto;
        object-fit: contain;
        display: block;
    }

    .slate-tab-site .site-logo-fallback {
        display: none;
        font-size: 0.65rem;
        font-weight: 700;
        color: var(--liq-text-secondary);
    }

    .slate-tab-site.logo-failed .site-logo-fallback {
        display: inline;
    }

/* Sport emoji in slate tabs */
.slate-tab .sport-emoji {
    font-size: 0.9rem;
    line-height: 1;
    flex-shrink: 0;
    margin-right: 0; /* flex gap handles spacing; cancel table-cell margin */
}

.add-slate-btn {
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: 1px dashed var(--liq-border-color);
    color: var(--liq-text-secondary);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s;
    font-size: 0.8rem;
    flex-shrink: 0;
}

    .add-slate-btn:hover {
        border-color: var(--liq-accent-green);
        color: var(--liq-accent-green);
        border-style: solid;
    }

.date-display-small {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--liq-bg-primary);
    border-radius: 5px;
    border: 1px solid var(--liq-border-color);
    font-size: 0.8rem;
    white-space: nowrap;
    color: var(--liq-text-primary);
}

/* Settings dropdown in slate tabs */
.slate-tabs-settings {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

    .slate-tabs-settings .btn-icon {
        color: var(--liq-text-muted);
        padding: 0.375rem 0.5rem;
        border-radius: 6px;
        transition: all 0.15s ease;
    }

        .slate-tabs-settings .btn-icon:hover {
            color: var(--liq-text-primary);
            background: var(--liq-bg-tertiary);
        }

    .slate-tabs-settings .dropdown-menu {
        position: fixed !important;
        z-index: 1051;
        top: auto !important;
        right: 12px !important;
        left: auto !important;
        transform: none !important;
    }

/* Admin Tools Dropdown - matches .slate-tabs-settings structure */
.admin-tools-dropdown {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

    .admin-tools-dropdown .dropdown-menu {
        position: fixed !important;
        z-index: 1051;
        top: auto !important;
        right: 12px !important;
        left: auto !important;
        transform: none !important;
    }

    .admin-tools-dropdown .admin-tools-btn {
        color: var(--liq-text-muted);
        padding: 0.375rem 0.5rem;
        border-radius: 6px;
        transition: all 0.15s ease;
    }

        .admin-tools-dropdown .admin-tools-btn:hover {
            color: var(--liq-text-primary);
            background: var(--liq-bg-tertiary);
        }

/* Settings dropdown toggle item */
.dropdown-item-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    gap: 1rem;
}

    .dropdown-item-toggle .form-check-label {
        display: flex;
        align-items: center;
        margin-bottom: 0;
        font-size: 0.875rem;
        color: var(--liq-text-primary);
        cursor: pointer;
    }

    .dropdown-item-toggle .form-switch {
        padding-left: 2.5em;
        min-height: auto;
        margin-bottom: 0;
    }

    .dropdown-item-toggle .form-check-input {
        cursor: pointer;
    }

    .dropdown-item-toggle:hover {
        background: var(--liq-bg-hover);
    }

/* Build Tabs Section */
.build-tabs-section {
    background: var(--liq-bg-tertiary);
    border-bottom: 1px solid var(--liq-border-color);
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 44px;
}

.build-tabs-container {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.build-tab {
    padding: 0.375rem 0.875rem;
    background: var(--liq-bg-secondary);
    border: 1px solid var(--liq-border-color);
    border-radius: 6px;
    color: var(--liq-text-primary);
    opacity: 0.75;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    font-size: 0.85rem;
    position: relative;
    transition: all 0.15s ease;
}

    .build-tab:hover {
        border-color: var(--liq-accent-green);
        color: var(--liq-text-primary);
        opacity: 1;
    }

    .build-tab.active {
        background: var(--liq-accent-green);
        border-color: var(--liq-accent-green);
        color: white;
        opacity: 1;
    }

.build-tab-close {
    margin-left: 0.5rem;
    opacity: 0.6;
    font-size: 0.85rem;
}

    .build-tab-close:hover {
        opacity: 1;
        color: inherit;
    }

.add-build-btn {
    padding: 0.375rem 0.875rem;
    background: transparent;
    border: 1px dashed var(--liq-border-color);
    color: var(--liq-text-secondary);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.85rem;
}

    .add-build-btn:hover {
        border-color: var(--liq-accent-green);
        color: var(--liq-accent-green);
        border-style: solid;
    }

.build-tabs-separator {
    width: 1px;
    align-self: stretch;
    background: var(--liq-border-color);
    margin: 0 0.25rem;
}

/* Build Tab Styling Variations */

/* Regular Build Tab Styling (Green Gradient) */
.build-tab:not(.favorites-tab):not(.contests-tab):not(.contest-build-tab):not(.field-tab) {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, transparent 100%);
    border-color: rgba(16, 185, 129, 0.25);
}

    .build-tab:not(.favorites-tab):not(.contests-tab):not(.contest-build-tab):not(.field-tab):hover {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, transparent 100%);
        border-color: rgba(16, 185, 129, 0.4);
    }

    .build-tab:not(.favorites-tab):not(.contests-tab):not(.contest-build-tab):not(.field-tab).active {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.05) 100%);
        border-color: var(--liq-accent-green);
        color: var(--liq-text-primary);
    }

    .build-tab:not(.favorites-tab):not(.contests-tab):not(.contest-build-tab):not(.field-tab) i.bi-grid-3x3-gap {
        color: var(--liq-accent-green);
    }

/* Favorites Tab Styling */
.build-tab.favorites-tab {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, transparent 100%);
    border-color: rgba(255, 193, 7, 0.3);
}

    .build-tab.favorites-tab:hover {
        background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, transparent 100%);
        border-color: rgba(255, 193, 7, 0.5);
    }

    .build-tab.favorites-tab.active {
        background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 193, 7, 0.05) 100%);
        border-color: var(--liq-accent-yellow);
        color: #000;
    }

[data-bs-theme="dark"] .build-tab.favorites-tab.active {
    color: #fff;
}

.build-tab.favorites-tab.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.build-tab.favorites-tab i.bi-bookmark-fill {
    color: var(--liq-accent-yellow);
}

.favorites-count-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    background: var(--liq-accent-yellow);
    color: #000;
    border-radius: 10px;
    margin-left: 0.25rem;
}

/* Entries CSV upload — icon button just left of the Contests tab, in
   the Contests blue so it reads as part of that feature */
.entries-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, transparent 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    color: #3b82f6;
    cursor: pointer;
    transition: all 0.15s ease;
}

    .entries-upload-btn:hover {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.05) 100%);
        border-color: #3b82f6;
    }

    .entries-upload-btn i {
        font-size: 0.85rem;
        line-height: 1;
    }

/* Entries download — mirror of the upload button. Disabled until something
   is saved to entries; "ready" glow once app-saved lineups exist (that's
   the file to upload / the state late swap needs); brief pulse right after
   a save. */
.entries-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin-left: 0.25rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, transparent 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    color: #3b82f6;
    cursor: pointer;
    transition: all 0.15s ease;
}
    .entries-download-btn:hover {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.05) 100%);
        border-color: #3b82f6;
    }
    .entries-download-btn i {
        font-size: 0.85rem;
        line-height: 1;
    }
    .entries-download-btn.disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }
    .entries-download-btn.ready {
        color: var(--liq-accent-green, #16a34a);
        border-color: rgba(22, 163, 74, 0.6);
        background: linear-gradient(135deg, rgba(22, 163, 74, 0.15) 0%, transparent 100%);
        box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.25), 0 0 8px rgba(22, 163, 74, 0.35);
    }
    .entries-download-btn.ready:hover {
        border-color: var(--liq-accent-green, #16a34a);
        background: linear-gradient(135deg, rgba(22, 163, 74, 0.28) 0%, rgba(22, 163, 74, 0.08) 100%);
    }
    .entries-download-btn.pulse {
        animation: entries-download-pulse 1.2s ease-out 3;
    }
@keyframes entries-download-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55); }
    70%  { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* Contests Tab Styling */
.build-tab.contests-tab {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, transparent 100%);
    border-color: rgba(59, 130, 246, 0.3);
}

    .build-tab.contests-tab:hover {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, transparent 100%);
        border-color: rgba(59, 130, 246, 0.5);
    }

    .build-tab.contests-tab.active {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.05) 100%);
        border-color: #3b82f6;
        color: var(--liq-text-primary);
    }

    .build-tab.contests-tab i.bi-trophy {
        color: #3b82f6;
    }

/* Contest Build Tab Styling */
.build-tab.contest-build-tab {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, transparent 100%);
    border-color: rgba(59, 130, 246, 0.3);
}

    .build-tab.contest-build-tab:hover {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, transparent 100%);
        border-color: rgba(59, 130, 246, 0.5);
    }

    .build-tab.contest-build-tab.active {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.05) 100%);
        border-color: #3b82f6;
        color: var(--liq-text-primary);
    }

    .build-tab.contest-build-tab i.bi-trophy {
        color: #3b82f6;
    }

.contest-count-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-radius: 10px;
    margin-left: 0.25rem;
    font-weight: 600;
}

    .contest-count-badge:empty {
        display: none;
    }

/* Field Build Tab Styling — violet: system-generated opponent pool */
.build-tab.field-tab {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, transparent 100%);
    border-color: rgba(139, 92, 246, 0.3);
}

    .build-tab.field-tab:hover {
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, transparent 100%);
        border-color: rgba(139, 92, 246, 0.5);
    }

    .build-tab.field-tab.active {
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.05) 100%);
        border-color: #8b5cf6;
        color: var(--liq-text-primary);
    }

    .build-tab.field-tab i.bi-people-fill {
        color: #a78bfa;
    }

/* Date picker controls */
.date-picker-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Build Context Menu */
.build-context-menu {
    position: fixed;
    background: var(--liq-bg-secondary);
    border: 1px solid var(--liq-border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px var(--liq-shadow);
    z-index: 10000;
    min-width: 180px;
    display: none;
}

    .build-context-menu.show {
        display: block;
    }

.build-context-menu-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--liq-text-primary);
    border-bottom: 1px solid var(--liq-border-color);
}

    .build-context-menu-item:last-child {
        border-bottom: none;
    }

    .build-context-menu-item:hover {
        background: rgba(59, 130, 246, 0.1);
    }

    .build-context-menu-item.danger:hover {
        background: rgba(220, 53, 69, 0.1);
        color: #dc3545;
    }

/* ============================================
   OPTION C: Shimmer Effect
   Premium feel, like high-end loading states
   ============================================ */


.build-tab.has-background-task {
    position: relative;
    overflow: hidden;
}

.build-tab.has-background-task::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%
    );
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.slate-tabs-settings .dropdown-menu,
.admin-tools-dropdown .dropdown-menu {
    z-index: 99999 !important;
}
/* ============================================
   Late swap trigger (tab row, next to the entries download) + build tab
   ============================================ */
.lateswap-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: 0.25rem;
    border: 1px solid var(--liq-border-color);
    border-radius: 6px;
    background: transparent;
    color: var(--liq-text-secondary);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.lateswap-btn:hover {
    color: var(--liq-text-primary);
    border-color: var(--liq-text-secondary);
}

.lateswap-btn.active {
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25), 0 0 12px rgba(56, 189, 248, 0.25);
    animation: lateswap-pulse 2.4s ease-in-out infinite;
}

@keyframes lateswap-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25), 0 0 8px rgba(56, 189, 248, 0.2); }
    50%      { box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.45), 0 0 16px rgba(56, 189, 248, 0.45); }
}

.lateswap-btn.has-build:not(.active) {
    color: #38bdf8;
    animation: none;
}

/* Badge sits INSIDE the button box (the tab row scrolls horizontally, so
   anything hanging outside gets clipped) */
.lateswap-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 7px;
    background: #38bdf8;
    color: #06202b;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    display: none;
}

.lateswap-btn.active .bi { margin-top: 3px; margin-right: 3px; }

/* URGENT: an entry has an open slot with an out / 0-projection player */
.lateswap-btn.urgent,
.lateswap-btn.urgent.active {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.7);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.3), 0 0 12px rgba(248, 113, 113, 0.35);
    animation: lateswap-pulse-urgent 1.4s ease-in-out infinite;
}

.lateswap-btn.urgent .lateswap-badge { background: #f87171; color: #2a0a0a; }

@keyframes lateswap-pulse-urgent {
    0%, 100% { box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.3), 0 0 8px rgba(248, 113, 113, 0.3); }
    50%      { box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.6), 0 0 18px rgba(248, 113, 113, 0.6); }
}

.build-tab.lateswap-tab i.bi-clock-history {
    color: #38bdf8;
}

/* Late Swap workspace: lock banner under the header */
.lateswap-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    color: var(--liq-text-secondary);
    background: rgba(56, 189, 248, 0.06);
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.lateswap-banner strong { color: var(--liq-text-primary); }

.lateswap-showlocked {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    white-space: nowrap;
    cursor: pointer;
}

.lateswap-showlocked input { accent-color: #38bdf8; }
