.whatsapp-float {
    position: fixed;
    right: max(24px, env(safe-area-inset-right, 0px));
    bottom: max(24px, env(safe-area-inset-bottom, 0px));
    z-index: 950;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.whatsapp-float i {
    font-size: 34px;
    line-height: 1;
}

.whatsapp-float:hover {
    background: #1ebe5d;
    color: #fff;
    transform: translateY(-3px);
}

.whatsapp-float:focus-visible {
    outline: 3px solid #075e54;
    outline-offset: 4px;
}

/* Keep the page navigator above WhatsApp on smaller screens. */
@media (max-width: 1400px) {
    .toc-toggle {
        bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    }

    .toc-container.mobile-active {
        bottom: calc(168px + env(safe-area-inset-bottom, 0px));
        max-height: min(60vh, calc(100dvh - 200px));
    }
}

@media (max-width: 768px) {
    .whatsapp-float {
        right: max(16px, env(safe-area-inset-right, 0px));
        bottom: max(16px, env(safe-area-inset-bottom, 0px));
        width: 56px;
        height: 56px;
    }
}

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

    .whatsapp-float:hover {
        transform: none;
    }
}

@media print {
    .whatsapp-float {
        display: none;
    }
}
