#components-reconnect-modal {
    position: fixed;
    z-index: 12000;
    inset: 0;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, .56);
    backdrop-filter: blur(3px);
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

#components-reconnect-modal.components-reconnect-hide { display: none; }
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected { display: grid; }

.reconnect-card {
    width: min(440px, 100%);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 28px 75px rgba(15, 23, 42, .32);
}

.reconnect-state {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 2rem 2rem 1.8rem;
    color: #15253a;
    text-align: center;
}

#components-reconnect-modal.components-reconnect-show .reconnect-state-show,
#components-reconnect-modal.components-reconnect-failed .reconnect-state-failed,
#components-reconnect-modal.components-reconnect-rejected .reconnect-state-rejected { display: flex; }

.reconnect-visual {
    position: relative;
    display: grid;
    width: 66px;
    height: 66px;
    place-items: center;
    margin-bottom: 1rem;
    border-radius: 20px;
    background: #eaf3ff;
    color: #146bd1;
    font-size: 1.65rem;
}

.reconnect-visual-waiting span {
    position: absolute;
    inset: -7px;
    border: 2px solid rgba(20, 107, 209, .25);
    border-radius: 24px;
    animation: reconnect-pulse 1.7s ease-out infinite;
}

.reconnect-visual-warning { background: #fff2e8; color: #c65a12; }
.reconnect-kicker { color: #146bd1; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.reconnect-state-failed .reconnect-kicker,
.reconnect-state-rejected .reconnect-kicker { color: #b54708; }
.reconnect-state h2 { margin: .35rem 0 .45rem; font-size: 1.35rem; font-weight: 750; }
.reconnect-state p { max-width: 340px; margin: 0; color: #5b6b7f; font-size: .9rem; line-height: 1.55; }
.reconnect-state small { margin-top: .65rem; color: #8290a1; }

.reconnect-progress {
    width: min(270px, 85%);
    height: 4px;
    margin-top: 1.25rem;
    overflow: hidden;
    border-radius: 999px;
    background: #e6edf5;
}

.reconnect-progress span {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1677d2, #4aa8ff);
    animation: reconnect-loading 1.35s ease-in-out infinite;
}

.reconnect-actions { display: flex; justify-content: center; gap: .55rem; margin-top: 1.35rem; }
.reconnect-actions button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .65rem 1rem;
    border: 1px solid #1677d2;
    border-radius: 9px;
    background: #1677d2;
    color: #fff;
    font-size: .82rem;
    font-weight: 750;
}
.reconnect-actions button:hover { background: #0f65b8; }
.reconnect-actions button:disabled { cursor: wait; opacity: .65; }
.reconnect-actions .reconnect-secondary { border-color: #cbd6e2; background: #fff; color: #40566f; }
.reconnect-actions .reconnect-secondary:hover { background: #f5f8fb; }

@keyframes reconnect-pulse { 0% { transform: scale(.84); opacity: .85; } 75%,100% { transform: scale(1.18); opacity: 0; } }
@keyframes reconnect-loading { 0% { transform: translateX(-115%); } 55%,100% { transform: translateX(240%); } }

@media (max-width: 520px) {
    #components-reconnect-modal { align-items: end; padding: .65rem; }
    .reconnect-card { border-radius: 16px; }
    .reconnect-state { padding: 1.6rem 1.15rem 1.35rem; }
    .reconnect-actions { width: 100%; flex-direction: column; }
    .reconnect-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .reconnect-visual-waiting span,
    .reconnect-progress span { animation: none; }
}
