/* ── Claude Chat Widget ── */
#ccs-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
}

/* Botón flotante */
#ccs-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2563eb;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37,99,235,0.4);
    transition: transform 0.2s, background 0.2s;
    margin-left: auto;
}
#ccs-toggle:hover { background: #1d4ed8; transform: scale(1.07); }
#ccs-toggle svg  { width: 26px; height: 26px; fill: #fff; }

/* Ventana del chat */
#ccs-box {
    display: none;
    flex-direction: column;
    width: 360px;
    height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    overflow: hidden;
    margin-bottom: 12px;
}
#ccs-box.open { display: flex; }

/* Header */
#ccs-header {
    background: #2563eb;
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 15px;
}
#ccs-header-left { display: flex; align-items: center; gap: 10px; }
#ccs-avatar {
    width: 34px; height: 34px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
}
#ccs-close {
    background: none; border: none; color: #fff;
    cursor: pointer; font-size: 20px; line-height: 1; padding: 2px 6px;
    border-radius: 6px;
}
#ccs-close:hover { background: rgba(255,255,255,0.2); }

/* Mensajes */
#ccs-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
}
#ccs-messages::-webkit-scrollbar { width: 4px; }
#ccs-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.ccs-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    line-height: 1.5;
    word-break: break-word;
    animation: ccsFadeIn 0.2s ease;
}
@keyframes ccsFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

.ccs-msg.user {
    background: #2563eb;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.ccs-msg.assistant {
    background: #fff;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Typing indicator */
.ccs-typing {
    display: flex; gap: 5px; padding: 12px 14px;
    background: #fff; border-radius: 14px; border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.ccs-typing span {
    width: 7px; height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    animation: ccsTyping 1.2s infinite;
}
.ccs-typing span:nth-child(2) { animation-delay: 0.2s; }
.ccs-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ccsTyping {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Input */
#ccs-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}
#ccs-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 9px 13px;
    font-size: 14px;
    outline: none;
    resize: none;
    height: 40px;
    max-height: 100px;
    overflow-y: auto;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color 0.2s;
}
#ccs-input:focus { border-color: #2563eb; }

#ccs-send {
    width: 40px; height: 40px;
    background: #2563eb;
    border: none; border-radius: 10px;
    cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
#ccs-send:hover { background: #1d4ed8; }
#ccs-send:disabled { background: #93c5fd; cursor: not-allowed; }
#ccs-send svg { width: 18px; height: 18px; fill: #fff; }

/* Mobile */
@media (max-width: 480px) {
    #ccs-widget { bottom: 16px; right: 16px; left: 16px; }
    #ccs-box { width: 100%; height: 480px; }
    #ccs-toggle { margin-left: auto; }
}
