/* ── RemoteKaki Chatbot v2 ── */
#rkcb-btn {
    position: fixed;
    width: 62px; height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0A4DA6, #00AAFF);
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(0,170,255,.5), 0 2px 8px rgba(0,0,0,.3);
    transition: transform .2s, box-shadow .2s;
    z-index: 99998;
    bottom: 24px;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
#rkcb-btn.rkcb-right { right: 24px; }
#rkcb-btn.rkcb-left  { left:  24px; }
#rkcb-btn:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(0,170,255,.65); }
#rkcb-btn img.rkcb-btn-img {
    width: 50px; height: 50px;
    border-radius: 50%;
    object-fit: contain;
    display: block;
}
#rkcb-btn .rkcb-btn-emoji {
    font-size: 1.7rem;
    line-height: 1;
    color: #fff;
}
.rkcb-dot {
    position: absolute; top: 0; right: 0;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #FF4466;
    border: 2px solid #060E20;
}

/* ── Window ── */
#rkcb-win {
    position: fixed;
    width: 370px; height: 540px;
    background: #060E20;
    border: 1px solid rgba(0,170,255,.2);
    border-radius: 18px;
    box-shadow: 0 16px 60px rgba(0,0,0,.7), 0 0 30px rgba(0,170,255,.1);
    display: flex; flex-direction: column;
    overflow: hidden;
    z-index: 99999;
    bottom: 100px;
    transition: opacity .2s, transform .2s;
    opacity: 0;
    transform: translateY(16px) scale(.97);
    pointer-events: none;
}
#rkcb-win.rkcb-right { right: 24px; }
#rkcb-win.rkcb-left  { left:  24px; }
#rkcb-win.rkcb-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.rkcb-head {
    background: linear-gradient(135deg, #0A1A38, #0A4DA6);
    padding: 14px 16px;
    display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid rgba(0,170,255,.2);
    flex-shrink: 0;
}
.rkcb-av {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(0,170,255,.15);
    border: 2px solid rgba(0,170,255,.35);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
    font-size: 1.2rem;
}
.rkcb-av img { width: 100%; height: 100%; object-fit: contain; }
.rkcb-head-info { flex: 1; }
.rkcb-head-name { font-size: .9rem; font-weight: 700; color: #fff; }
.rkcb-head-sub  {
    font-size: .72rem; color: rgba(255,255,255,.55);
    display: flex; align-items: center; gap: 5px;
}
.rkcb-online-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #00CC70;
    display: inline-block;
    animation: rkcb-pulse 2s ease-in-out infinite;
}
@keyframes rkcb-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(0,204,112,.5); }
    50%      { box-shadow: 0 0 0 5px rgba(0,204,112,0); }
}
.rkcb-close {
    background: none; border: none;
    color: rgba(255,255,255,.5); cursor: pointer;
    font-size: 1.1rem; padding: 4px 6px;
    border-radius: 6px; line-height: 1;
    transition: all .15s;
}
.rkcb-close:hover { color: #fff; background: rgba(255,255,255,.1); }

/* Messages */
.rkcb-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
.rkcb-msgs::-webkit-scrollbar { width: 4px; }
.rkcb-msgs::-webkit-scrollbar-thumb { background: rgba(0,170,255,.2); border-radius: 2px; }

.rkcb-msg { display: flex; gap: 7px; align-items: flex-end; max-width: 90%; }
.rkcb-msg.rkcb-bot  { align-self: flex-start; }
.rkcb-msg.rkcb-user { align-self: flex-end; flex-direction: row-reverse; }
.rkcb-msg-av {
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(0,170,255,.12);
    border: 1px solid rgba(0,170,255,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; flex-shrink: 0; overflow: hidden;
}
.rkcb-msg-av img { width: 100%; height: 100%; object-fit: contain; }

.rkcb-bubble {
    padding: 9px 13px;
    border-radius: 14px;
    font-size: .86rem;
    line-height: 1.65;
    max-width: 100%;
    word-break: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.rkcb-bot  .rkcb-bubble {
    background: #0F2248;
    border: 1px solid rgba(0,170,255,.12);
    color: #D0E4F8;
    border-bottom-left-radius: 4px;
}
.rkcb-user .rkcb-bubble {
    background: linear-gradient(135deg, #0A4DA6, #00AAFF);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.rkcb-bubble strong { color: #fff; font-weight: 700; }
.rkcb-bubble .rkcb-line { display: block; margin: 1px 0; }
.rkcb-bubble .rkcb-bullet { display: block; padding-left: 14px; position: relative; }
.rkcb-bubble .rkcb-bullet::before { content:'•'; position:absolute; left:2px; color: #00AAFF; font-weight: 700; }

/* Typing */
.rkcb-typing {
    display: flex; align-items: center; gap: 4px;
    padding: 10px 14px;
    background: #0F2248;
    border: 1px solid rgba(0,170,255,.12);
    border-radius: 14px; border-bottom-left-radius: 4px;
    width: fit-content;
}
.rkcb-typing span {
    width: 7px; height: 7px; border-radius: 50%;
    background: #7A8AA0;
    animation: rkcb-bounce .9s ease-in-out infinite;
}
.rkcb-typing span:nth-child(2) { animation-delay: .15s; }
.rkcb-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes rkcb-bounce {
    0%,60%,100% { transform: translateY(0); }
    30%          { transform: translateY(-6px); }
}

/* Quick replies */
.rkcb-quickies {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 6px 14px 0;
    flex-shrink: 0;
}
.rkcb-quick {
    background: rgba(0,170,255,.08);
    border: 1px solid rgba(0,170,255,.25);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: .78rem;
    color: #00AAFF;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    white-space: nowrap;
}
.rkcb-quick:hover {
    background: rgba(0,170,255,.18);
    transform: translateY(-1px);
}

/* Input */
.rkcb-input-row {
    padding: 10px 12px;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex; gap: 8px; align-items: flex-end;
    background: rgba(255,255,255,.02);
    flex-shrink: 0;
}
#rkcb-input {
    flex: 1;
    background: rgba(255,255,255,.06);
    border: 1.5px solid rgba(255,255,255,.1);
    border-radius: 10px;
    padding: 9px 12px;
    color: #fff;
    font-family: inherit;
    font-size: .86rem;
    resize: none;
    max-height: 90px;
    line-height: 1.5;
    outline: none;
    transition: border-color .2s;
}
#rkcb-input::placeholder { color: rgba(255,255,255,.22); }
#rkcb-input:focus { border-color: rgba(0,170,255,.45); }
#rkcb-send {
    width: 36px; height: 36px; flex-shrink: 0;
    background: linear-gradient(135deg, #0A4DA6, #00AAFF);
    border: none; border-radius: 10px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .18s;
    color: #fff;
}
#rkcb-send:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(0,170,255,.4); }
#rkcb-send:disabled { opacity: .45; cursor: not-allowed; transform: none; }
#rkcb-send svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 2.5; }

.rkcb-foot {
    text-align: center;
    padding: 5px 0 7px;
    font-size: .67rem;
    color: rgba(255,255,255,.2);
    flex-shrink: 0;
    font-family: inherit;
}

@media (max-width: 480px) {
    #rkcb-win { width: calc(100vw - 20px); right: 10px !important; left: 10px !important; bottom: 92px; height: 500px; }
    #rkcb-btn { bottom: 18px; }
    #rkcb-btn.rkcb-right { right: 16px; }
    #rkcb-btn.rkcb-left  { left:  16px; }
}
