/* Shared by reconnect and error screens. Explicit light colors protect these
   recovery controls from the active DevExpress/Bootstrap theme. */
#kb-reconnect-dialog {
    color-scheme: light;
    box-sizing: border-box;
    width: min(440px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 24px;
    outline: none;
    background: #fbfcf8 !important;
    opacity: 1 !important;
}

#kb-reconnect-dialog:not([open]) { display: none !important; }

#kb-reconnect-dialog::backdrop {
    background: rgb(33 51 43 / 20%);
    backdrop-filter: blur(5px);
}

.kb-system-page {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100svh;
    max-height: 100%;
    overflow: auto;
    padding: 32px 16px;
    background: radial-gradient(ellipse at 50% 30%, #e5f0e4, transparent 65%), #f5f7f2 !important;
    color-scheme: light;
}

.kb-system-page .kb-system-card { width: min(460px, 100%); }

:is(#kb-reconnect-dialog, .kb-system-page) .kb-system-card {
    box-sizing: border-box;
    padding: 36px 32px 32px;
    border: 1px solid #e0e8dc;
    border-radius: 24px;
    background: #fbfcf8 !important;
    color: #243c32 !important;
    box-shadow: 0 24px 70px -30px rgb(36 60 50 / 22%);
    font: 400 14px/1.7 "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    text-align: center;
    text-transform: none;
    -webkit-font-smoothing: antialiased;
    color-scheme: light;
}

:is(#kb-reconnect-dialog, .kb-system-page) .kb-system-card [hidden] { display: none !important; }

:is(#kb-reconnect-dialog, .kb-system-page) .kb-system-logo {
    display: block;
    width: 132px;
    height: auto;
    margin: 0 auto 30px;
    mix-blend-mode: multiply;
}

:is(#kb-reconnect-dialog, .kb-system-page) :is(.kb-system-indicator, .kb-system-symbol) {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    border: 1px solid #dce9d9;
    border-radius: 22px;
    background: #edf4e9 !important;
    color: #3e7955 !important;
}

#kb-reconnect-dialog .kb-system-indicator > span {
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    border: 2px solid #d2e2ce;
    border-top-color: #44815a;
    border-radius: 50%;
    animation: kb-reconnect-spin 1.1s linear infinite;
}

#kb-reconnect-dialog .kb-system-card--refresh .kb-system-indicator > span {
    animation: none;
    border-color: #44815a;
    border-right-color: transparent;
    transform: rotate(-35deg);
}

.kb-system-page .kb-system-symbol svg { width: 28px; height: 28px; }

:is(#kb-reconnect-dialog, .kb-system-page) .kb-system-eyebrow {
    margin: 0 0 10px;
    color: #4b7556 !important;
    font: 700 10px/1.6 "Plus Jakarta Sans", "Segoe UI", sans-serif !important;
    letter-spacing: .13em;
}

:is(#kb-reconnect-dialog, .kb-system-page) :is(h1, h2) {
    margin: 0 0 12px;
    color: #243c32 !important;
    font: 600 25px/1.25 "Plus Jakarta Sans", "Segoe UI", sans-serif !important;
    letter-spacing: -.045em;
    text-transform: none;
    text-wrap: balance;
}

:is(#kb-reconnect-dialog, .kb-system-page) p:not(.kb-system-eyebrow) {
    margin: 0;
    color: #596b60 !important;
    font: 400 13px/1.85 "Plus Jakarta Sans", "Segoe UI", sans-serif !important;
    letter-spacing: normal;
    text-transform: none;
}

:is(#kb-reconnect-dialog, .kb-system-page) .kb-system-actions {
    display: grid;
    justify-items: stretch;
    gap: 14px;
    margin-top: 26px;
}

:is(#kb-reconnect-dialog, .kb-system-page) .kb-system-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-sizing: border-box;
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 12px 18px;
    appearance: none;
    border: 1px solid #294e3b !important;
    border-radius: 11px;
    background: #294e3b !important;
    color: #fff !important;
    box-shadow: none;
    font: 600 13px/1.6 "Plus Jakarta Sans", "Segoe UI", sans-serif !important;
    text-transform: none !important;
    letter-spacing: normal;
    cursor: pointer;
}

:is(#kb-reconnect-dialog, .kb-system-page) .kb-system-button:hover { background: #203f2f !important; }

.kb-system-page .kb-system-link {
    color: #3d654c !important;
    font: 600 12px/1.6 "Plus Jakarta Sans", "Segoe UI", sans-serif;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.kb-system-page .kb-system-details {
    margin-top: 24px;
    color: #596b60 !important;
    font-size: 12px;
    text-align: left;
    overflow-wrap: anywhere;
}

.kb-system-page .kb-system-details summary { padding: 8px 0; cursor: pointer; }
.kb-system-page .kb-system-details p { padding-top: 8px; }
.kb-system-page p.kb-system-footer { margin-top: 24px; padding-top: 20px; border-top: 1px solid #e4eadd; font-size: 11px !important; }

:is(#kb-reconnect-dialog, .kb-system-page) :is(button, a, summary):focus-visible { outline: 3px solid #8aae8e; outline-offset: 4px; }

@keyframes kb-reconnect-spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
    :is(#kb-reconnect-dialog, .kb-system-page) .kb-system-card { padding: 30px 24px; }
}

@media (prefers-reduced-motion: reduce) {
    #kb-reconnect-dialog .kb-system-indicator > span { animation: none; }
    #kb-reconnect-dialog::backdrop { backdrop-filter: none; }
}
