.gt-chat-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    font-family: 'Poppins', sans-serif;
}

.gt-chat-button {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(217, 181, 74, .65);
    border-radius: 50%;
    cursor: pointer;
    position: relative;

    background: linear-gradient(
        135deg,
        #0C274E 0%,
        #1B5FAF 60%,
        #49A5FF 100%
    );

    color: #ffffff;
    font-size: 26px;

    box-shadow:
        0 12px 30px rgba(12, 39, 78, .35),
        0 0 0 4px rgba(217, 181, 74, .12);

    transition:
        transform .25s ease,
        background .25s ease,
        box-shadow .25s ease;
}

.gt-chat-button:hover{
    transform: translateY(-4px) scale(1.05);

    background: linear-gradient(
        135deg,
        #154A87,
        #2D86E5,
        #73CBFF
    );

    box-shadow:
        0 18px 40px rgba(12,39,78,.45),
        0 0 0 6px rgba(217,181,74,.18);
}

.gt-chat-pulse{
    position:absolute;
    top:5px;
    right:5px;
    width:14px;
    height:14px;

    background:#F3D97E;

    border:2px solid #fff;
    border-radius:50%;

    box-shadow:0 0 0 5px rgba(243,217,126,.18);
}

.gt-chat-panel {
    display: none;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .28);
    position: absolute;
    right: 0;
    bottom: 84px;
}

.gt-chat-widget.open .gt-chat-panel {
    display: flex;
    flex-direction: column;
}

.gt-chat-header {
    background: linear-gradient(135deg, #0C274E, #1B5FAF, #49A5FF);
    color: #fff;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gt-chat-header strong {
    display: block;
    font-size: 17px;
}

.gt-chat-header small {
    display: block;
    opacity: .85;
    font-size: 12px;
}

.gt-chat-header button {
    background: transparent;
    color: #fff;
    border: 0;
    font-size: 18px;
}

.gt-chat-start {
    padding: 18px;
}

.gt-chat-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.gt-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: #f7f5ef;
}

.gt-message {
    max-width: 82%;
    margin-bottom: 12px;
    padding: 11px 13px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
}

.gt-message.visitor{
    background:linear-gradient(
        135deg,
        #0C274E,
        #1B5FAF
    );

    color:#fff;
}

.gt-message.admin {
    margin-right: auto;
    background: #fff;
    color: #222;
    border-bottom-left-radius: 5px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}

.gt-chat-time {
    display: block;
    font-size: 10px;
    opacity: .7;
    margin-top: 5px;
}

.gt-chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #eee;
    background: #fff;
}

.gt-chat-input-area .form-control {
    border-radius: 30px;
}

.gt-chat-input-area .btn {
    width: 44px;
    border-radius: 50%;
}

.admin-chat-shell {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    min-height: 650px;
}

.admin-chat-list,
.admin-chat-window {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
    overflow: hidden;
}

