html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    background-color: #0da7cd;
}

.container-ktech-chat {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background-color: #ffffff;
    overflow: hidden;
    position: fixed;
    top: var(--app-offset-top, 0px);
    bottom: var(--app-keyboard-inset, 0px);
    left: 0;
    right: 0;
    z-index: 1;
}

.ktech-chat-background {
    position: absolute;
    top: var(--chat-bg-top, 72px);
    left: 0;
    right: 0;
    bottom: var(--chat-bg-bottom, 72px);
    min-height: var(--chat-bg-height, 0px);
    background-image: url('../img/chat-background-services.webp');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center top;
    pointer-events: none;
    z-index: 0;
}

.ktech-chat-header {
    background: linear-gradient(135deg, #0a9fc3 0%, #11b7dc 100%);
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 10px 10px 0 0;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.ktech-profile-trigger {
    border: 0;
    padding: 0;
    background: transparent;
    border-radius: 999px;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.ktech-profile-trigger:hover,
.ktech-profile-trigger.is-expanded {
    transform: scale(1.08);
    box-shadow: 0 10px 24px rgba(4, 61, 77, 0.22);
}

.ktech-profile-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.ktech-chat-header-info {
    color: #fff;
}

.ktech-chat-header-info h4 {
    margin: 0;
    font-size: 18px;
}

.ktech-last-seen {
    font-size: 12px;
}

.ktech-service-panel-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 28, 38, 0.32);
    opacity: 0;
    transition: opacity 0.22s ease;
    z-index: 3;
}

.ktech-service-panel-backdrop.is-open {
    opacity: 1;
}

.ktech-service-panel {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 4;
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: none;
}

.ktech-service-panel.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ktech-service-panel-card {
    border-radius: 24px;
    padding: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 251, 255, 0.98)),
        #ffffff;
    box-shadow: 0 24px 60px rgba(5, 42, 56, 0.22);
    color: #17324d;
}

.ktech-service-panel-top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: start;
}

.ktech-service-panel-avatar {
    width: 78px;
    height: 78px;
    padding: 4px;
    border-radius: 999px;
    background: linear-gradient(135deg, #11b7dc, #0a8db2);
}

.ktech-service-panel-img {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}

.ktech-service-panel-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    margin-bottom: 8px;
    background: rgba(17, 183, 220, 0.12);
    color: #0a8db2;
    font-size: 12px;
    font-weight: 700;
}

.ktech-service-panel-headline h3 {
    margin: 0 0 6px;
    font-size: 20px;
    color: #14314b;
}

.ktech-service-panel-headline p {
    margin: 0;
    color: #4b647c;
    line-height: 1.5;
    font-size: 14px;
}

.ktech-service-panel-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(9, 159, 195, 0.12);
    color: #0a8db2;
    font-size: 22px;
    line-height: 1;
}

.ktech-service-panel-content {
    margin-top: 16px;
    max-height: min(62vh, 560px);
    overflow-y: auto;
    padding-right: 4px;
}

.ktech-service-highlight {
    display: grid;
    gap: 6px;
    padding: 14px;
    margin-bottom: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(17, 183, 220, 0.12), rgba(255, 159, 28, 0.10));
}

.ktech-service-highlight strong,
.ktech-service-item strong {
    color: #15334d;
}

.ktech-service-highlight span,
.ktech-service-item span {
    color: #56718a;
    font-size: 13px;
    line-height: 1.45;
}

.ktech-service-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ktech-service-item {
    display: grid;
    gap: 6px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(10, 141, 178, 0.10);
    background: rgba(255, 255, 255, 0.82);
}

.btn-option {
    color: #fff;
    background-color: #0ea6ca;
}

.btn-option:hover {
    color: #fff;
    background-color: #0b93b3;
}

.ktech-chat-body {
    flex-grow: 1;
    min-height: 0;
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: transparent;
    padding: 15px;
    padding-bottom: 15px;
    scroll-padding-bottom: 140px;
    z-index: 1;
}

.ktech-chat-footer {
    flex-shrink: 0;
    background-color: #fff;
    padding: 10px;
    padding-bottom: 10px;
    border-radius: 0 0 10px 10px;
    z-index: 2;
}

.msg-bot {
    background-color: #fff;
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 10px;
    max-width: 80%;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.msg-user {
    background-color: #dcf8c6;
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 10px;
    max-width: 80%;
    margin-left: auto;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    text-align: right;
}

.btn-send {
    background-color: #25d366;
    border-color: #25d366;
    color: #fff;
    display: block;
    margin: 0 auto;
    text-align: center;
}

.btn-send:hover {
    background-color: #1da851;
    border-color: #1da851;
}

@media (min-width: 768px) {
    .container-ktech-chat {
        width: 550px;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        border: 1px solid #ddd;
        border-radius: 10px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        background-color: #f8f9fa;
    }
}

.mb-2 {
    display: flex;
    flex-direction: column;
}

.ktech-chat-body::-webkit-scrollbar {
    width: 8px;
}

.ktech-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.ktech-chat-body::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 2px solid transparent;
}

.ktech-chat-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}

.qr-img-container {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 9999;
    background-color: #ffffff5e;
    border-radius: 10px 10px 0 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
}

.font-img,
.web {
    font-size: 10px;
    padding-top: 3px;
    padding-bottom: 3px;
}

.qr-img {
    max-width: 100px;
    height: auto;
    border-radius: 5px;
}

@media (max-width: 767px) {
    .qr-img-container {
        display: none;
    }

    .ktech-chat-header,
    .ktech-chat-footer {
        border-radius: 0;
    }

    .ktech-service-panel {
        top: 10px;
        left: 10px;
        right: 10px;
    }

    .ktech-service-panel-top {
        grid-template-columns: 1fr auto;
    }

    .ktech-service-panel-avatar {
        grid-column: 1 / -1;
        width: 72px;
        height: 72px;
    }

    .ktech-service-grid {
        grid-template-columns: 1fr;
    }
}
