html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Shown until Compose takes the page over; the canvas it draws on covers it. */
#loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* The app's loading bar (LoadingBar.kt): 4px along the top on a pale track, the default theme's primary. */
#loading .bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    overflow: hidden;
    background: rgba(25, 118, 210, 0.3);
}

#loading .bar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: #1976d2;
    animation: botl-slide 1.4s ease-in-out infinite;
}

/* Material's ring: 40px, a quarter of it in the primary. */
#loading .ring {
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(25, 118, 210, 0.2);
    border-top-color: #1976d2;
    border-radius: 50%;
    animation: botl-spin 0.9s linear infinite;
}

@keyframes botl-slide {
    from { transform: translateX(-100%); }
    to { transform: translateX(250%); }
}

@keyframes botl-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    #loading .bar::before { animation-duration: 3s; }
    #loading .ring { animation-duration: 2s; }
}
