/* The quick access bar (design stickybar.html). yavi's .sticky-bar-main stays the fixed shell; the pill is .lea-quickbar. */

/* yavi hides the shell until 300px of scroll and below 992px; this bar carries login and search, so it stays. */
.sticky-bar-main:has(.lea-quickbar) {
    right: 22px;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

.sticky-bar-main:has(.lea-quickbar).is-hidden {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lea-quickbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: #0a1b3e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    box-shadow: 0 14px 40px rgba(10, 27, 62, 0.35);
    font-family: inherit;
}

.lea-quickbar__item {
    position: relative;
}

.lea-quickbar .lea-quickbar__btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.lea-quickbar .lea-quickbar__btn:hover,
.lea-quickbar .lea-quickbar__btn:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    color: #ff7a5c;
    outline: none;
}

.lea-quickbar__btn > svg {
    display: block;
    width: 20px;
    height: 20px;
}

.lea-quickbar__badge {
    position: absolute;
    top: 4px;
    right: 3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: linear-gradient(135deg, #e22225, #ff7a5c);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.lea-quickbar__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, #e22225, #ff7a5c);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.lea-quickbar__sep {
    width: 26px;
    height: 1px;
    margin: 2px 0;
    background: rgba(255, 255, 255, 0.16);
}

/* Back to top: the design's red circle, with yavi's percentage kept inside and its ring moved outside. */
.lea-quickbar .lea-quickbar__top {
    position: relative;
    display: flex;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: #b63032;
    color: #fff;
    transition: background 0.2s ease, opacity 0.3s ease, transform 0.3s ease;
}

.lea-quickbar .lea-quickbar__top:hover,
.lea-quickbar .lea-quickbar__top:focus-visible {
    background: #e22225;
    outline: none;
}

/* yavi only toggles visibility; the design fades and shrinks instead. */
.lea-quickbar .lea-quickbar__top.is-hidden {
    visibility: visible;
    opacity: 0;
    transform: scale(0.6);
    pointer-events: none;
}

.lea-quickbar .lea-quickbar__ring {
    position: absolute;
    inset: -5px;
    width: calc(100% + 10px);
    height: calc(100% + 10px);
    pointer-events: none;
}

.lea-quickbar .lea-quickbar__top .stickybar-progress__track {
    stroke: rgba(182, 48, 50, 0.25);
}

.lea-quickbar .lea-quickbar__top .stickybar-progress__bar {
    stroke: #e22225;
}

.lea-quickbar .lea-quickbar__top .stickybar-progress__pct {
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.lea-quickbar .lea-quickbar__top .stickybar-progress__arrow {
    width: 44px;
    height: 44px;
    background: transparent;
    color: #fff;
}

.lea-quickbar__tip {
    position: absolute;
    top: 50%;
    right: calc(100% + 14px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    background: #2e3440;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-50%) translateX(6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

.lea-quickbar__tip::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #b63032;
}

.lea-quickbar__tip::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    margin-top: -5px;
    border: 5px solid transparent;
    border-left-color: #2e3440;
}

.lea-quickbar__item:hover .lea-quickbar__tip,
.lea-quickbar__item:focus-within .lea-quickbar__tip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

/* yavi sets display:none !important below 992px; the heavier selector wins that tie. */
@media (max-width: 992px) {
    .sticky-bar-main:has(.lea-quickbar) {
        display: flex !important;
    }
}

/* The switch only exists for phones; on wider screens the bar is always open. */
.lea-quickbar__switch,
.lea-quickbar__toggle {
    display: none;
}

/* Phones (design stickybar-mobil.html): a horizontal bar bottom right, folded to the red toggle. */
@media (max-width: 760px) {
    .sticky-bar-main:has(.lea-quickbar) {
        top: auto;
        right: 12px;
        bottom: 16px;
        transform: none;
    }

    /* No gap: folded items would keep it, so the spacing comes from margins that open with them. */
    .lea-quickbar {
        flex-direction: row;
        gap: 0;
        padding: 8px;
    }

    .lea-quickbar__tip {
        display: none;
    }

    .lea-quickbar__switch {
        display: block;
        position: absolute;
        width: 1px;
        height: 1px;
        margin: 0;
        opacity: 0;
        pointer-events: none;
    }

    .lea-quickbar .lea-quickbar__toggle {
        display: flex;
        flex: none;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin: 0;
        border-radius: 999px;
        background: #b63032;
        color: #fff;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    .lea-quickbar .lea-quickbar__toggle:hover,
    .lea-quickbar__switch:focus-visible ~ .lea-quickbar__toggle {
        background: #e22225;
    }

    .lea-quickbar__switch:focus-visible ~ .lea-quickbar__toggle {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

    .lea-quickbar__toggle svg {
        display: block;
        width: 18px;
        height: 18px;
        transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .lea-quickbar__switch:checked ~ .lea-quickbar__toggle svg {
        transform: rotate(180deg);
    }

    /* Folded: no width, and hidden from tab order until the fold is done. */
    .lea-quickbar__item,
    .lea-quickbar__sep {
        overflow: hidden;
        max-width: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateX(14px);
        transition: margin 0.35s cubic-bezier(0.22, 1, 0.36, 1), padding 0.35s cubic-bezier(0.22, 1, 0.36, 1), max-width 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.35s;
    }

    .lea-quickbar__sep {
        width: 1px;
        height: 26px;
        margin: 0;
    }

    .lea-quickbar__switch:checked ~ .lea-quickbar__item,
    .lea-quickbar__switch:checked ~ .lea-quickbar__sep {
        max-width: 60px;
        opacity: 1;
        visibility: visible;
        margin-right: 4px;
        transform: translateX(0);
        transition: margin 0.35s cubic-bezier(0.22, 1, 0.36, 1), max-width 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
    }

    .lea-quickbar__switch:checked ~ .lea-quickbar__item:nth-last-of-type(2) { transition-delay: 0.05s; }
    .lea-quickbar__switch:checked ~ .lea-quickbar__item:nth-last-of-type(3) { transition-delay: 0.1s; }
    .lea-quickbar__switch:checked ~ .lea-quickbar__item:nth-last-of-type(4) { transition-delay: 0.15s; }

    /* Room for the progress ring, which the item would otherwise clip. */
    .lea-quickbar__switch:checked ~ .lea-quickbar__sep {
        margin: 0 6px 0 2px;
    }

    .lea-quickbar__switch:checked ~ .lea-quickbar__item--top {
        padding: 5px;
        margin: -5px 4px -5px 0;
    }

    /* Opened by hand, so it stays visible at the top of the page too. */
    .lea-quickbar .lea-quickbar__top.is-hidden {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lea-quickbar *,
    .lea-quickbar__tip {
        transition: none;
    }
}
