/**
 * Agentic Chat Interface Styles
 */

/* ── Theme Variables (Dark — default) ── */
.agentic-chat-container {
    --ac-bg: #1a1a2e;
    --ac-accent: #8b5cf6;
    --ac-accent2: #6366f1;
    --ac-accent-rgb: 139, 92, 246;
    --ac-accent2-rgb: 99, 102, 241;
    --ac-text: #f0f0f0;
    --ac-text-secondary: #e0e0e0;
    --ac-text-muted: #a0a0a0;
    --ac-text-dim: #888;
    --ac-text-faint: #707070;
    --ac-text-footer: #505050;
    --ac-border: rgba(var(--ac-accent-rgb), 0.2);
    --ac-input-bg: rgba(255, 255, 255, 0.05);
    --ac-input-border: rgba(var(--ac-accent-rgb), 0.3);
    --ac-input-placeholder: #606060;
    --ac-agent-msg-bg: rgba(var(--ac-accent-rgb), 0.15);
    --ac-agent-msg-border: rgba(var(--ac-accent-rgb), 0.2);
    --ac-user-msg-bg: rgba(var(--ac-accent2-rgb), 0.3);
    --ac-user-msg-border: rgba(var(--ac-accent2-rgb), 0.3);
    --ac-code-bg: rgba(0, 0, 0, 0.3);
    --ac-pre-bg: rgba(0, 0, 0, 0.4);
    --ac-btn-secondary-bg: rgba(255, 255, 255, 0.1);
    --ac-btn-secondary-border: rgba(255, 255, 255, 0.1);
    --ac-btn-secondary-hover: rgba(255, 255, 255, 0.15);
    --ac-tool-tag-bg: rgba(34, 197, 94, 0.2);
    --ac-tool-tag-color: #22c55e;
    --ac-input-area-bg: rgba(0, 0, 0, 0.2);
    --ac-card-bg: rgba(255, 255, 255, 0.05);
    --ac-card-border: rgba(255, 255, 255, 0.1);
    --ac-scrollbar-track: rgba(0, 0, 0, 0.2);
    --ac-scrollbar-thumb: rgba(var(--ac-accent-rgb), 0.3);
    --ac-scrollbar-hover: rgba(var(--ac-accent-rgb), 0.5);
    --ac-proposal-header-bg: rgba(var(--ac-accent-rgb), 0.12);
    --ac-proposal-desc: #d1d5db;
    --ac-proposal-toggle: #a78bfa;
    --ac-diff-bg: #0d1117;
    --ac-diff-text: #e6edf3;
    --ac-link-color: var(--ac-accent);
    --ac-voice-border: rgba(255, 255, 255, 0.2);
    --ac-voice-color: rgba(255, 255, 255, 0.6);
    --ac-attach-border: rgba(255, 255, 255, 0.2);
    --ac-attach-color: rgba(255, 255, 255, 0.6);
    --ac-footer-border: rgba(255, 255, 255, 0.05);
    --ac-image-remove-bg: rgba(255, 255, 255, 0.15);
    --ac-login-gradient: linear-gradient(135deg, rgba(var(--ac-accent-rgb), 0.15) 0%, rgba(59, 130, 246, 0.1) 100%);
    --ac-empty-gradient: linear-gradient(135deg, rgba(var(--ac-accent-rgb), 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    --ac-header-label: #c4b5fd;
    --ac-quick-btn-bg: rgba(var(--ac-accent-rgb), 0.1);
    --ac-quick-btn-border: rgba(var(--ac-accent-rgb), 0.5);
    --ac-quick-btn-color: #c4b5fd;
    --ac-prompt-btn-bg: rgba(var(--ac-accent-rgb), 0.05);
    --ac-prompt-btn-border: rgba(var(--ac-accent-rgb), 0.3);
    --ac-prompt-btn-color: #a78bfa;
    --ac-status-dot: #22c55e;
    --ac-feature-check: #10b981;
    --ac-th-bg: rgba(var(--ac-accent-rgb), 0.2);
}

.agentic-chat-container {
    max-width: 1180px;
    margin: 0 auto;
    background: var(--ac-bg);
    border-radius: 16px;
    border: 1px solid var(--ac-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 170px);
    min-height: 540px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.agentic-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(var(--ac-accent-rgb), 0.1);
    border-bottom: 1px solid var(--ac-border);
}

.agentic-agent-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.agentic-agent-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--ac-accent) 0%, var(--ac-accent2) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Agent Selector Dropdown */
.agentic-agent-selector {
    position: relative;
}

.agentic-agent-dropdown {
    appearance: none;
    background: rgba(var(--ac-accent-rgb), 0.2);
    border: 1px solid var(--ac-input-border);
    border-radius: 8px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    color: var(--ac-text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    min-width: 200px;
    transition: all 0.2s;
}

.agentic-agent-dropdown:hover {
    background: rgba(var(--ac-accent-rgb), 0.3);
    border-color: rgba(var(--ac-accent-rgb), 0.5);
}

.agentic-agent-dropdown:focus {
    outline: none;
    border-color: var(--ac-accent);
    box-shadow: 0 0 0 2px rgba(var(--ac-accent-rgb), 0.2);
}

.agentic-agent-dropdown option {
    background: var(--ac-bg);
    color: var(--ac-text);
    padding: 0.5rem;
}

.agentic-agent-selector::after {
    content: '▼';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ac-text-muted);
    font-size: 0.6rem;
    pointer-events: none;
}

.agentic-agent-details {
    flex: 1;
}

.agentic-agent-details h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ac-text);
}

