/* CoffeeIdeas Support Bot v2.0.1 */
#cisb-w {
    position: fixed !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    bottom: auto !important;
    z-index: 999999 !important;
    font-family: Arial, sans-serif !important;
}

/* Tab button */
#cisb-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 52px !important;
    background: #c8860a !important;
    border: none !important;
    border-radius: 0 8px 8px 0 !important;
    cursor: pointer !important;
    box-shadow: 3px 2px 10px rgba(0,0,0,0.35) !important;
    gap: 2px !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
}
.cisb-ic { font-size: 18px; color: #fff; display: block; line-height: 1; }
.cisb-ix { font-size: 14px; color: #fff; display: none; line-height: 1; }
.cisb-lbl { font-size: 7px; color: #fff; font-weight: 700; letter-spacing: 1px; }
#cisb-w.open .cisb-ic { display: none !important; }
#cisb-w.open .cisb-ix { display: block !important; }

/* Chat box — opens to the RIGHT, centered vertically */
#cisb-box {
    position: absolute !important;
    left: 44px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    bottom: auto !important;
    width: 300px !important;
    max-width: calc(100vw - 56px) !important;
    background: #1a0a00 !important;
    border-radius: 12px !important;
    box-shadow: 6px 4px 24px rgba(0,0,0,0.5) !important;
    overflow: hidden !important;
    flex-direction: column !important;
    max-height: 80vh !important;
}
#cisb-box[style*="flex"],
#cisb-box[style*="block"] {
    display: flex !important;
}

/* Header */
#cisb-head {
    background: #2d1200;
    padding: 11px 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(200,134,10,0.3);
    flex-shrink: 0;
}
#cisb-av {
    width: 34px; height: 34px; background: #c8860a;
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 16px; flex-shrink: 0;
}
#cisb-nm { color: #fff; font-weight: 700; font-size: 13px; }
#cisb-st { color: #c8860a; font-size: 10px; display: flex; align-items: center; gap: 4px; margin-top: 2px; }
#cisb-dot { width: 6px; height: 6px; background: #27ae60; border-radius: 50%; display: inline-block; }
#cisb-x { background: none; border: none; color: #888; cursor: pointer; font-size: 15px; padding: 4px; }
#cisb-x:hover { color: #fff; }

/* Messages */
#cisb-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 10px 9px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-height: 100px;
}
#cisb-msgs::-webkit-scrollbar { width: 3px; }
#cisb-msgs::-webkit-scrollbar-thumb { background: rgba(200,134,10,.3); border-radius: 2px; }

/* Bubbles */
.cb {
    max-width: 90%; padding: 8px 11px; border-radius: 10px;
    font-size: 12.5px; line-height: 1.5; word-break: break-word;
}
.cb-bot {
    background: #2d1200; color: #f0d8b0;
    border: 1px solid rgba(200,134,10,.2);
    border-bottom-left-radius: 3px; align-self: flex-start;
}
.cb-user {
    background: #c8860a; color: #fff;
    border-bottom-right-radius: 3px; align-self: flex-end;
}
.cb b { color: #c8860a; }
.cb-user b { color: #fff0cc; }

/* 2x2 option grid */
.co {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 5px !important;
    width: 100% !important;
    margin-top: 5px !important;
}
.co-btn {
    background: #2d1200 !important;
    border: 1px solid rgba(200,134,10,.4) !important;
    color: #f0d8b0 !important;
    padding: 9px 5px !important;
    border-radius: 7px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-align: center !important;
    line-height: 1.3 !important;
    min-height: 44px !important;
    font-family: inherit !important;
    transition: background .15s !important;
}
.co-btn:hover, .co-btn:active {
    background: #c8860a !important;
    color: #fff !important;
    border-color: #c8860a !important;
}

/* Typing */
.ctyp { align-self: flex-start; }
.ctyp-d { display: flex; gap: 4px; padding: 8px 11px; background: #2d1200; border-radius: 10px; border: 1px solid rgba(200,134,10,.2); }
.ctyp-d span { width: 5px; height: 5px; background: #c8860a; border-radius: 50%; animation: ctd 1.2s infinite; }
.ctyp-d span:nth-child(2) { animation-delay: .2s; }
.ctyp-d span:nth-child(3) { animation-delay: .4s; }
@keyframes ctd { 0%,80%,100%{transform:scale(.8);opacity:.5} 40%{transform:scale(1.1);opacity:1} }

/* Ticket form */
#cisb-form {
    padding: 10px 11px;
    background: #2d1200;
    border-top: 1px solid rgba(200,134,10,.2);
    gap: 6px;
    overflow-y: auto;
    max-height: 260px;
    flex-shrink: 0;
    flex-direction: column;
}
#cisb-form[style*="flex"] { display: flex !important; }
.cisb-ft { font-weight: 700; color: #c8860a; font-size: 12px; margin-bottom: 2px; }
.cisb-fi {
    background: #1a0a00 !important; border: 1px solid rgba(200,134,10,.3) !important;
    color: #f0d8b0 !important; padding: 7px 9px !important; border-radius: 5px !important;
    font-size: 12px !important; width: 100% !important; box-sizing: border-box !important;
    font-family: inherit !important; outline: none !important;
}
.cisb-fi:focus { border-color: #c8860a !important; }
textarea.cisb-fi { resize: vertical; min-height: 55px; }
select.cisb-fi { -webkit-appearance: none; appearance: none; }
.cisb-fb-pri { background: #c8860a; color: #fff; border: none; padding: 7px 14px; border-radius: 5px; font-size: 12px; font-weight: 700; cursor: pointer; }
.cisb-fb-sec { background: transparent; color: #888; border: 1px solid #555; padding: 7px 12px; border-radius: 5px; font-size: 12px; cursor: pointer; }

/* Input bar */
#cisb-bar {
    display: flex; gap: 5px; padding: 8px 9px;
    background: #2d1200; border-top: 1px solid rgba(200,134,10,.2); flex-shrink: 0;
}
#cisb-in {
    flex: 1; background: #1a0a00; border: 1px solid rgba(200,134,10,.3);
    color: #f0d8b0; padding: 7px 9px; border-radius: 6px;
    font-size: 12px; outline: none; font-family: inherit;
}
#cisb-in:focus { border-color: #c8860a; }
#cisb-in::placeholder { color: #777; }
#cisb-go {
    background: #c8860a; border: none; width: 32px; height: 32px;
    border-radius: 6px; cursor: pointer; color: #fff; font-size: 14px; flex-shrink: 0;
}

@media(max-width:380px) {
    #cisb-box { width: calc(100vw - 56px) !important; }
}
