.discovery > .loading-overlay {
    position: absolute;
    z-index: 1000;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 35px 40px;
    background: var(--discovery-background-color);
    will-change: opacity, visibility;
}
.discovery > .loading-overlay.error {
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.discovery > .loading-overlay > .view-app-header {
    transition: opacity .25s 500ms;
    will-change: opacity;
    contain: paint;

    @starting-style {
        opacity: 0;
    }
}
.discovery > .loading-overlay.error > .view-app-header {
    transition: none !important;
}
.discovery > .loading-overlay.done > .view-app-header {
    visibility: hidden;
}
.discovery > .loading-overlay.error > .view-app-header:first-child {
    margin-top: -10px;
    margin-bottom: 27px;
}

.discovery > .loading-overlay.error > .action-buttons .view-button + .view-button {
    margin-left: 2ex;
}

.discovery > .loading-overlay.error > .error-message,
.discovery > .loading-overlay.error > .warning-message {
    padding: 20px;
    box-sizing: border-box;
    color: #d85a5a;
    background: #ff00002e;
    overflow: auto;
    min-height: 6.2em;
}
.discovery > .loading-overlay.error > .warning-message {
    color: #856404;
    background-color: #fff3d1;
}
.discovery-root-darkmode > .loading-overlay.error > .error-message {
    background-color: #3f3333;
    color: #dc7c7c;
}
.discovery-root-darkmode > .loading-overlay.error > .warning-message {
    background-color: #3c3627;
    color: #bdab77;
}
.discovery > .loading-overlay.error > :is(.error-message, .warning-message) a {
    color: inherit;
    color: color-mix(in srgb, currentColor, var(--discovery-color) 35%);
    text-decoration-color: color-mix(in srgb, currentColor, var(--discovery-background-color) 65%);
}
.discovery-root-darkmode > .loading-overlay.error > :is(.error-message, .warning-message) a {
    color: color-mix(in srgb, currentColor, var(--discovery-color) 45%);
    text-decoration-color: color-mix(in srgb, currentColor, var(--discovery-background-color) 45%);
}
.discovery > .loading-overlay.error > :is(.error-message, .warning-message) a:hover {
    text-decoration-color: currentColor;
}

.discovery > .loading-overlay.error > :is(.error-message, .warning-message) .error-type-badge {
    margin: -20px 0 15px -20px;
}
.discovery > .loading-overlay.error > :is(.error-message, .warning-message) .error-type-badge::before {
    content: 'Error' attr(data-stage);
    display: inline-block;
    padding: 1ex 20px;
    background-color: #ff9d9d;
    color: #992d2d;
    text-shadow: none;
    font-size: 11px;
    text-transform: uppercase;
}
.discovery-root-darkmode > .loading-overlay.error > :is(.error-message, .warning-message) .error-type-badge::before {
    color: var(--discovery-color);
    background-color: #833939;
}
.discovery > .loading-overlay.error > .warning-message .error-type-badge::before {
    color: inherit;
    background-color: #f9de91;
}
.discovery-root-darkmode > .loading-overlay.error > .warning-message .error-type-badge::before {
    background-color: #5d502d;
}

.discovery > .loading-overlay.done {
    opacity: 0;
    visibility: hidden;
    transition: all .25s;
    pointer-events: none;
}

.discovery > .loading-overlay .view-progress {
    max-width: none;
}
.discovery > .loading-overlay .view-progress .progress {
    max-width: 300px;
}