.agentic-agent-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.72rem;
    color: var(--ac-text-muted);
}

.agent-meta-separator {
    color: rgba(var(--ac-accent-rgb), 0.4);
    margin: 0 0.25rem;
}

.agentic-status {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--ac-text-muted);
}

.agentic-status-dot {
    width: 8px;
    height: 8px;
    background: var(--ac-status-dot);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.agentic-chat-actions {
    display: flex;
    gap: 0.5rem;
}

.agentic-btn-secondary {
    background: var(--ac-btn-secondary-bg);
    border: 1px solid var(--ac-btn-secondary-border);
    border-radius: 8px;
    padding: 0.5rem;
    color: var(--ac-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.agentic-btn-secondary:hover {
    background: var(--ac-btn-secondary-hover);
    color: var(--ac-text);
}

/* History Panel */
.agentic-history-panel {
    display: none;
    flex-direction: column;
    background: var(--ac-surface);
    border-bottom: 1px solid var(--ac-border);
    max-height: 50vh;
    overflow: hidden;
}

.agentic-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--ac-border);
}

.agentic-history-header h3 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ac-text);
}

.agentic-history-close {
    background: none;
    border: none;
    color: var(--ac-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.agentic-history-close:hover {
    color: var(--ac-text);
}

.agentic-history-list {
    overflow-y: auto;
    flex: 1;
    padding: 0.5rem;
}

.agentic-history-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    margin-bottom: 2px;
    font-family: inherit;
}

.agentic-history-item:hover {
    background: var(--ac-btn-secondary-hover);
    border-color: var(--ac-border);
}

.agentic-history-item-active {
    background: var(--ac-btn-secondary-bg);
    border-color: var(--ac-accent);
}

.agentic-history-preview {
    font-size: 0.8125rem;
    color: var(--ac-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.agentic-history-date {
    font-size: 0.6875rem;
    color: var(--ac-text-muted);
    margin-top: 0.2rem;
}

.agentic-history-loading,
.agentic-history-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--ac-text-muted);
    font-size: 0.8125rem;
}

.agentic-history-limit-note {
    text-align: center;
    padding: 0.75rem 1rem;
    margin-top: 0.25rem;
    color: var(--ac-text-muted);
    font-size: 0.75rem;
    border-top: 1px solid var(--ac-border);
}

.agentic-history-limit-note a {
    color: #6366f1;
    text-decoration: none;
}

.agentic-history-limit-note a:hover {
    text-decoration: underline;
}

/* Messages Area */
.agentic-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.agentic-message {
    max-width: 85%;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agentic-message-agent {
    align-self: flex-start;
}

.agentic-message-user {
    align-self: flex-end;
}

.agentic-message-content {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    line-height: 1.6;
}

.agentic-message-agent .agentic-message-content {
    background: var(--ac-agent-msg-bg);
    border: 1px solid var(--ac-agent-msg-border);
    color: var(--ac-text-secondary);
}

.agentic-message-user .agentic-message-content {
    background: var(--ac-user-msg-bg);
    border: 1px solid var(--ac-user-msg-border);
    color: var(--ac-text);
}

.agentic-message-content p {
    margin: 0 0 0.75rem 0;
}

.agentic-message-content p:last-child {
    margin-bottom: 0;
}

.agentic-message-content ul,
.agentic-message-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.agentic-message-content li {
    margin: 0.25rem 0;
}

.agentic-message-content code {
    background: var(--ac-code-bg);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9em;
}

.agentic-message-content pre {
    background: var(--ac-pre-bg);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.75rem 0;
}

.agentic-message-content pre code {
    background: none;
    padding: 0;
}

.agentic-code-wrap {
    position: relative;
    margin: 0.75rem 0;
}
.agentic-code-wrap pre {
    margin: 0;
}
.agentic-copy-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 10px;
    font-size: 11px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    z-index: 1;
    transition: background 0.15s, color 0.15s;
}
.agentic-copy-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.agentic-message-meta {
    font-size: 0.75rem;
    color: var(--ac-text-faint);
    margin-top: 0.5rem;
    display: flex;
    gap: 1rem;
}

/* Message action bar (copy / thumbs / regenerate) */
.agentic-message-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.15s;
}

