/* SKM AI Chat Widget — brand-consistent floating assistant */
#skm-chat-widget {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    font-family: 'Montserrat', sans-serif;
}

/* Launcher button */
#skm-chat-toggle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #132F71, #00b6ff);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(19,47,113,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s, box-shadow .2s;
    position: relative;
}
#skm-chat-toggle:hover {
    transform: scale(1.07);
    box-shadow: 0 6px 24px rgba(19,47,113,.55);
}
#skm-chat-toggle svg { display: block; }

/* Unread badge */
#skm-chat-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f65935;
    display: none;
}
#skm-chat-badge.visible { display: block; }

/* Chat window */
#skm-chat-window {
    width: 340px;
    max-height: 490px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    overflow: hidden;
    position: absolute;
    bottom: 70px;
    right: 0;
    opacity: 0;
    transform: translateY(12px) scale(.97);
    pointer-events: none;
    transition: opacity .22s, transform .22s;
}
#skm-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
#skm-chat-header {
    background: linear-gradient(135deg, #132F71, #0a5a9e);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
#skm-chat-header .chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
#skm-chat-header .chat-title { font-size: 14px; font-weight: 700; line-height: 1.2; }
#skm-chat-header .chat-sub   { font-size: 11px; opacity: .8; }
#skm-chat-close {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0;
}
#skm-chat-close:hover { color: #fff; }

/* Messages area */
#skm-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
#skm-chat-messages::-webkit-scrollbar { width: 4px; }
#skm-chat-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.skm-msg {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.55;
    word-wrap: break-word;
}
.skm-msg.bot {
    background: #f0f4fb;
    color: #132F71;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}
.skm-msg.user {
    background: linear-gradient(135deg, #132F71, #0a5a9e);
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}
.skm-msg.typing {
    background: #f0f4fb;
    color: #888;
    align-self: flex-start;
    font-style: italic;
    font-size: 12px;
}

/* Input area */
#skm-chat-input-area {
    border-top: 1px solid #eee;
    padding: 10px 12px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
#skm-chat-input {
    flex: 1;
    border: 1px solid #dde3f0;
    border-radius: 10px;
    padding: 9px 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    resize: none;
    outline: none;
    max-height: 80px;
    overflow-y: auto;
    line-height: 1.4;
    transition: border-color .2s;
}
#skm-chat-input:focus { border-color: #132F71; }
#skm-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #132F71, #00b6ff);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform .15s;
}
#skm-chat-send:hover  { transform: scale(1.08); }
#skm-chat-send:active { transform: scale(.95); }
#skm-chat-send svg    { display: block; }

/* Powered by tag */
#skm-chat-footer {
    text-align: center;
    font-size: 10px;
    color: #aaa;
    padding: 4px 0 8px;
}

@media (max-width: 480px) {
    #skm-chat-widget { bottom: 16px; right: 16px; }
    #skm-chat-window { width: calc(100vw - 32px); right: 0; }
}
