/* Humano Chat - scoped to avoid theme clashes */
.humano-chat-wrap {
    --humano-chat-bg: #fff;
    --humano-chat-border: #dcdcde;
    --humano-chat-text: #1d2327;
    --humano-chat-accent: #2271b1;
    --humano-chat-accent-hover: #135e96;
    --humano-chat-msg-user-bg: #2271b1;
    --humano-chat-msg-user-color: #fff;
    --humano-chat-msg-bot-bg: #f0f0f1;
    --humano-chat-error: #d63638;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, sans-serif;
    font-size: 16px;
    color: var(--humano-chat-text);
    background: var(--humano-chat-bg);
    border: 1px solid var(--humano-chat-border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 480px;
}

.humano-chat-wrap *,
.humano-chat-wrap *::before,
.humano-chat-wrap *::after {
    box-sizing: border-box;
}

.humano-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.humano-chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.humano-chat-msg-user {
    align-self: flex-end;
    background: var(--humano-chat-msg-user-bg);
    color: var(--humano-chat-msg-user-color);
}

.humano-chat-msg-bot {
    align-self: flex-start;
    background: var(--humano-chat-msg-bot-bg);
    white-space: normal;
}

.humano-chat-msg-bot a {
    color: var(--humano-chat-accent);
    text-decoration: underline;
}

.humano-chat-msg-bot a:hover {
    color: var(--humano-chat-accent-hover);
}

.humano-chat-msg-bot strong {
    font-weight: 600;
}

.humano-chat-msg-bot h3,
.humano-chat-msg-bot h4 {
    margin: 0.5em 0 0.25em;
    font-size: 1em;
    font-weight: 600;
}

.humano-chat-msg-bot h3:first-child,
.humano-chat-msg-bot h4:first-child {
    margin-top: 0;
}

/* Typing indicator (WhatsApp-style: dots below last message) */
.humano-chat-typing {
    padding: 14px 18px;
    min-height: auto;
}

.humano-chat-typing-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 2px;
    background: currentColor;
    border-radius: 50%;
    opacity: 0.4;
    animation: humano-chat-typing-bounce 1.4s ease-in-out infinite both;
}

.humano-chat-typing-dot:nth-child(1) { animation-delay: 0s; }
.humano-chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.humano-chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes humano-chat-typing-bounce {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-4px); opacity: 1; }
}

.humano-chat-msg-error {
    align-self: flex-start;
    background: #fcf0f1;
    color: var(--humano-chat-error);
}

.humano-chat-msg .humano-chat-msg-meta {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 4px;
}

.humano-chat-input-wrap {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--humano-chat-border);
    background: #fafafa;
}

.humano-chat-input {
    flex: 1;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    padding: 10px 12px;
    border: 1px solid var(--humano-chat-border);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
}

.humano-chat-input:focus {
    outline: none;
    border-color: var(--humano-chat-accent);
    box-shadow: 0 0 0 1px var(--humano-chat-accent);
}

.humano-chat-send {
    padding: 10px 18px;
    background: var(--humano-chat-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.humano-chat-send:hover {
    background: var(--humano-chat-accent-hover);
}

.humano-chat-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.humano-chat-status {
    padding: 4px 12px 8px;
    font-size: 12px;
    color: #646970;
    min-height: 20px;
}

.humano-chat-status.humano-chat-status-thinking::after {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin-left: 4px;
    background: currentColor;
    border-radius: 50%;
    animation: humano-chat-blink 1s ease-in-out infinite;
}

@keyframes humano-chat-blink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Inline (shortcode) */
.humano-chat-inline {
    width: 100%;
    min-height: 320px;
}

/* Floating widget */
.humano-chat-floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
}

.humano-chat-float-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--humano-chat-accent);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.humano-chat-float-btn:hover {
    background: var(--humano-chat-accent-hover);
}

.humano-chat-float-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
}

.humano-chat-float-panel[hidden] {
    display: none !important;
}

.humano-chat-float-inner {
    max-height: 420px;
}
