.agent-name {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.agent-avatar-wrap {
    overflow: hidden;
    flex-shrink: 0;
    border: none;
    background: var(--t-surface-3);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t-border) 65%, transparent);
}

.agent-avatar-wrap--sm {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
}

.agent-avatar-wrap--md {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
}

.agent-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
    display: block;
    transform: scale(1.12);
    border-radius: 50%;
}

.chat-messages {
    min-height: 10rem;
    max-height: 22rem;
    overflow-y: auto;
}

.chat-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.chat-row--user {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: 85%;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    line-height: 1.45;
    border-radius: 1.25rem;
}

.chat-bubble--user {
    border-bottom-right-radius: 0.25rem;
}

.chat-bubble--agent {
    border-bottom-left-radius: 0.25rem;
}

.chat-typing {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.125rem 0;
    min-width: 2.5rem;
    min-height: 1.25rem;
}

.chat-typing span {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.55;
    animation: chatDotBounce 1.1s ease-in-out infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatDotBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
    30% { transform: translateY(-5px); opacity: 1; }
}

.chat-attachments-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1.5rem 0.75rem;
}

.chat-attach-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    border: 1px solid var(--t-border);
    background: var(--t-surface-2);
    color: var(--t-text-muted);
}

.chat-attach-chip img {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.35rem;
    object-fit: cover;
}

.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.45rem 0.4rem 0.45rem 0.5rem;
}

.chat-input-tools {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.chat-tool-btn {
    width: 2rem;
    height: 2rem;
    border: none;
    background: none;
    border-radius: 0.75rem;
    color: var(--t-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.chat-tool-btn:hover {
    background: var(--t-dropdown-hover);
    color: var(--t-text);
}

.chat-tool-btn.active {
    background: color-mix(in srgb, var(--t-accent) 12%, transparent);
    color: var(--t-text);
}

.chat-tool-btn svg {
    width: 1rem;
    height: 1rem;
}

.chat-tool-btn.recording {
    color: #ef4444;
    animation: micPulse 1.2s ease-in-out infinite;
}

@keyframes micPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.chat-attach-menu-wrap {
    position: relative;
}

.chat-attach-menu {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 0;
    min-width: 11rem;
    border-radius: 1rem;
    border: 1px solid var(--t-border);
    background: var(--t-dropdown);
    box-shadow: var(--t-shadow);
    padding: 0.35rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 20;
}

.chat-attach-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chat-attach-menu button {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.55rem 0.9rem;
    border: none;
    background: none;
    color: var(--t-text);
    font-size: 0.8125rem;
    text-align: left;
    cursor: pointer;
}

.chat-attach-menu-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--t-text-muted);
}

.chat-attach-menu button:hover .chat-attach-menu-icon {
    color: var(--t-text);
}

.chat-attach-menu button:hover {
    background: var(--t-dropdown-hover);
}

.chat-input-field {
    flex: 1;
    min-width: 0;
    width: 0;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.8125rem;
    line-height: 1.25;
    color: var(--t-text);
    padding: 0.25rem 0.35rem;
}

.chat-input-field::placeholder {
    font-size: 0.8125rem;
    opacity: 0.75;
}

.chat-send-btn {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 1rem;
    flex-shrink: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1;
}

.chat-voice-mode-hint {
    font-size: 0.7rem;
    padding: 0 1.5rem 0.5rem;
    color: var(--t-text-muted);
}

.chat-voice-mode-hint.active {
    color: #10b981;
}

.chat-bubble-enter {
    animation: chatBubbleIn 0.35s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

@keyframes chatBubbleIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
