/* Floating buttons: "Install app" and "Back to top". Loaded by both the
   signed-in layout and the sign-in layout, so it does not rely on app.css. */

.float_install,
.float_top {
    position: fixed;
    z-index: 1040;
    border: 0;
    font-family: inherit;
    box-shadow: 0 6px 20px rgba(31, 41, 55, 0.22);
}

.float_install[hidden],
.float_top[hidden],
.float_install-tip[hidden] {
    display: none !important;
}

/* ---- Install app ---- */
.float_install {
    left: 16px;
    bottom: 16px;
    display: inline-flex;
    align-items: stretch;
    border-radius: 999px;
    background: #A00007;
    color: #ffffff;
    overflow: hidden;
}

.float_install-action,
.float_install-close {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    min-height: 46px;
    cursor: pointer;
}

.float_install-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 6px 0 18px;
    font-size: 14px;
    font-weight: 600;
}

.float_install-close {
    width: 40px;
    font-size: 13px;
    opacity: 0.8;
}

.float_install-action:hover,
.float_install-close:hover {
    background: rgba(255, 255, 255, 0.12);
    opacity: 1;
}

.float_install-tip {
    position: fixed;
    z-index: 1040;
    left: 16px;
    right: 16px;
    bottom: 72px;
    max-width: 340px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #1F2937;
    color: #ffffff;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 6px 20px rgba(31, 41, 55, 0.22);
}

/* ---- Back to top ---- */
.float_top {
    right: 16px;
    bottom: 16px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #ffffff;
    color: #A00007;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.float_top.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.float_top:hover {
    background: #A00007;
    color: #ffffff;
}

.float_install-action:focus-visible,
.float_install-close:focus-visible,
.float_top:focus-visible {
    outline: 2px solid #1F2937;
    outline-offset: 2px;
}

/* Phones and tablets have the tab bar along the bottom edge; sit above it. */
@media (max-width: 991.98px) {
    body.has-bottom-nav .float_install,
    body.has-bottom-nav .float_top {
        bottom: calc(70px + env(safe-area-inset-bottom));
    }

    body.has-bottom-nav .float_install-tip {
        bottom: calc(126px + env(safe-area-inset-bottom));
    }
}

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