#components-reconnect-modal {
    width: min(440px, calc(100vw - 32px));
    margin: 18vh auto 0;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: #1f2937;
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.28);
    overflow: visible;
}

#components-reconnect-modal::backdrop {
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(1.5px);
}

#components-reconnect-modal .fan-atx-reconnect-card {
    box-sizing: border-box;
    width: 100%;
    padding: 28px 30px 26px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 16px;
    background: #ffffff;
    text-align: center;
}

#components-reconnect-modal .fan-atx-reconnect-logo {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    border-radius: 18px;
    background: linear-gradient(145deg, #2f80ed, #2563eb);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.25);
}

#components-reconnect-modal .fan-atx-reconnect-logo img {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
}

#components-reconnect-modal .fan-atx-reconnect-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    color: #172033;
}

#components-reconnect-modal .fan-atx-reconnect-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #4b5563;
}

#components-reconnect-modal .fan-atx-reconnect-meta {
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.45;
    color: #7c8798;
}

#components-reconnect-modal .fan-atx-reconnect-spinner {
    position: relative;
    width: 34px;
    height: 34px;
    margin: 18px auto 2px;
}

#components-reconnect-modal .fan-atx-reconnect-spinner::before,
#components-reconnect-modal .fan-atx-reconnect-spinner::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 3px solid rgba(47, 128, 237, 0.22);
    border-top-color: #2f80ed;
    border-radius: 50%;
    animation: fan-atx-reconnect-spin 0.9s linear infinite;
}

#components-reconnect-modal .fan-atx-reconnect-spinner::after {
    inset: 7px;
    border-width: 2px;
    border-color: rgba(47, 128, 237, 0.18);
    border-bottom-color: #60a5fa;
    animation-direction: reverse;
    animation-duration: 1.25s;
}

#components-reconnect-modal .fan-atx-reconnect-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}

#components-reconnect-modal .fan-atx-reconnect-button {
    min-width: 148px;
    padding: 9px 18px;
    border: 1px solid #2f80ed;
    border-radius: 8px;
    background: #2f80ed;
    color: #ffffff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

#components-reconnect-modal .fan-atx-reconnect-button:hover {
    background: #2563eb;
    border-color: #2563eb;
}

#components-reconnect-modal .fan-atx-reconnect-button:active {
    transform: translateY(1px);
}

#components-reconnect-modal .fan-atx-reconnect-button.secondary {
    background: #ffffff;
    color: #334155;
    border-color: #cbd5e1;
}

#components-reconnect-modal .fan-atx-reconnect-button.secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

#components-reconnect-modal .fan-atx-reconnect-state,
#components-reconnect-modal .fan-atx-reconnect-spinner,
#components-reconnect-modal .fan-atx-reconnect-actions,
#components-reconnect-modal .fan-atx-reconnect-attempts {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .fan-atx-state-first,
#components-reconnect-modal.components-reconnect-show .fan-atx-reconnect-spinner,
#components-reconnect-modal.components-reconnect-show .fan-atx-reconnect-attempts,
#components-reconnect-modal.components-reconnect-retrying .fan-atx-state-retrying,
#components-reconnect-modal.components-reconnect-retrying .fan-atx-reconnect-attempts,
#components-reconnect-modal.components-reconnect-retrying .fan-atx-reconnect-spinner,
#components-reconnect-modal.components-reconnect-failed .fan-atx-state-failed,
#components-reconnect-modal.components-reconnect-failed .fan-atx-actions-retry,
#components-reconnect-modal.components-reconnect-rejected .fan-atx-state-rejected,
#components-reconnect-modal.components-reconnect-rejected .fan-atx-actions-reload,
#components-reconnect-modal.components-reconnect-paused .fan-atx-state-paused,
#components-reconnect-modal.components-reconnect-paused .fan-atx-actions-resume,
#components-reconnect-modal.components-reconnect-resume-failed .fan-atx-state-resume-failed,
#components-reconnect-modal.components-reconnect-resume-failed .fan-atx-actions-resume {
    display: block;
}

#components-reconnect-modal.components-reconnect-failed .fan-atx-reconnect-logo,
#components-reconnect-modal.components-reconnect-rejected .fan-atx-reconnect-logo,
#components-reconnect-modal.components-reconnect-resume-failed .fan-atx-reconnect-logo {
    background: linear-gradient(145deg, #ef4444, #dc2626);
    box-shadow: 0 8px 22px rgba(220, 38, 38, 0.22);
}

#components-reconnect-modal.components-reconnect-paused .fan-atx-reconnect-logo {
    background: linear-gradient(145deg, #f59e0b, #d97706);
    box-shadow: 0 8px 22px rgba(217, 119, 6, 0.22);
}

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

@media (max-width: 560px) {
    #components-reconnect-modal {
        width: calc(100vw - 24px);
        margin-top: 12vh;
    }

    #components-reconnect-modal .fan-atx-reconnect-card {
        padding: 24px 20px 22px;
    }

    #components-reconnect-modal .fan-atx-reconnect-actions {
        flex-direction: column;
    }

    #components-reconnect-modal .fan-atx-reconnect-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    #components-reconnect-modal .fan-atx-reconnect-spinner::before,
    #components-reconnect-modal .fan-atx-reconnect-spinner::after {
        animation-duration: 2.4s;
    }
}
