/* Connection recovery — theme-aware, mobile-friendly */
#cr-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: var(--primarycolor, #2563eb);
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.35;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
    pointer-events: none;
}

#cr-banner.cr-visible {
    display: flex;
}

#cr-banner .cr-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cr-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes cr-spin {
    to { transform: rotate(360deg); }
}

#cr-overlay {
    position: fixed;
    inset: 0;
    z-index: 10040;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    padding: 1rem;
}

#cr-overlay.cr-visible {
    display: flex;
}

#cr-fatal-panel {
    max-width: 22rem;
    width: 100%;
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

#cr-fatal-panel h2 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
    color: #1a1a1a;
}

#cr-fatal-panel p {
    font-size: 0.9rem;
    color: #555;
    margin: 0 0 1rem;
}

#cr-fatal-panel button {
    background: var(--primarycolor, #2563eb);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    cursor: pointer;
}

#cr-fatal-panel button:hover {
    filter: brightness(0.92);
}

@media (max-width: 576px) {
    #cr-banner {
        font-size: 0.82rem;
        padding: 0.55rem 0.75rem;
    }
}