.agentic-message-agent:hover .agentic-message-actions,
.agentic-message-agent:focus-within .agentic-message-actions {
    opacity: 1;
}

.agentic-action-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 4px 6px;
    color: var(--ac-text-faint);
    cursor: pointer;
    line-height: 0;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.agentic-action-btn:hover {
    color: var(--ac-text);
    background: var(--ac-tool-tag-bg, rgba(255,255,255,0.08));
    border-color: var(--ac-border, rgba(255,255,255,0.12));
}

.agentic-action-btn.agentic-action-done,
.agentic-action-copy.agentic-action-done {
    color: #22c55e;
}

.agentic-action-thumb.agentic-action-active[data-thumb="up"] {
    color: #22c55e;
}

.agentic-action-thumb.agentic-action-active[data-thumb="down"] {
    color: #ef4444;
}

/* Professional handoff banner for Basic Multi-Agent Orchestration (P0 Item 2) - integrated with reasoning card style */
.agentic-handoff-banner {
	background: #f8f9fa;
	border-left: 3px solid #2271b1;
	border-radius: 6px;
	padding: 10px 14px;
	margin: 0 0 12px 0;
	font-size: 13px;
	line-height: 1.5;
	color: #2c3338;
	box-shadow: 0 1px 2px rgba(0,0,0,0.03);
	display: flex;
	align-items: flex-start;
	gap: 8px;
}
.agentic-handoff-banner .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: #2271b1;
	flex-shrink: 0;
	margin-top: 1px;
}
.agentic-handoff-banner strong {
	color: #1d2327;
}

.agentic-action-regenerate:hover {
    color: var(--ac-accent, #6366f1);
}

/* Tool usage indicator */
.agentic-tools-used {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.agentic-tool-tag {
    background: var(--ac-tool-tag-bg);
    color: var(--ac-tool-tag-color);
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    font-family: inherit;
    border: 1px solid rgba(34, 197, 94, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: background 0.15s;
    cursor: default;
}

.agentic-tool-tag:hover {
    background: rgba(34, 197, 94, 0.3);
}

.agentic-tool-icon {
    font-size: 0.65rem;
    opacity: 0.8;
}

/* Input Area */
.agentic-chat-input-container {
    padding: 1rem 1.5rem;
    background: var(--ac-input-area-bg);
    border-top: 1px solid var(--ac-border);
}

.agentic-typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--ac-text-muted);
    margin-bottom: 0.75rem;
}

.agentic-typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--ac-accent);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.agentic-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.agentic-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.agentic-typing-indicator span:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

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

.agentic-chat-input {
    flex: 1;
    background: var(--ac-input-bg);
    border: 1px solid var(--ac-input-border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--ac-text);
    font-size: 0.95rem;
    resize: none;
    min-height: 44px;
    max-height: 150px;
    line-height: 1.5;
    font-family: inherit;
}

.agentic-chat-input:focus {
    outline: none;
    border-color: var(--ac-accent);
    box-shadow: 0 0 0 3px rgba(var(--ac-accent-rgb), 0.2);
}

