.ol-loader {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    pointer-events: all;
}

.ol-loader[hidden] {
    display: none !important;
}

body.ol-loader-open {
    overflow: hidden;
}

.ol-loader.is-active {
    animation: olLoaderIn 0.18s ease-out forwards;
}

.ol-loader.is-leaving {
    animation: olLoaderOut 0.16s ease-in forwards;
}

.ol-loader__veil {
    position: absolute;
    inset: 0;
    background: rgba(15, 18, 24, 0.42);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
}

html[data-theme="dark"] .ol-loader__veil {
    background: rgba(8, 10, 16, 0.55);
    backdrop-filter: blur(10px) saturate(115%);
    -webkit-backdrop-filter: blur(10px) saturate(115%);
}

.ol-loader__panel {
    position: relative;
    z-index: 1;
    width: min(92vw, 228px);
    padding: 1.45rem 1.3rem 1.2rem;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid rgba(148, 0, 0, 0.08);
    box-shadow:
        0 18px 48px rgba(15, 18, 24, 0.22),
        0 2px 8px rgba(15, 18, 24, 0.08);
    text-align: center;
    animation: olPanelIn 0.22s ease-out both;
}

.ol-loader__mark {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 0 auto 0.95rem;
    display: grid;
    place-items: center;
}

.ol-loader__spinner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(148, 0, 0, 0.12);
    border-top-color: #940000;
    animation: olLoaderSpin 0.75s linear infinite;
}

.ol-loader__logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    display: block;
}

.ol-loader__label {
    margin: 0 0 0.9rem;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #1f2937;
}

.ol-loader__dots {
    display: inline-block;
    min-width: 1.1em;
    letter-spacing: 0.05em;
    animation: olLoaderDots 1.2s steps(1, end) infinite;
}

.ol-loader__track {
    position: relative;
    height: 3px;
    border-radius: 999px;
    background: rgba(148, 0, 0, 0.12);
    overflow: hidden;
}

.ol-loader.is-progress .ol-loader__track {
    display: none;
}

.ol-loader__progress {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.1rem;
}

.ol-loader__progress[hidden] {
    display: none !important;
}

.ol-loader__progress-bar {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 0, 0, 0.12);
    overflow: hidden;
}

.ol-loader__progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: #940000;
    transition: width 0.3s ease;
}

.ol-loader__progress-pct {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.ol-loader__track-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40%;
    border-radius: inherit;
    background: #940000;
    animation: olLoaderIndeterminate 1.1s ease-in-out infinite;
}

@keyframes olLoaderIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes olLoaderOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes olPanelIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes olLoaderSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes olLoaderDots {
    0%,
    20% {
        clip-path: inset(0 100% 0 0);
    }

    40% {
        clip-path: inset(0 66% 0 0);
    }

    60% {
        clip-path: inset(0 33% 0 0);
    }

    80%,
    100% {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes olLoaderIndeterminate {
    0% {
        left: -40%;
    }

    100% {
        left: 100%;
    }
}

html[data-theme="dark"] .ol-loader__panel {
    background: #1e2430;
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow:
        0 18px 48px rgba(0, 0, 0, 0.5),
        0 2px 8px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .ol-loader__label {
    color: #f1f5f9;
}

html[data-theme="dark"] .ol-loader__progress-pct {
    color: #94a3b8;
}

html[data-theme="dark"] .ol-loader__spinner {
    border-color: rgba(255, 255, 255, 0.12);
    border-top-color: #e8a0a0;
}

html[data-theme="dark"] .ol-loader__track,
html[data-theme="dark"] .ol-loader__progress-bar {
    background: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .ol-loader__track-bar,
html[data-theme="dark"] .ol-loader__progress-fill {
    background: #e8a0a0;
}

@media (prefers-reduced-motion: reduce) {
    .ol-loader.is-active,
    .ol-loader.is-leaving,
    .ol-loader__panel,
    .ol-loader__spinner,
    .ol-loader__dots,
    .ol-loader__track-bar {
        animation: none !important;
    }
}