.admin-chat-list-header,
.admin-chat-window-header {
    padding: 18px;
    background: linear-gradient(135deg, #0C274E, #1B5FAF);
    color: #fff;
}

.admin-session-item {
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #eee;
    padding: 14px 16px;
    background: #fff;
}

.admin-session-item:hover,
.admin-session-item.active {
    background: #F1F9FF;
}

.admin-session-item strong {
    display: block;
}

.admin-session-item small {
    display: block;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-chat-messages {
    height: 470px;
    overflow-y: auto;
    background: #f7f5ef;
    padding: 18px;
}

.admin-chat-reply {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid #eee;
}

@media (max-width: 768px) {
    .gt-chat-widget {
        right: 16px;
        bottom: 16px;
    }

    .gt-chat-panel {
        width: calc(100vw - 32px);
        height: 520px;
    }

    .admin-chat-shell {
        grid-template-columns: 1fr;
    }
}

.gt-chat-system-message {
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
    border-radius: 14px;
    padding: 12px;
    margin: 10px 0;
    font-size: 13px;
    text-align: center;
}

/* Messenger-style admin live chat */
.admin-chat-shell {
    grid-template-columns: 360px minmax(0, 1fr);
    min-height: 680px;
    border: 1px solid #e8ece8;
    border-radius: 22px;
    overflow: hidden;
    gap: 0;
    background: #fff;
    box-shadow: 0 18px 50px rgba(12, 39, 78, .12);
}
.admin-chat-list,
.admin-chat-window {
    border-radius: 0;
    box-shadow: none;
}
.admin-chat-list { border-right: 1px solid #e8ece8; min-width: 0; }
.admin-chat-list-header,
.admin-chat-window-header {
    background: linear-gradient(135deg, #0C274E, #1B5FAF, #49A5FF);
}
.admin-chat-list-header { padding: 20px; }
.admin-chat-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 14px;
}
.admin-chat-search-wrap input {
    width: 100%; border: 0; outline: 0; background: transparent; color: #fff; font-size: 13px;
}
.admin-chat-search-wrap input::placeholder { color: rgba(255,255,255,.72); }
.admin-live-dot { width: 11px; height: 11px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 5px rgba(74,222,128,.18); }
.admin-chat-sessions { height: 590px; overflow-y: auto; }
.admin-session-item { display: flex; gap: 12px; padding: 15px; transition: .18s ease; }
.admin-session-item:hover { transform: translateX(2px); }
.admin-session-item.active { background: #EAF7FF; box-shadow: inset 4px 0 #1B5FAF; }
.admin-session-avatar,
.admin-active-avatar {
    flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; font-weight: 700;
    background: linear-gradient(135deg, #d9aa35, #f0cc69); color: #0C274E;
}
.admin-session-avatar { width: 43px; height: 43px; }
.admin-active-avatar { width: 46px; height: 46px; }
.admin-session-content { min-width: 0; flex: 1; }
.admin-session-preview,
.admin-session-time { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-session-preview { color: #66736a; margin-top: 2px; }
.admin-session-time { color: #9aa39d; font-size: 10px; margin-top: 4px; }
.admin-chat-window { display: flex; flex-direction: column; min-width: 0; }
.admin-chat-window-header { min-height: 86px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; }
.admin-visitor-contact { font-size: 11px; line-height: 1.55; opacity: .82; }
.admin-chat-messages { height: auto; flex: 1; min-height: 500px; background: linear-gradient(#F6FAFF, #EEF8FF); padding: 24px; }
.admin-chat-empty { height: 100%; min-height: 300px; display: grid; place-content: center; text-align: center; color: #8b978f; }
.admin-chat-empty i { font-size: 48px; margin-bottom: 10px; }
.admin-chat-reply { padding: 16px 18px; background: #fff; }
.admin-chat-reply .form-control { border-radius: 24px; padding: 11px 17px; }
.admin-chat-reply .btn { border-radius: 24px; padding: 10px 20px; }
.admin-chat-messages .gt-message.admin { margin-left: auto; margin-right: 0; background: linear-gradient(135deg, #0C274E, #1B5FAF); color: #fff; border-bottom-right-radius: 5px; border-bottom-left-radius: 16px; }
.admin-chat-messages .gt-message.visitor { margin-left: 0; margin-right: auto; background: #fff; color: #222; border-bottom-left-radius: 5px; border-bottom-right-radius: 16px; box-shadow: 0 4px 14px rgba(0,0,0,.07); }
@media (max-width: 900px) {
    .admin-chat-shell { grid-template-columns: 310px minmax(0,1fr); }
}
@media (max-width: 768px) {
    .admin-chat-shell { grid-template-columns: 1fr; }
    .admin-chat-list { border-right: 0; border-bottom: 1px solid #e8ece8; }
    .admin-chat-sessions { height: 280px; }
    .admin-chat-messages { min-height: 430px; }
    .admin-visitor-contact { display: none !important; }
    .admin-chat-reply .btn span { display: none; }
}


/* =========================================================
   FLOATING LIVE CHAT — MOBILE, SAFE AREA & LUXURY BLUE FIX
========================================================= */
.gt-chat-widget{
    --gt-chat-navy:#0C274E;
    --gt-chat-royal:#1B5FAF;
    --gt-chat-sky:#49A5FF;
    --gt-chat-gold:#D9B54A;
    right:max(20px, env(safe-area-inset-right));
    bottom:max(24px, calc(env(safe-area-inset-bottom) + 18px));
    isolation:isolate;
}

.gt-chat-button{
    width:58px;
    height:58px;
    display:grid;
    place-items:center;
    cursor:pointer;
    background:linear-gradient(135deg,var(--gt-chat-navy),var(--gt-chat-royal) 65%,var(--gt-chat-sky));
    border:1px solid rgba(255,255,255,.34);
    box-shadow:0 14px 32px rgba(12,39,78,.30);
    transition:transform .2s ease, box-shadow .2s ease;
}

.gt-chat-button:hover,
.gt-chat-button:focus-visible{
    transform:translateY(-3px);
    box-shadow:0 18px 38px rgba(12,39,78,.36);
}

.gt-chat-widget.open .gt-chat-button{
    transform:scale(.94);
}

.gt-chat-pulse{
    top:4px;
    right:4px;
    background:var(--gt-chat-gold);
    box-shadow:0 0 0 4px rgba(217,181,74,.18);
}

.gt-chat-panel{
    width:min(370px, calc(100vw - 32px));
    height:min(540px, calc(100dvh - 125px));
    max-height:min(540px, calc(var(--gt-chat-viewport-height, 100dvh) - 125px));
    right:0;
    bottom:74px;
    border:1px solid rgba(216,236,255,.9);
    border-radius:22px;
    box-shadow:0 24px 60px rgba(12,39,78,.28);
}

.gt-chat-header{
    background:linear-gradient(
        135deg,
        #0C274E,
        #1B5FAF,
        #49A5FF
    );
}

.gt-chat-header button{
    width:38px;
    height:38px;
    display:grid;
    place-items:center;
    border-radius:50%;
    transition:background .2s ease;
}

.gt-chat-header button:hover,
.gt-chat-header button:focus-visible{
    background:rgba(255,255,255,.16);
}

.gt-chat-messages{
    background:linear-gradient(180deg,#F4FAFF,#FFFFFF);
    overscroll-behavior:contain;
}

.gt-message.visitor{
    background:linear-gradient(135deg,var(--gt-chat-royal),var(--gt-chat-sky));
}

.gt-chat-start .btn-success,
.gt-chat-input-area .btn-success,
.gt-chat-system-message + .btn-success{
    background:linear-gradient(135deg,#F3D97E,var(--gt-chat-gold));
    border:none;
    color:var(--gt-chat-navy);
    font-weight:800;
}

.gt-chat-input-area .form-control,
.gt-chat-start .form-control{
    border-color:#D8ECFF;
}

.gt-chat-input-area .form-control:focus,
.gt-chat-start .form-control:focus{
    border-color:var(--gt-chat-sky);
    box-shadow:0 0 0 .2rem rgba(73,165,255,.16);
}

@media (max-width:768px){
    .gt-chat-widget{
        right:max(14px, env(safe-area-inset-right));
        bottom:max(82px, calc(env(safe-area-inset-bottom) + 72px));
        z-index:10050;
    }

    .gt-chat-button{
        width:54px;
        height:54px;
        font-size:23px;
    }

    .gt-chat-panel{
        position:fixed;
        left:12px;
        right:12px;
        bottom:max(148px, calc(env(safe-area-inset-bottom) + 136px));
        width:auto;
        height:min(520px, calc(100dvh - 190px));
        max-height:min(520px, calc(var(--gt-chat-viewport-height, 100dvh) - 190px));
        border-radius:20px;
    }

    .gt-chat-header{
        padding:14px 16px;
    }

    .gt-chat-start{
        padding:15px;
        overflow-y:auto;
    }

    .gt-chat-messages{
        padding:14px;
    }

    .gt-chat-input-area{
        padding:10px;
        padding-bottom:max(10px, env(safe-area-inset-bottom));
    }
}

@media (max-width:380px), (max-height:650px){
    .gt-chat-widget{
        bottom:max(72px, calc(env(safe-area-inset-bottom) + 62px));
    }

    .gt-chat-panel{
        top:12px;
        bottom:auto;
        height:calc(var(--gt-chat-viewport-height, 100dvh) - 24px);
        max-height:calc(var(--gt-chat-viewport-height, 100dvh) - 24px);
    }
}

@media (prefers-reduced-motion:reduce){
    .gt-chat-button,
    .gt-chat-panel,
    .admin-session-item{
        transition:none!important;
        animation:none!important;
    }
}

/* =========================================================
   FINAL FLOATING CHAT COLOR OVERRIDE
   Navy + Royal Blue + Sky Blue + Champagne Gold
========================================================= */
.gt-chat-button{
    width:58px;
    height:58px;
    border:2px solid rgba(217,181,74,.72);
    border-radius:50%;
    background:linear-gradient(
        135deg,
        #0C274E 0%,
        #1B5FAF 58%,
        #49A5FF 100%
    );
    color:#fff;
    box-shadow:
        0 14px 32px rgba(12,39,78,.34),
        0 0 0 4px rgba(217,181,74,.12);
}

.gt-chat-button:hover,
.gt-chat-button:focus-visible{
    background:linear-gradient(
        135deg,
        #154A87 0%,
        #2D86E5 58%,
        #73CBFF 100%
    );
    box-shadow:
        0 18px 40px rgba(12,39,78,.42),
        0 0 0 6px rgba(217,181,74,.18);
}

.gt-chat-pulse{
    background:#F3D97E;
    border:2px solid #fff;
    box-shadow:0 0 0 4px rgba(243,217,126,.18);
}

.gt-chat-header{
    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(243,217,126,.18),
            transparent 32%
        ),
        linear-gradient(
            135deg,
            #0C274E,
            #1B5FAF,
            #49A5FF
        );
}

.gt-message.visitor{
    margin-left:auto;
    background:linear-gradient(
        135deg,
        #0C274E,
        #1B5FAF,
        #49A5FF
    );
    color:#fff;
    border-bottom-right-radius:5px;
}

.gt-chat-start .btn-success,
.gt-chat-input-area .btn-success,
.gt-chat-system-message + .btn-success{
    background:linear-gradient(
        135deg,
        #F3D97E,
        #D9B54A
    );
    border:none;
    color:#0C274E;
    font-weight:800;
}

.gt-chat-start .btn-success:hover,
.gt-chat-input-area .btn-success:hover,
.gt-chat-system-message + .btn-success:hover{
    background:linear-gradient(
        135deg,
        #F8E8AC,
        #E6C55E
    );
    color:#0C274E;
}