.agentic-chat-input::placeholder {
    color: var(--ac-input-placeholder);
}

.agentic-voice-btn,
.agentic-tts-btn {
    background: none;
    border: 1px solid var(--ac-voice-border);
    border-radius: 10px;
    padding: 0.75rem;
    color: var(--ac-voice-color);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agentic-voice-btn:hover,
.agentic-tts-btn:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

.agentic-voice-btn.agentic-voice-active {
    color: #fff;
    background: #d63638;
    border-color: #d63638;
    animation: agenticVoicePulse 1.5s ease-in-out infinite;
}

.agentic-voice-btn.agentic-voice-disabled,
.agentic-voice-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed !important;
    position: relative;
    color: #d63638;
    border-color: #d63638;
}

.agentic-voice-btn.agentic-voice-disabled::after,
.agentic-voice-btn[disabled]::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 7px;
    height: 7px;
    background: #d63638;
    border-radius: 50%;
    border: 1px solid var(--ac-bg, #1e1e2e);
}

.agentic-tts-btn.agentic-tts-active {
    color: #fff;
    background: var(--ac-accent);
    border-color: var(--ac-accent);
}

@keyframes agenticVoicePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(214, 54, 56, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(214, 54, 56, 0); }
}

.agentic-send-btn {
    background: linear-gradient(135deg, var(--ac-accent) 0%, var(--ac-accent2) 100%);
    border: none;
    border-radius: 10px;
    padding: 0.75rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agentic-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(var(--ac-accent-rgb), 0.4);
}

.agentic-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Status LEDs (AI connectivity + credits) */
.agentic-status-leds {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 8px;
}
.agentic-led {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--ac-text-muted);
    cursor: default;
    user-select: none;
}
.agentic-led-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6b7280;
    transition: background 0.3s, box-shadow 0.3s;
}
.agentic-led-ok .agentic-led-dot {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
}
.agentic-led-ok {
    color: var(--ac-text-secondary);
}
.agentic-led-warn .agentic-led-dot {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
    animation: agentic-led-pulse 1.6s ease-in-out infinite;
}
.agentic-led-warn {
    color: #fcd34d;
}
.agentic-led-error .agentic-led-dot {
    background: #ef4444;
    box-shadow: 0 0 7px rgba(239, 68, 68, 0.8);
    animation: agentic-led-pulse 1.1s ease-in-out infinite;
}
.agentic-led-error {
    color: #fca5a5;
}
.agentic-led-unknown .agentic-led-dot {
    background: #6b7280;
}
@keyframes agentic-led-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
@media (max-width: 600px) {
    .agentic-led-label { display: none; }
}

/* Footer */
.agentic-chat-footer {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    color: var(--ac-text-footer);
    border-top: 1px solid var(--ac-footer-border);
}

/* Attach / paperclip button */
.agentic-attach-btn {
    background: none;
    border: 1px solid var(--ac-attach-border);
    border-radius: 10px;
    padding: 0.75rem;
    color: var(--ac-attach-color);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.agentic-attach-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
}
.agentic-attach-btn.agentic-attach-active {
    color: var(--ac-accent);
    border-color: var(--ac-accent);
}

/* Image preview above input */
.agentic-image-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--ac-input-bg);
    border-top: 1px solid var(--ac-card-border);
}
.agentic-image-preview img {
    max-height: 80px;
    max-width: 120px;
    border-radius: 8px;
    object-fit: cover;
}
.agentic-remove-image {
    background: var(--ac-image-remove-bg);
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.agentic-remove-image:hover {
    background: rgba(214, 54, 56, 0.6);
}

/* Inline chat image in messages */
.agentic-chat-image {
    max-width: 280px;
    max-height: 200px;
    border-radius: 8px;
    margin-bottom: 6px;
    object-fit: cover;
}

.agentic-footer-stats {
    display: flex;
    gap: 1rem;
}

/* Login required message */
.agentic-login-required {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--ac-login-gradient);
    border-radius: 16px;
    border: 1px solid var(--ac-input-border);
    max-width: 500px;
    margin: 4rem auto;
}

.agentic-login-required .login-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

