#anthill-ai-assistant * { box-sizing: border-box; }

/* Top header entry point */
.ahai-header-trigger {
    background: none; border: none; color: #fff; cursor: pointer;
    font-size: 20px; width: 38px; height: 38px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    opacity: .92; transition: background .15s ease, opacity .15s ease;
}
.ahai-header-trigger:hover { background: rgba(255,255,255,.15); opacity: 1; }

/* Fallback entry point for masters without a recognizable header */
.ahai-trigger-floating {
    position: fixed; right: 22px; bottom: 22px; z-index: 2000;
    width: 52px; height: 52px; border-radius: 50%;
    background: #1565C0; opacity: 1;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.ahai-trigger-floating:hover { background: #0d4c9c; }

/* Panel (hidden until .ahai-open is added) */
.ahai-panel {
    display: none;
    position: fixed; right: 22px; bottom: 22px; z-index: 2001;
    width: 360px; max-width: calc(100vw - 24px);
    height: 520px; max-height: calc(100vh - 90px);
    background: #fff; border-radius: 14px; overflow: hidden;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,.28);
    font-family: 'Nunito-Regular','Roboto',sans-serif;
}
.ahai-panel.ahai-open { display: flex; }

.ahai-head {
    background: #1565C0; color: #fff; padding: 12px 14px;
    display: flex; align-items: center; justify-content: space-between;
}
.ahai-head-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.ahai-head-actions { display: flex; align-items: center; gap: 2px; }
.ahai-icon-btn {
    background: none; border: none; color: #fff; font-size: 18px; line-height: 1; cursor: pointer;
    opacity: .9; width: 30px; height: 30px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
}
.ahai-icon-btn:hover { opacity: 1; background: rgba(255,255,255,.15); }

.ahai-body { flex: 1; padding: 14px; overflow-y: auto; background: #f5f7fa; display: flex; flex-direction: column; gap: 10px; }

.ahai-bubble { max-width: 84%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.ahai-bot { align-self: flex-start; background: #fff; color: #222; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.ahai-user { align-self: flex-end; background: #1565C0; color: #fff; border-bottom-right-radius: 4px; }
.ahai-warn { align-self: flex-start; background: #fff4e5; color: #8a5300; border: 1px solid #ffd699; }

.ahai-thinking { display: flex; gap: 4px; align-items: center; }
.ahai-dot { width: 7px; height: 7px; border-radius: 50%; background: #9aa4b2; animation: ahai-bounce 1.2s infinite ease-in-out; }
.ahai-dot:nth-child(2) { animation-delay: .15s; }
.ahai-dot:nth-child(3) { animation-delay: .3s; }
@keyframes ahai-bounce { 0%,80%,100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

.ahai-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e4e8ee; background: #fff; }
.ahai-input input { flex: 1; border: 1px solid #d5dbe3; border-radius: 20px; padding: 9px 14px; font-size: 14px; outline: none; }
.ahai-input input:focus { border-color: #1565C0; }
.ahai-send { border: none; background: #1565C0; color: #fff; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.ahai-send:hover { background: #0d4c9c; }

@media (max-width: 480px) {
    .ahai-panel { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100vh - 80px); }
}
