#components-reconnect-modal {
    display: none;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    position: fixed;
    right: 18px;
    bottom: 18px;
    left: 18px;
    z-index: var(--z-reconnect, 99999);
    display: flex;
    justify-content: center;
    pointer-events: none;
}

#components-reconnect-modal.components-reconnect-hide {
    display: none;
}

.reconnect-panel {
    width: min(100%, 560px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.28);
    pointer-events: auto;
}

.reconnect-status {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reconnect-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.reconnect-title {
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.25;
}

.reconnect-state {
    display: none;
    color: #cbd5e1;
    font-size: 0.84rem;
    line-height: 1.35;
}

.components-reconnect-show .reconnect-state--show,
.components-reconnect-failed .reconnect-state--failed,
.components-reconnect-rejected .reconnect-state--rejected {
    display: inline;
}

.components-reconnect-rejected .reconnect-spinner,
.components-reconnect-failed .reconnect-spinner {
    display: none;
}

.reconnect-attempts:has(#components-reconnect-current-attempt:empty) {
    display: none;
}

.reconnect-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: reconnect-spin 0.9s linear infinite;
    flex: 0 0 auto;
}

.reconnect-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.reconnect-button {
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    padding: 7px 11px;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.reconnect-button:hover,
.reconnect-button:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.32);
}

.reconnect-button:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.reconnect-button--primary {
    border-color: #a7f3d0;
    background: #d1fae5;
    color: #064e3b;
}

.reconnect-button--primary:hover,
.reconnect-button--primary:focus-visible {
    border-color: #bbf7d0;
    background: #ecfdf5;
    color: #064e3b;
}

.reconnect-button[disabled] {
    cursor: wait;
    opacity: 0.7;
}

.components-reconnect-rejected [data-reconnect-retry] {
    display: none;
}

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

@media (max-width: 640px) {
    #components-reconnect-modal.components-reconnect-show,
    #components-reconnect-modal.components-reconnect-failed,
    #components-reconnect-modal.components-reconnect-rejected {
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        left: 10px;
    }

    .reconnect-panel {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .reconnect-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .reconnect-button {
        width: 100%;
    }
}