.agentic-login-required h2 {
    color: var(--ac-text);
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.agentic-login-required > p {
    color: var(--ac-text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.agentic-login-required .login-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    text-align: left;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.agentic-login-required .feature {
    color: #d0d0d0;
    font-size: 0.95rem;
}

.agentic-login-required .feature span {
    color: var(--ac-feature-check);
    margin-right: 0.5rem;
    font-weight: bold;
}

.agentic-login-required .login-btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, var(--ac-accent) 0%, var(--ac-accent2) 100%);
    color: #fff;
    padding: 0.875rem 2.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(var(--ac-accent-rgb), 0.3);
}

.agentic-login-required .login-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--ac-accent-rgb), 0.4);
}

.agentic-login-required .login-signup {
    margin-top: 1.5rem;
    color: var(--ac-text-dim);
    font-size: 0.9rem;
}

.agentic-login-required .login-signup a {
    color: var(--ac-link-color);
    text-decoration: none;
}

.agentic-login-required .login-signup a:hover {
    text-decoration: underline;
}

.agentic-login-required a {
    color: var(--ac-link-color);
}

/* Empty state - No agents */
.agentic-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--ac-empty-gradient);
    border-radius: 16px;
    border: 1px solid var(--ac-border);
    max-width: 600px;
    margin: 2rem auto;
}

.agentic-empty-state .empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.agentic-empty-state h2 {
    color: var(--ac-text);
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.agentic-empty-state > p {
    color: var(--ac-text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.available-agents-preview {
    margin-bottom: 2rem;
}

.available-agents-preview h4 {
    color: #d0d0d0;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.agent-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.agent-preview-card {
    background: var(--ac-card-bg);
    border: 1px solid var(--ac-card-border);
    border-radius: 10px;
    padding: 1rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.agent-preview-card .agent-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.agent-preview-card .agent-name {
    color: var(--ac-text);
    font-weight: 600;
    font-size: 0.9rem;
}

.agent-preview-card .agent-desc {
    color: var(--ac-text-dim);
    font-size: 0.8rem;
}

.activate-agents-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--ac-accent) 0%, var(--ac-accent2) 100%);
    color: #fff;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(var(--ac-accent-rgb), 0.3);
}

.activate-agents-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--ac-accent-rgb), 0.4);
    color: #fff;
}

.contact-admin {
    color: var(--ac-text-dim);
    font-size: 0.9rem;
}

@media (max-width: 500px) {
    .agent-grid {
        grid-template-columns: 1fr;
    }
}

/* Markdown rendering */
.agentic-message-content h1,
.agentic-message-content h2,
.agentic-message-content h3,
.agentic-message-content h4 {
    color: var(--ac-text);
    margin: 1rem 0 0.5rem;
}

.agentic-message-content h1:first-child,
.agentic-message-content h2:first-child,
.agentic-message-content h3:first-child {
    margin-top: 0;
}

.agentic-message-content a {
    color: var(--ac-link-color);
    text-decoration: underline;
}

.agentic-message-content blockquote {
    border-left: 3px solid var(--ac-accent);
    margin: 0.75rem 0;
    padding-left: 1rem;
    color: var(--ac-text-muted);
}

.agentic-message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    display: block;
    overflow-x: auto;
}

.agentic-message-content th,
.agentic-message-content td {
    border: 1px solid var(--ac-card-border);
    padding: 0.5rem;
    text-align: left;
    white-space: nowrap;
}

.agentic-message-content th {
    background: var(--ac-th-bg);
    font-weight: 600;
}

.agentic-message-content hr {
    border: none;
    border-top: 1px solid var(--ac-card-border);
    margin: 1rem 0;
}

.agentic-message-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0.75rem 0 0.25rem;
}

/* Scrollbar */
.agentic-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.agentic-chat-messages::-webkit-scrollbar-track {
    background: var(--ac-scrollbar-track);
}

.agentic-chat-messages::-webkit-scrollbar-thumb {
    background: var(--ac-scrollbar-thumb);
    border-radius: 4px;
}

.agentic-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--ac-scrollbar-hover);
}

/* Responsive */
@media (max-width: 768px) {
    .agentic-chat-container {
        height: calc(100vh - 150px);
        border-radius: 0;
    }

    .agentic-message {
        max-width: 95%;
    }

    .agentic-chat-header {
        padding: 0.75rem 1rem;
    }

    .agentic-chat-messages {
        padding: 1rem;
    }

    .agentic-chat-input-container {
        padding: 0.75rem 1rem;
    }
}

