.components-reconnect-first-attempt-visible,
.components-reconnect-repeated-attempt-visible,
.components-reconnect-failed-visible,
.components-pause-visible,
.components-resume-failed-visible { display: none; }

[data-reconnect-state="show"] .components-reconnect-first-attempt-visible,
[data-reconnect-state="retrying"] .components-reconnect-repeated-attempt-visible,
[data-reconnect-state="failed"] .components-reconnect-failed-visible,
[data-reconnect-state="paused"] .components-pause-visible,
[data-reconnect-state="resume-failed"] .components-resume-failed-visible { display: block; }

#components-reconnect-modal {
    --es-reconnect-accent: var(--es-company-accent, #338be8);
    width: min(480px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: auto;
    color: var(--mud-palette-text-primary, #172638);
    background: var(--mud-palette-surface, #fff);
    /* MudBlazor sets this dialog's background with !important globally. */
    background-color: var(--mud-palette-surface, #fff) !important;
    outline: none;
    border: 1px solid var(--mud-palette-lines-default, #dbe2eb);
    border-radius: var(--es-company-radius, 18px);
    box-shadow: 0 28px 100px #0005, 0 0 0 6px color-mix(in srgb, var(--es-reconnect-accent) 8%, transparent);
    font-family: var(--es-company-font, PlatformInter, 'Segoe UI', sans-serif);
}
#components-reconnect-modal[open] { animation: es-reconnect-enter .22s ease-out both; }
/* Older Android WebViews accept the palette custom property but cannot resolve
   its light-dark() value. var()'s fallback does not cover that case. */
@supports not (background-color: light-dark(white, black)) {
    #components-reconnect-modal { background: #fff !important; color: #172638; }
}
#components-reconnect-modal::backdrop { background: #050e1ba8; backdrop-filter: blur(8px); }
.es-reconnect-brand {
    min-height: 126px;
    padding: 32px 44px;
    display: grid;
    place-items: center;
    background: linear-gradient(125deg, #fff, #eff3f7);
    border-bottom: 3px solid var(--es-reconnect-accent);
}
.es-reconnect-brand img { display: block; margin: auto; max-width: calc(100% / 1.4); width: 300px; height: 64px; object-fit: contain; transform: scale(1.4); transform-origin: center; }
.es-reconnect-brand-light { display: var(--es-branding-light-logo-display, block); }
.es-reconnect-brand-dark { display: var(--es-branding-dark-logo-display, none); }
.es-reconnect-brand-dark:has([data-custom-dark="true"]) { background: linear-gradient(125deg, #111820, #1c2733); }
#es-reconnect-brand-fallback { color: #172638; font-size: 24px; font-weight: 700; }
.es-reconnect-content { padding: 30px 32px 32px; }
.es-reconnect-label { display: flex; align-items: center; gap: 9px; color: var(--mud-palette-primary, #172638); font-size: 12px; font-weight: 700; letter-spacing: .065em; text-transform: uppercase; }
.es-reconnect-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent); flex-shrink: 0; }
#es-reconnect-title { margin: 18px 0 12px; font: inherit; font-size: clamp(22px, 5vw, 28px); line-height: 1.25; font-weight: 700; letter-spacing: -.025em; }
#es-reconnect-description { margin: 0; font-size: 14px; line-height: 1.7; color: inherit; opacity: .82; }
.es-reconnect-progress { height: 4px; margin-top: 26px; overflow: hidden; border-radius: 8px; background: color-mix(in srgb, var(--es-reconnect-accent) 15%, transparent); }
.es-reconnect-progress > span { display: block; width: 38%; height: 100%; border-radius: inherit; background: var(--es-reconnect-accent); animation: es-reconnect-progress 1.6s ease-in-out infinite; }
.es-reconnect-caption { margin-top: 12px; font-size: 12px; line-height: 1.5; color: var(--mud-palette-primary, #172638); }
.es-reconnect-caption.components-reconnect-first-attempt-visible { color: var(--es-reconnect-accent); }
.es-reconnect-actions { display: flex; flex-wrap: wrap; gap: 10px; }
[data-reconnect-state="failed"] .es-reconnect-actions,
[data-reconnect-state="paused"] .es-reconnect-actions,
[data-reconnect-state="resume-failed"] .es-reconnect-actions { margin-top: 24px; }
#components-reconnect-modal .es-reconnect-actions button { margin: 0 !important; text-transform: none; line-height: 1.5; padding: 11px 16px; min-height: 44px; border: 1px solid var(--mud-palette-primary, #172638); border-radius: var(--es-company-radius, 10px); background: var(--mud-palette-primary, #172638); color: var(--mud-palette-primary-text, #fff); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.es-reconnect-actions button span { margin-left: 8px; }
#components-reconnect-modal .es-reconnect-actions .es-reconnect-secondary { background: transparent; color: inherit; border-color: var(--mud-palette-lines-default, #dbe2eb); }
.es-reconnect-actions button:hover { filter: brightness(1.12); }
.es-reconnect-actions button:focus-visible { outline: 2px solid var(--es-reconnect-accent); outline-offset: 3px; }
.es-reconnect-actions button:disabled { opacity: .6; cursor: wait; }
@keyframes es-reconnect-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes es-reconnect-progress { 0% { transform: translateX(-100%); } 100% { transform: translateX(365%); } }
@media (max-width: 420px) { .es-reconnect-content { padding: 24px; } .es-reconnect-brand { padding: 26px 32px; min-height: 108px; } }
@media (prefers-reduced-motion: reduce) { #components-reconnect-modal[open], .es-reconnect-progress > span { animation: none; } .es-reconnect-progress > span { width: 100%; opacity: .65; } }
