:root[data-kt-staff-chat-active] :is(.kb-nut, #kb-khung, .kb-chao),
.kt-staff-chat[hidden], .kt-staff-chat [hidden] {
    display: none !important;
}

.kt-staff-chat, .kt-staff-chat-document body {
    color: #142b46;
    font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.kt-staff-chat__launcher {
    position: fixed;
    z-index: 45;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(72px + env(safe-area-inset-bottom));
    min-height: 44px;
    padding: .55rem 1.1rem;
    border: 1px solid #245b95;
    border-radius: 999px;
    background: #143e69;
    box-shadow: 0 4px 16px rgb(11 28 49 / 22%);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.kt-staff-chat__launcher:hover { background: #0e3158; }

.kt-staff-chat__panel {
    box-sizing: border-box;
    position: fixed;
    z-index: 72;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(18px + env(safe-area-inset-bottom));
    width: min(28rem, calc(100vw - 32px));
    height: min(37rem, calc(100vh - 36px));
    height: min(37rem, calc(100dvh - 36px - env(safe-area-inset-bottom)));
    overflow: hidden;
    border: 1px solid #c5d6e6;
    border-radius: 14px;
    box-shadow: 0 12px 42px rgb(7 23 43 / 26%);
    background: #fff;
}

.kt-staff-chat__bar {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .35rem .65rem .35rem .9rem;
    color: #fff;
    background: #102c4c;
}

.kt-staff-chat__bar h2 { margin: 0 auto 0 0; color: inherit; font: 700 1rem/1.3 system-ui, sans-serif; }
.kt-staff-chat__bar a { color: #e2efff; text-decoration: underline; }
.kt-staff-chat__bar button {
    flex: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    font: 1.55rem/1 system-ui, sans-serif;
    cursor: pointer;
}
.kt-staff-chat__bar button:hover { background: #25496f; }
.kt-staff-chat :is(button, a):focus-visible { outline: 3px solid #61bbff; outline-offset: 2px; }

.kt-staff-chat__body { min-height: 0; background: #fff; }
.kt-staff-chat__frame { display: block; width: 100%; height: 100%; border: 0; }

.kt-staff-chat-document, .kt-staff-chat-document body { height: 100%; margin: 0; background: #fff; }
.kt-staff-chat-document .kchat { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; }
.kt-staff-chat-document .kchat-layout { height: 100%; border: 0; border-radius: 0; }
.kt-staff-chat__sign-in { padding: .9rem 1.1rem; }
.kt-staff-chat__sign-in a { color: #174c82; }

@media (max-width: 560px) {
    .kt-staff-chat__launcher { right: max(10px, env(safe-area-inset-right)); }
    .kt-staff-chat__panel { right: max(8px, env(safe-area-inset-right)); width: calc(100vw - 16px); }
}

@media print {
    .kt-staff-chat { display: none !important; }
}