/* ── Proposal Cards ── */

.agentic-proposal-card {
    margin-top: 12px;
    border: 1px solid rgba(var(--ac-accent-rgb), 0.4);
    border-radius: 8px;
    background: rgba(var(--ac-accent-rgb), 0.05);
    overflow: hidden;
}

.agentic-proposal-header {
    padding: 10px 14px;
    background: var(--ac-proposal-header-bg);
    border-bottom: 1px solid rgba(var(--ac-accent-rgb), 0.2);
    font-size: 13px;
    color: var(--ac-header-label);
    display: flex;
    align-items: center;
    gap: 6px;
}

.agentic-proposal-header .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.agentic-proposal-desc {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--ac-proposal-desc);
    line-height: 1.5;
}

.agentic-proposal-toggle {
    display: block;
    width: 100%;
    padding: 6px 14px;
    background: none;
    border: none;
    border-top: 1px solid rgba(var(--ac-accent-rgb), 0.15);
    color: var(--ac-proposal-toggle);
    font-size: 12px;
    cursor: pointer;
    text-align: left;
}

.agentic-proposal-toggle:hover {
    background: rgba(var(--ac-accent-rgb), 0.08);
}

.agentic-proposal-diff {
    margin: 0;
    padding: 10px 14px;
    background: var(--ac-diff-bg);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    border-top: 1px solid rgba(var(--ac-accent-rgb), 0.15);
    color: var(--ac-diff-text);
    white-space: pre;
}

.agentic-proposal-diff .diff-add {
    color: #3fb950;
    background: rgba(63, 185, 80, 0.1);
    display: inline-block;
    width: 100%;
}

.agentic-proposal-diff .diff-del {
    color: #f85149;
    background: rgba(248, 81, 73, 0.1);
    display: inline-block;
    width: 100%;
}

.agentic-proposal-diff .diff-hunk {
    color: #79c0ff;
}

.agentic-proposal-actions {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid rgba(var(--ac-accent-rgb), 0.15);
}

.agentic-proposal-btn {
    padding: 6px 16px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s;
}

.agentic-proposal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.agentic-proposal-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.agentic-proposal-approve {
    background: #22c55e;
    color: #fff;
}

.agentic-proposal-approve:hover:not(:disabled) {
    background: #16a34a;
}

.agentic-proposal-session {
    background: #3b82f6;
    color: #fff;
}

.agentic-proposal-session:hover:not(:disabled) {
    background: #2563eb;
}

.agentic-proposal-always {
    background: #8b5cf6;
    color: #fff;
}

.agentic-proposal-always:hover:not(:disabled) {
    background: #7c3aed;
}

.agentic-proposal-reject {
    background: #ef4444;
    color: #fff;
}

.agentic-proposal-reject:hover:not(:disabled) {
    background: #dc2626;
}

.agentic-proposal-status {
    font-size: 13px;
    padding: 4px 0;
    color: var(--ac-proposal-desc);
}

.agentic-proposal-error {
    color: #f59e0b;
}

.agentic-proposal-card.agentic-proposal-approved {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.05);
}

.agentic-proposal-card.agentic-proposal-rejected {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.03);
    opacity: 0.7;
}

/* Quick action buttons (WordPress Assistant) */
.agentic-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.agentic-quick-action-btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--ac-quick-btn-border);
    border-radius: 20px;
    background: var(--ac-quick-btn-bg);
    color: var(--ac-quick-btn-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none;
    line-height: 1.3;
}

.agentic-quick-action-btn:hover,
.agentic-quick-action-btn:focus {
    background: rgba(var(--ac-accent-rgb), 0.3);
    color: #fff;
    border-color: rgba(var(--ac-accent-rgb), 0.8);
    text-decoration: none;
}

/* Suggested prompt buttons */
.agentic-suggested-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.agentic-starter-label {
    margin: 20px 0 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ac-text-muted);
}

.agentic-prompt-btn {
    padding: 10px 16px;
    border: 1px solid var(--ac-prompt-btn-border);
    border-radius: 12px;
    background: var(--ac-prompt-btn-bg);
    color: var(--ac-prompt-btn-color);
    font-size: 13.5px;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    line-height: 1.3;
}

