/* QK Turbo Drive chrome — progress, fade, preview, busy, reduced-motion */

[x-cloak] {
    display: none !important;
}

@keyframes qk-turbo-fade-in {
    from { opacity: 0.85; }
    to { opacity: 1; }
}

html.is-turbo-ready #turbo-container.is-turbo-visit {
    animation: qk-turbo-fade-in 0.12s ease-out both;
}

#turbo-container {
    animation: none;
}

html[data-turbo-preview] *,
html[data-turbo-preview] *::before,
html[data-turbo-preview] *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

html[data-turbo-preview] #turbo-container,
body.no-turbo-animation #turbo-container,
body.chapter-reading-page #turbo-container,
body.post-show-page #turbo-container {
    animation: none !important;
    will-change: auto !important;
    transform: none !important;
    opacity: 1 !important;
}

.turbo-progress-bar {
    height: 2px !important;
    background: #287e77 !important;
    box-shadow: none !important;
}

html.is-turbo-busy {
    cursor: progress;
}

html.is-turbo-busy body > *:not(.qk-skip-link) {
    pointer-events: none;
}

html.is-turbo-busy .qk-skip-link {
    pointer-events: auto;
}

html.is-turbo-busy::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 99990;
    background: rgb(15 23 42 / 0.06);
    pointer-events: none;
}

html:has(body.dark).is-turbo-busy::before {
    background: rgb(248 250 252 / 0.06);
}

body.hide-floating #theme-toggle,
body.hide-floating #donate,
body.hide-floating #donate-close,
body.hide-floating #tts-global-btn,
body.hide-floating #global-chat-btn {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

@media (prefers-reduced-motion: reduce) {
    html.is-turbo-ready #turbo-container.is-turbo-visit,
    #turbo-container {
        animation: none !important;
    }
    .turbo-progress-bar {
        display: none !important;
        transition: none !important;
    }
    html.is-turbo-busy::before {
        display: none;
    }
    body.hide-floating #theme-toggle,
    body.hide-floating #donate,
    body.hide-floating #tts-global-btn,
    body.hide-floating #global-chat-btn {
        transform: none !important;
    }
}