.agentic-prompt-btn:hover {
    background: rgba(var(--ac-accent-rgb), 0.18);
    color: #fff;
    border-color: rgba(var(--ac-accent-rgb), 0.7);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--ac-accent-rgb), 0.2);
}

/* WhatsApp Pro upsell — subtle, below the chat (free-tier advertising) */
.agentic-whatsapp-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px auto 0;
    padding: 9px 16px;
    max-width: 1180px;
    font-size: 12.5px;
    color: var(--ac-text-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: color 0.15s, background 0.15s;
}
.agentic-whatsapp-cta:hover {
    color: #25d366;
    background: rgba(37, 211, 102, 0.08);
}
.agentic-whatsapp-cta svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #25d366;
}
.agentic-whatsapp-cta strong {
    color: var(--ac-text-secondary);
    font-weight: 600;
}
.agentic-whatsapp-cta:hover strong {
    color: #25d366;
}
.agentic-whatsapp-cta .agentic-whatsapp-pro {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(37, 211, 102, 0.15);
    color: #25d366;
}

/* Consent Banner */
.agentic-consent-banner {
    padding: 12px 16px;
    background: var(--ac-bg-secondary, #f0f0f1);
    border-top: 1px solid var(--ac-border, #dcdcde);
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
}
.agentic-consent-banner p {
    margin: 0 0 8px;
    color: var(--ac-text-secondary, #50575e);
}
.agentic-consent-accept {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    background: var(--ac-accent, #2271b1);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.agentic-consent-accept:hover {
    opacity: 0.9;
}


/* Quota / credit limit error highlight */
.agentic-quota-error .agentic-message-content {
    border-left: 3px solid #f59e0b;
    padding-left: 0.75rem;
}
.agentic-quota-error .agentic-message-content a {
    color: #f59e0b;
    font-weight: 600;
    text-decoration: none;
}
.agentic-quota-error .agentic-message-content a:hover {
    text-decoration: underline;
}

/* ── Slash Command Palette ── */

.agentic-slash-palette {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--ac-card-bg, rgba(255,255,255,0.05));
    border: 1px solid var(--ac-accent, #8b5cf6);
    border-radius: 10px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.35);
    overflow: hidden;
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
}

.agentic-slash-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 9px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.12s;
}

.agentic-slash-item:last-child {
    border-bottom: none;
}

.agentic-slash-item:hover,
.agentic-slash-item--active {
    background: rgba(var(--ac-accent-rgb, 139,92,246), 0.15);
}

.agentic-slash-name {
    font-family: monospace;
    font-size: 0.88rem;
    color: var(--ac-accent, #8b5cf6);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 130px;
}

.agentic-slash-arg {
    opacity: 0.55;
    font-size: 0.8em;
}

.agentic-slash-desc {
    font-size: 0.82rem;
    color: var(--ac-text-muted, #a0a0a0);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── First-class modern chat UX polish ────────────────────────────────────── */
.agentic-chat-container {
	/* Subtle improvement to message container for better readability on long threads */
	scrollbar-width: thin;
}

.agentic-message-actions button {
	border-radius: 6px;
	transition: background 0.1s ease, transform 0.1s ease;
}

.agentic-message-actions button:hover {
	transform: translateY(-1px);
}

.agentic-chat-input {
	border-radius: 10px !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	transition: box-shadow 0.15s ease;
}

.agentic-chat-input:focus-within {
	box-shadow: 0 0 0 1px var(--ac-accent, #8b5cf6), 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Improved mobile / narrow sidebar experience */
@media (max-width: 782px) {
	.agentic-chat-container {
		border-radius: 0;
	}
	.agentic-agent-selector select {
		font-size: 14px;
	}
}

/* Accessibility: stronger focus visible for keyboard users */
.agentic-btn-secondary:focus-visible,
.agentic-chat-input button:focus-visible,
.agentic-message-actions button:focus-visible {
	outline: 2px solid var(--ac-accent, #8b5cf6);
	outline-offset: 2px;
}

/* Streaming cursor polish */
.agentic-stream-cursor {
	display: inline-block;
	width: 2px;
	height: 1.1em;
	background: currentColor;
	vertical-align: text-bottom;
	animation: agentic-blink 0.8s step-end infinite;
	margin-left: 1px;
}

@keyframes agentic-blink {
	50% { opacity: 0; }
}

