:root {
    --agent-v2-primary: #5B9BD5;
    --agent-v2-primary-dark: #4178BE;
    --agent-v2-primary-soft: rgba(91, 155, 213, 0.1);
    --agent-v2-bg: #f8f9fa;
    --agent-v2-surface: #ffffff;
    --agent-v2-border: #e5e7eb;
    --agent-v2-text: #1f2937;
    --agent-v2-text-muted: #6b7280;
    --agent-v2-text-light: #9ca3af;
    --agent-v2-bg-secondary: #f1f5f9;
    --agent-v2-bg-tertiary: #e2e8f0;
    --agent-v2-text-primary: #1e293b;
    --agent-v2-text-secondary: #64748b;
    --agent-v2-success: #22c55e;
    --agent-v2-warning: #f59e0b;
    --agent-v2-error: #ef4444;
    --agent-v2-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    --agent-v2-shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.2);
    --agent-v2-radius: 12px;
    --agent-v2-radius-sm: 8px;
    --agent-v2-radius-lg: 16px;
    --agent-v2-transition: 0.2s ease;
    --agent-v2-transition-slow: 0.3s ease;
    --agent-v2-header-height: 60px;
    --agent-v2-footer-height: 100px;
}
html.dark-side,
[data-theme="dark"] {
    --agent-v2-bg: #1a1d21;
    --agent-v2-surface: #22262b;
    --agent-v2-border: #3a3f47;
    --agent-v2-text: #e6e8eb;
    --agent-v2-text-muted: #9ca3af;
    --agent-v2-text-light: #6b7280;
    --agent-v2-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --agent-v2-bg-secondary: #2a2e35;
    --agent-v2-bg-tertiary: #363b44;
    --agent-v2-text-primary: #e6e8eb;
    --agent-v2-text-secondary: #9ca3af;
}
.agent-v2-trigger {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--agent-v2-surface);
    border: 1px solid var(--agent-v2-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 100;
    transition: all var(--agent-v2-transition);
}
.agent-v2-trigger:hover {
    border-color: var(--agent-v2-primary);
    box-shadow: 0 0 0 3px var(--agent-v2-primary-soft);
}
.agent-v2-trigger.active {
    border-color: var(--agent-v2-primary);
    background: var(--agent-v2-primary-soft);
}
.agent-v2-trigger img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.agent-v2-wrapper {
    position: fixed;
    top: 0;
    height: 100vh;
    width: 500px; 
    z-index: 2147483647; 
    display: flex;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                width var(--agent-v2-transition),
                opacity 0.2s ease;
    pointer-events: none; 
}
.agent-v2-wrapper > * {
    pointer-events: auto;
}
.agent-v2-wrapper[data-position="hidden"] {
    transform: translateX(100%);
    pointer-events: none;
    opacity: 0;
}
.agent-v2-wrapper[data-position="right"] {
    right: 0;
    flex-direction: row-reverse;
}
.agent-v2-wrapper[data-position="left"] {
    left: 0;
    flex-direction: row;
}
.agent-v2-wrapper[data-position="left"][data-position="hidden"] {
    transform: translateX(-100%);
}
.agent-v2-wrapper[data-position="fullscreen"] {
    left: 0;
    top: 0;
    width: 100vw !important;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    flex-direction: row;
}
.agent-v2-sidebar {
    display: none;
    width: 290px;
    height: 100%;
    background: var(--agent-v2-surface);
    border-right: 1px solid var(--agent-v2-border);
    flex-shrink: 0;
    flex-direction: column;
    overflow: hidden;
}
.agent-v2-wrapper[data-position="fullscreen"] .agent-v2-sidebar {
    display: flex;
}
.agent-v2-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--agent-v2-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}
.agent-v2-sidebar-new-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--agent-v2-primary);
    color: white;
    border: none;
    border-radius: var(--agent-v2-radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--agent-v2-transition);
    width: 100%;
}
.agent-v2-sidebar-new-btn:hover {
    background: var(--agent-v2-primary-dark);
}
.agent-v2-sidebar-search {
    padding: 8px 12px;
    border: 1px solid var(--agent-v2-border);
    border-radius: var(--agent-v2-radius-sm);
    background: var(--agent-v2-bg);
    color: var(--agent-v2-text);
    font-size: 13px;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}
.agent-v2-sidebar-search:focus {
    border-color: var(--agent-v2-primary);
}
.agent-v2-sidebar-chats {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.agent-v2-sidebar-chats::-webkit-scrollbar {
    width: 4px;
}
.agent-v2-sidebar-chats::-webkit-scrollbar-thumb {
    background: var(--agent-v2-border);
    border-radius: 2px;
}
.agent-v2-sidebar-group {
    padding: 8px 8px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--agent-v2-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.agent-v2-sidebar-chat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--agent-v2-radius-sm);
    cursor: pointer;
    transition: background var(--agent-v2-transition);
    margin-bottom: 2px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}
.agent-v2-sidebar-chat:hover {
    background: var(--agent-v2-bg);
}
.agent-v2-sidebar-chat.active {
    background: var(--agent-v2-primary-soft);
    border: 1px solid rgba(91, 155, 213, 0.2);
}
.agent-v2-sidebar-chat-icon {
    display: none;
}
.agent-v2-sidebar-chat-info {
    flex: 1;
    min-width: 0;
}
.agent-v2-sidebar-chat-title {
    font-size: 13px;
    color: var(--agent-v2-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.agent-v2-sidebar-chat-date {
    font-size: 10px;
    color: var(--agent-v2-text-light);
}
.agent-v2-sidebar-chat-dots {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: 4px;
    color: var(--agent-v2-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    flex-shrink: 0;
    padding: 0;
}
.agent-v2-sidebar-chat:hover .agent-v2-sidebar-chat-dots {
    opacity: 1;
}
.agent-v2-sidebar-chat-dots:hover {
    background: var(--agent-v2-bg);
    color: var(--agent-v2-text);
}
.agent-v2-sidebar-chat-dropdown {
    display: none;
    position: fixed;
    min-width: 150px;
    background: var(--agent-v2-surface);
    border: 1px solid var(--agent-v2-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 9999;
    padding: 4px 0;
    flex-direction: column;
}
.agent-v2-sidebar-chat-dropdown.open {
    display: flex;
}
.agent-v2-sidebar-dd-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--agent-v2-text);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.12s;
    white-space: nowrap;
    width: 100%;
    text-align: left;
}
.agent-v2-sidebar-dd-item i {
    width: 14px;
    text-align: center;
    color: var(--agent-v2-text-muted);
    font-size: 11px;
}
.agent-v2-sidebar-dd-item:hover {
    background: var(--agent-v2-bg);
}
.agent-v2-sidebar-dd-item.delete:hover {
    color: var(--agent-v2-error);
    background: rgba(239, 68, 68, 0.08);
}
.agent-v2-sidebar-dd-item.delete:hover i {
    color: var(--agent-v2-error);
}
.agent-v2-sidebar-chat-title.editing {
    outline: 1px solid var(--agent-v2-accent, #6366f1);
    border-radius: 3px;
    padding: 1px 4px;
    background: var(--agent-v2-bg);
    cursor: text;
    min-width: 40px;
}
@keyframes agent-v2-skeleton-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.15; }
}
.agent-v2-skeleton {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.agent-v2-skeleton-msg {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.agent-v2-skeleton-msg.right {
    flex-direction: row-reverse;
}
.agent-v2-skeleton-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--agent-v2-border, #e5e7eb);
    flex-shrink: 0;
    animation: agent-v2-skeleton-pulse 1.5s ease-in-out infinite;
}
.agent-v2-skeleton-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    max-width: 70%;
}
.agent-v2-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: var(--agent-v2-border, #e5e7eb);
    animation: agent-v2-skeleton-pulse 1.5s ease-in-out infinite;
}
.agent-v2-skeleton-line:nth-child(1) { width: 65%; animation-delay: 0s; }
.agent-v2-skeleton-line:nth-child(2) { width: 85%; animation-delay: 0.15s; }
.agent-v2-skeleton-line:nth-child(3) { width: 45%; animation-delay: 0.3s; }
.agent-v2-skeleton-msg.right .agent-v2-skeleton-lines {
    align-items: flex-end;
}
.agent-v2-skeleton-msg.right .agent-v2-skeleton-line:nth-child(1) { width: 55%; }
.agent-v2-skeleton-msg.right .agent-v2-skeleton-line:nth-child(2) { width: 40%; }
.agent-v2-sidebar-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--agent-v2-text-muted);
    text-align: center;
    gap: 8px;
}
.agent-v2-sidebar-empty i {
    font-size: 28px;
    opacity: 0.4;
}
.agent-v2-sidebar-empty span {
    font-size: 13px;
}
.agent-v2-sidebar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--agent-v2-text-muted);
    font-size: 13px;
    gap: 8px;
}
.agent-v2-sidebar-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--agent-v2-border);
    font-size: 11px;
    color: var(--agent-v2-text-light);
    text-align: center;
    flex-shrink: 0;
}
.agent-v2-wrapper[data-position="fullscreen"] .agent-v2-container {
    flex: 1;
}
.agent-v2-charm-tab {
    display: none !important;
}
.agent-v2-wrapper.collapsed .agent-v2-container,
.agent-v2-wrapper.collapsed .agent-v2-splitter {
    pointer-events: none;
}
.agent-v2-wrapper.collapsed {
    width: 0 !important;
    overflow: hidden;
    pointer-events: none;
}
.agent-v2-wrapper[data-pinned="false"] .agent-v2-splitter {
    display: none;
}
.agent-v2-wrapper.expanded .agent-v2-container,
.agent-v2-wrapper[data-pinned="true"] .agent-v2-container {
    opacity: 1;
    pointer-events: auto;
}
.agent-v2-wrapper[data-pinned="true"] .agent-v2-splitter {
    display: flex;
}
.agent-v2-splitter {
    width: 8px;
    height: 100%;
    background: transparent;
    cursor: col-resize;
    transition: background var(--agent-v2-transition);
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.agent-v2-splitter-line {
    width: 2px;
    height: 40px;
    background: var(--agent-v2-border);
    border-radius: 1px;
    transition: all var(--agent-v2-transition);
    opacity: 0;
}
.agent-v2-splitter:hover .agent-v2-splitter-line,
.agent-v2-wrapper.resizing .agent-v2-splitter-line {
    opacity: 1;
    height: 60px;
    background: var(--agent-v2-primary);
}
.agent-v2-splitter:hover,
.agent-v2-wrapper.resizing .agent-v2-splitter {
    background: rgba(91, 155, 213, 0.1);
}
.agent-v2-wrapper[data-position="fullscreen"] .agent-v2-splitter {
    display: none;
}
.agent-v2-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--agent-v2-surface);
    box-shadow: var(--agent-v2-shadow);
    overflow: hidden;
    position: relative;
}
.agent-v2-wrapper[data-position="right"] .agent-v2-container {
    border-left: 1px solid var(--agent-v2-border);
}
.agent-v2-wrapper[data-position="left"] .agent-v2-container {
    border-right: 1px solid var(--agent-v2-border);
}
.agent-v2-wrapper[data-position="fullscreen"] .agent-v2-container {
    border: none;
    border-radius: 0;
    box-shadow: none;
}
.agent-v2-header {
    height: var(--agent-v2-header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: var(--agent-v2-surface);
    border-bottom: 1px solid var(--agent-v2-border);
    flex-shrink: 0;
}
.agent-v2-agent-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
    padding: 6px 8px;
    margin: -6px -8px;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}
.agent-v2-agent-info:hover {
    background-color: rgba(0, 0, 0, 0.05);
}
.agent-v2-agent-info:active {
    background-color: rgba(0, 0, 0, 0.08);
}
.agent-v2-agent-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--agent-v2-border);
    flex-shrink: 0;
}
.agent-v2-agent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.agent-v2-agent-details {
    flex: 1;
    min-width: 0;
}
.agent-v2-agent-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--agent-v2-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.agent-v2-agent-status {
    font-size: 12px;
    color: var(--agent-v2-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.agent-v2-agent-status .status-dot {
    width: 6px;
    height: 6px;
    background: var(--agent-v2-success);
    border-radius: 50%;
}
.agent-v2-agent-selector-icon {
    width: 20px;
    height: 20px;
    color: var(--agent-v2-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: transform 0.2s ease, color 0.15s ease;
    flex-shrink: 0;
}
.agent-v2-agent-info:hover .agent-v2-agent-selector-icon {
    color: var(--agent-v2-text);
    transform: translateY(1px);
}
.agent-v2-header-controls {
    display: flex;
    gap: 4px;
}
.agent-v2-ctrl-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--agent-v2-radius-sm);
    color: var(--agent-v2-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--agent-v2-transition);
}
.agent-v2-ctrl-btn:hover {
    background: var(--agent-v2-bg);
    color: var(--agent-v2-text);
}
.agent-v2-new-chat-btn {
    width: auto;
    padding: 0 14px;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    background: var(--agent-v2-primary) !important;
    color: #fff !important;
    border-radius: 8px;
    height: 34px;
    letter-spacing: 0.02em;
    transition: all var(--agent-v2-transition);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.agent-v2-new-chat-btn:hover {
    background: var(--agent-v2-primary-hover, var(--agent-v2-primary)) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.agent-v2-new-chat-btn i {
    font-size: 11px;
    color: #fff;
}
.agent-v2-new-chat-btn span {
    white-space: nowrap;
    color: #fff;
}
.agent-v2-pin-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--agent-v2-text-muted);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all var(--agent-v2-transition);
    flex-shrink: 0;
    margin-right: 4px;
}
.agent-v2-pin-btn:hover {
    background: var(--agent-v2-surface);
    color: var(--agent-v2-text);
}
.agent-v2-pin-btn.active {
    background: var(--agent-v2-primary);
    color: white;
}
.agent-v2-pin-btn:not(.active) i {
    transform: rotate(45deg);
    opacity: 0.7;
}
.agent-v2-pin-btn.active i {
    transform: rotate(0deg);
    opacity: 1;
}
.agent-v2-close-btn {
    display: none;
}
.agent-v2-options-wrapper {
    position: relative;
}
.agent-v2-options-btn {
    font-size: 15px;
}
.agent-v2-close-header-btn {
    font-size: 15px;
}
.agent-v2-close-header-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}
.agent-v2-options-dropdown {
    display: none;
    position: fixed;
    min-width: 230px;
    background: var(--agent-v2-surface);
    border: 1px solid var(--agent-v2-border);
    border-radius: var(--agent-v2-radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 2147483647;
    padding: 4px 0;
    flex-direction: column;
}
.agent-v2-options-dropdown.open {
    display: flex;
}
.agent-v2-options-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border: none;
    background: transparent;
    color: var(--agent-v2-text);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.12s ease;
    text-align: left;
    width: 100%;
}
.agent-v2-options-item:hover {
    background: var(--agent-v2-bg);
}
.agent-v2-options-item i {
    width: 16px;
    text-align: center;
    color: var(--agent-v2-text-muted);
    font-size: 13px;
    flex-shrink: 0;
}
.agent-v2-options-item span {
    flex: 1;
    white-space: nowrap;
}
.agent-v2-options-item--danger {
    color: var(--agent-v2-error);
}
.agent-v2-options-item--danger i {
    color: var(--agent-v2-error);
}
.agent-v2-options-item--danger:hover {
    background: rgba(239, 68, 68, 0.08);
}
.agent-v2-options-item--active {
    background: var(--agent-v2-bg);
}
.agent-v2-options-item--active i {
    color: var(--agent-v2-primary);
}
.agent-v2-options-item:disabled {
    cursor: default;
    pointer-events: none;
}
.agent-v2-options-divider {
    height: 1px;
    background: var(--agent-v2-border);
    margin: 4px 0;
}
.agent-v2-status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--agent-v2-primary-soft);
    border-bottom: 1px solid var(--agent-v2-border);
    font-size: 12px;
    color: var(--agent-v2-primary-dark);
    flex-shrink: 0;
}
.agent-v2-status-bar i {
    font-size: 14px;
    flex-shrink: 0;
}
.agent-v2-status-bar span {
    flex: 1;
    line-height: 1.4;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--agent-v2-transition);
}
.agent-v2-select-agent-btn:hover {
    border-color: var(--agent-v2-primary);
    background: var(--agent-v2-primary-soft);
}
.agent-v2-select-agent-btn span {
    flex: 1;
    text-align: left;
}
.agent-v2-scope-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
    font-size: 12px;
    color: #374151;
    min-height: 34px;
    flex-wrap: wrap;
    flex-shrink: 0;
    transition: background 0.3s ease, border-color 0.3s ease;
}
.agent-v2-scope-bar.scope-all {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom-color: rgba(245, 158, 11, 0.2);
}
.agent-v2-scope-bar.scope-multi {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-bottom-color: rgba(139, 92, 246, 0.25);
}
.agent-v2-scope-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 2px 4px;
    border-radius: 6px;
    transition: background 0.15s;
}
.agent-v2-scope-toggle:hover {
    background: rgba(0,0,0,0.05);
}
.agent-v2-scope-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 11px;
    flex-shrink: 0;
}
.agent-v2-scope-bar.scope-all .agent-v2-scope-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}
.agent-v2-scope-bar.scope-multi .agent-v2-scope-icon {
    background: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
}
.agent-v2-scope-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.agent-v2-scope-label {
    font-weight: 600;
    color: #1f2937;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    line-height: 1.3;
}
.agent-v2-scope-detail {
    font-size: 10px;
    color: #6b7280;
    white-space: nowrap;
    line-height: 1.2;
}
.agent-v2-scope-chevron {
    font-size: 9px;
    color: #9ca3af;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.agent-v2-scope-chevron.open {
    transform: rotate(180deg);
}
.agent-v2-scope-chips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.agent-v2-scope-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    font-size: 10px;
    color: #5b21b6;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: default;
    transition: background 0.15s;
}
.agent-v2-scope-chip:hover {
    background: rgba(139, 92, 246, 0.18);
}
.agent-v2-scope-chip-more {
    font-style: italic;
    color: #7c3aed;
}
.agent-v2-scope-chip-x {
    background: none;
    border: none;
    cursor: pointer;
    color: #7c3aed;
    font-size: 13px;
    line-height: 1;
    padding: 0 1px;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.agent-v2-scope-chip-x:hover {
    opacity: 1;
    color: #dc2626;
}
.agent-v2-scope-dropdown {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    font-size: 12px;
    z-index: 100;
    flex-shrink: 0;
}
.agent-v2-scope-dd-section {
    padding: 6px 0;
}
.agent-v2-scope-dd-label {
    padding: 4px 14px;
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.agent-v2-scope-dd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.1s;
}
.agent-v2-scope-dd-item:hover {
    background: #f8fafc;
}
.agent-v2-scope-dd-item.active {
    background: #eff6ff;
}
.agent-v2-scope-dd-item > i:first-child {
    width: 18px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    flex-shrink: 0;
}
.agent-v2-scope-dd-item.active > i:first-child {
    color: #3b82f6;
}
.agent-v2-scope-dd-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}
.agent-v2-scope-dd-title {
    font-weight: 500;
    color: #1f2937;
}
.agent-v2-scope-dd-desc {
    font-size: 10px;
    color: #9ca3af;
}
.agent-v2-scope-dd-check {
    color: #3b82f6;
    font-size: 11px;
    opacity: 0;
    flex-shrink: 0;
}
.agent-v2-scope-dd-item.active .agent-v2-scope-dd-check {
    opacity: 1;
}
.agent-v2-scope-dd-arrow {
    color: #9ca3af;
    font-size: 10px;
    flex-shrink: 0;
}
.agent-v2-scope-dd-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 0 10px;
}
.agent-v2-scope-dd-ws-picker {
    padding: 6px 0;
}
.agent-v2-scope-dd-ws-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 8px;
}
.agent-v2-scope-dd-ws-search i {
    color: #9ca3af;
    font-size: 11px;
    flex-shrink: 0;
}
.agent-v2-scope-dd-ws-search input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 12px;
    outline: none;
    background: #f9fafb;
    color: #374151;
    transition: border-color 0.2s;
}
.agent-v2-scope-dd-ws-search input:focus {
    border-color: #3b82f6;
    background: #fff;
}
.agent-v2-scope-dd-ws-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 0 6px;
}
.agent-v2-scope-dd-ws-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.1s;
}
.agent-v2-scope-dd-ws-item:hover {
    background: #f8fafc;
}
.agent-v2-scope-dd-ws-item input[type="checkbox"] {
    accent-color: #3b82f6;
    flex-shrink: 0;
}
.agent-v2-scope-dd-ws-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #374151;
}
.agent-v2-scope-dd-ws-count {
    font-size: 10px;
    color: #9ca3af;
    flex-shrink: 0;
}
.agent-v2-scope-dd-ws-apply {
    padding: 8px 12px 6px;
    display: flex;
    justify-content: flex-end;
}
.agent-v2-scope-dd-apply-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.agent-v2-scope-dd-apply-btn:hover {
    background: #2563eb;
}
.agent-v2-scope-dd-loading,
.agent-v2-scope-dd-empty {
    padding: 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
}
.agent-v2-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--agent-v2-bg);
}
.agent-v2-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 100%;
}
.agent-v2-welcome {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 300px;
    padding: 32px 20px;
    animation: agent-v2-welcome-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.agent-v2-welcome-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 520px;
    gap: 8px;
}
.agent-v2-welcome-logo {
    width: 56px;
    height: 56px;
    margin-bottom: 4px;
    opacity: 0;
    animation: agent-v2-welcome-logo-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s forwards;
}
.agent-v2-welcome-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(91, 155, 213, 0.25));
}
.agent-v2-welcome-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--agent-v2-text);
    margin: 0;
    letter-spacing: -0.02em;
    opacity: 0;
    animation: agent-v2-welcome-fade-up 0.5s ease 0.25s forwards;
}
.agent-v2-welcome-subtitle {
    font-size: 15px;
    color: var(--agent-v2-text-muted);
    margin: 0 0 16px 0;
    opacity: 0;
    animation: agent-v2-welcome-fade-up 0.5s ease 0.35s forwards;
}
.agent-v2-welcome-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 480px;
    opacity: 0;
    animation: agent-v2-welcome-fade-up 0.5s ease 0.45s forwards;
}
.agent-v2-welcome-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--agent-v2-surface);
    border: 1px solid var(--agent-v2-border);
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    color: var(--agent-v2-text);
    transition: all 0.2s ease;
    white-space: nowrap;
    max-width: 230px;
}
.agent-v2-welcome-chip:hover {
    border-color: var(--agent-v2-primary);
    background: var(--agent-v2-primary-soft);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(91, 155, 213, 0.15);
}
.agent-v2-welcome-chip:active {
    transform: translateY(0);
}
.agent-v2-welcome-chip-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--agent-v2-primary-soft);
    color: var(--agent-v2-primary);
    font-size: 12px;
    flex-shrink: 0;
}
.agent-v2-welcome-chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.agent-v2-welcome-leaving {
    animation: agent-v2-welcome-out 0.3s ease forwards;
    pointer-events: none;
}
@keyframes agent-v2-welcome-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes agent-v2-welcome-logo-pop {
    from { opacity: 0; transform: scale(0.6) rotate(-10deg); }
    to { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes agent-v2-welcome-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes agent-v2-welcome-out {
    to { opacity: 0; transform: scale(0.95) translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
    .agent-v2-welcome,
    .agent-v2-welcome-logo,
    .agent-v2-welcome-title,
    .agent-v2-welcome-subtitle,
    .agent-v2-welcome-chips,
    .agent-v2-welcome-leaving {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
@media (max-width: 500px) {
    .agent-v2-welcome-title { font-size: 20px; }
    .agent-v2-welcome-chips { gap: 8px; }
    .agent-v2-welcome-chip {
        padding: 8px 12px;
        font-size: 12px;
        max-width: 200px;
    }
    .agent-v2-welcome-chip-icon {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}
.agent-v2-message {
    max-width: 85%;
    min-width: 0;
    animation: agent-v2-msg-in 0.25s ease;
}
@keyframes agent-v2-msg-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.agent-v2-message.user {
    align-self: flex-end;
}
.agent-v2-message.assistant {
    align-self: flex-start;
}
.agent-v2-msg-content {
    padding: 12px 16px;
    border-radius: var(--agent-v2-radius);
    font-size: 14px;
    line-height: 1.6;
    color: var(--agent-v2-text);
    overflow-x: hidden;
    min-width: 0;
}
.agent-v2-message.user .agent-v2-msg-content {
    background: var(--agent-v2-primary);
    color: white;
    border-radius: var(--agent-v2-radius) var(--agent-v2-radius) 4px var(--agent-v2-radius);
}
.agent-v2-message.assistant .agent-v2-msg-content {
    background: var(--agent-v2-surface);
    border: 1px solid var(--agent-v2-border);
    border-radius: var(--agent-v2-radius) var(--agent-v2-radius) var(--agent-v2-radius) 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.agent-v2-msg-content img {
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    background: #ffffff;
    padding: 8px;
    border: 1px solid var(--agent-v2-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 12px 0;
}
.agent-v2-msg-content a > img {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.agent-v2-msg-content a > img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.agent-v2-msg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 4px;
}
.agent-v2-msg-agent {
    display: flex;
    align-items: center;
    gap: 10px;
}
.agent-v2-msg-agent img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--agent-v2-primary-soft);
}
.agent-v2-msg-agent-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--agent-v2-primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--agent-v2-primary);
    font-size: 32px;
    overflow: hidden;
}
.agent-v2-msg-agent-placeholder img {
    width: 60%;
    height: 60%;
    object-fit: contain;
}
.agent-v2-msg-agent span {
    font-weight: 600;
    font-size: 13px;
    color: var(--agent-v2-text);
}
.agent-v2-tts-btn.loading,
.agent-v2-tts-btn.playing {
    opacity: 1;
}
.agent-v2-message:has(.agent-v2-tts-btn.loading) .agent-v2-msg-actions,
.agent-v2-message:has(.agent-v2-tts-btn.playing) .agent-v2-msg-actions {
    opacity: 1;
}
.agent-v2-tts-btn.loading {
    color: var(--agent-v2-warning) !important;
}
.agent-v2-tts-btn.playing {
    color: var(--agent-v2-success) !important;
    animation: agent-v2-tts-pulse 1s infinite;
}
@keyframes agent-v2-tts-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.agent-v2-msg-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 4px;
    gap: 12px;
}
.agent-v2-msg-time {
    font-size: 10px;
    color: var(--agent-v2-text-light);
    flex-shrink: 0;
}
.agent-v2-message.user .agent-v2-msg-footer {
    justify-content: flex-end;
}
.agent-v2-msg-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.agent-v2-message:hover .agent-v2-msg-actions {
    opacity: 1;
}
.agent-v2-action-btn {
    background: none;
    border: none;
    color: var(--agent-v2-text-light);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.15s ease;
}
.agent-v2-action-btn:hover {
    background: var(--agent-v2-bg-secondary);
    color: var(--agent-v2-text);
}
.agent-v2-action-btn.success {
    color: var(--agent-v2-success);
}
.agent-v2-action-btn.active {
    color: var(--agent-v2-primary);
}
.agent-v2-thumbs-up-btn.active {
    color: var(--agent-v2-success);
}
.agent-v2-thumbs-down-btn.active {
    color: var(--agent-v2-danger, #ef4444);
}
.agent-v2-reasoning {
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--agent-v2-radius);
    overflow: hidden;
}
.agent-v2-reasoning summary {
    cursor: pointer;
    color: #8b5cf6;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(139, 92, 246, 0.05);
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}
.agent-v2-reasoning[open] summary {
    border-bottom-color: rgba(139, 92, 246, 0.15);
}
.agent-v2-reasoning summary:hover {
    background: rgba(139, 92, 246, 0.1);
}
.agent-v2-reasoning summary i {
    font-size: 13px;
    color: #8b5cf6;
}
.agent-v2-reasoning summary::marker,
.agent-v2-reasoning summary::-webkit-details-marker {
    display: none;
}
.agent-v2-reasoning summary::after {
    content: "▶";
    font-size: 10px;
    margin-left: auto;
    transition: transform 0.2s ease;
    color: rgba(139, 92, 246, 0.6);
}
.agent-v2-reasoning[open] summary::after {
    transform: rotate(90deg);
}
.agent-v2-reasoning-content {
    padding: 12px 14px;
    color: var(--agent-v2-text-muted);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}
.agent-v2-msg-meta {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--agent-v2-border);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.agent-v2-tools-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}
.agent-v2-tools-row > i {
    color: var(--agent-v2-text-muted);
    font-size: 12px;
    margin-top: 3px;
}
.agent-v2-tools-label {
    color: var(--agent-v2-text-muted);
    font-weight: 500;
    margin-right: 4px;
}
.agent-v2-tools-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.agent-v2-tool-badge {
    background: rgba(34, 197, 94, 0.12);
    color: var(--agent-v2-success);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-family: 'Fira Code', 'SF Mono', monospace;
    font-weight: 500;
    border: 1px solid rgba(34, 197, 94, 0.2);
}
.agent-v2-stats-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--agent-v2-text-muted);
    font-family: 'Fira Code', 'SF Mono', monospace;
    font-size: 12px;
}
.agent-v2-stats-row > i {
    font-size: 12px;
}
.agent-v2-stats-dot {
    opacity: 0.4;
}
.agent-v2-stats {
    display: flex;
    gap: 12px;
    color: var(--agent-v2-text-muted);
    font-family: 'Fira Code', monospace;
}
.agent-v2-stats span::before {
    content: "•";
    margin-right: 6px;
    opacity: 0.5;
}
.agent-v2-stats span:first-child::before {
    display: none;
}
.agent-v2-tools-used {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}
.agent-v2-thinking {
    margin-bottom: 8px;
}
.agent-v2-thinking summary {
    cursor: pointer;
    color: var(--agent-v2-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}
.agent-v2-thinking-content {
    margin-top: 6px;
    padding: 8px 12px;
    background: var(--agent-v2-primary-soft);
    border-radius: var(--agent-v2-radius-sm);
    color: var(--agent-v2-text-muted);
    font-style: italic;
    white-space: pre-wrap;
    line-height: 1.5;
}
.agent-v2-msg-content h2,
.agent-v2-msg-content h3,
.agent-v2-msg-content h4 {
    margin: 16px 0 8px 0;
    color: var(--agent-v2-text);
}
.agent-v2-msg-content h2 { font-size: 18px; }
.agent-v2-msg-content h3 { font-size: 16px; }
.agent-v2-msg-content h4 { font-size: 14px; }
.agent-v2-msg-content p {
    margin: 8px 0;
}
.agent-v2-msg-content ul,
.agent-v2-msg-content ol {
    margin: 8px 0;
    padding-left: 20px;
}
.agent-v2-msg-content li {
    margin: 4px 0;
}
.agent-v2-msg-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Monaco', monospace;
    font-size: 13px;
}
.agent-v2-msg-content pre {
    margin: 12px 0;
    border-radius: var(--agent-v2-radius-sm);
    overflow: hidden;
}
.agent-v2-msg-content pre code {
    display: block;
    padding: 12px 16px;
    background: #1e1e1e;
    color: #d4d4d4;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
}
.agent-v2-msg-content a {
    color: var(--agent-v2-primary);
    text-decoration: none;
}
.agent-v2-message.user .agent-v2-msg-content a {
    color: rgba(255, 255, 255, 0.9);
}
.agent-v2-message.user .agent-v2-msg-content a:hover {
    color: white;
    text-decoration: underline;
}
.agent-v2-msg-content a:hover {
    text-decoration: underline;
}
.agent-v2-msg-content strong {
    font-weight: 600;
}
.agent-v2-msg-content em {
    font-style: italic;
}
.agent-v2-msg-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}
.agent-v2-msg-content th,
.agent-v2-msg-content td {
    padding: 8px 12px;
    border: 1px solid var(--agent-v2-border);
    text-align: left;
}
.agent-v2-msg-content th {
    background: var(--agent-v2-bg);
    font-weight: 600;
}
.agent-v2-progress-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 8px 0 8px 6px;
    margin-bottom: 8px;
    position: relative;
}
.agent-v2-progress-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 0;
    font-size: 13px;
    color: #9ca3af;
    cursor: pointer;
    user-select: none;
    border-radius: 6px;
    transition: background 0.15s ease;
}
.agent-v2-progress-summary:hover {
    background: rgba(255,255,255,0.03);
}
.agent-v2-progress-summary-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1.5px solid #6b7280;
    font-size: 9px;
    flex-shrink: 0;
    color: #6b7280;
    transition: all 0.3s ease;
}
.agent-v2-progress-container:not(.done) .agent-v2-progress-summary-icon {
    border-color: #a78bfa;
    color: #a78bfa;
}
.agent-v2-progress-container.done .agent-v2-progress-summary-icon {
    border-color: #22c55e;
    color: #22c55e;
}
.agent-v2-progress-summary-text {
    flex: 1;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.agent-v2-progress-summary-timer {
    font-size: 11px;
    color: #4b5563;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.agent-v2-progress-summary-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #4b5563;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.agent-v2-progress-container:not(.collapsed) .agent-v2-progress-summary-toggle {
    transform: rotate(180deg);
}
.agent-v2-progress-details-list {
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    position: relative;
}
.agent-v2-progress-container.collapsed .agent-v2-progress-details-list {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}
.agent-v2-progress-container:not(.collapsed) .agent-v2-progress-details-list {
    max-height: 600px;
    opacity: 1;
}
.agent-v2-progress-details-list::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(180deg, rgba(59,130,246,0.3) 0%, rgba(34,197,94,0.3) 100%);
    border-radius: 1px;
}
.agent-v2-progress-container::before {
    display: none;
}
.agent-v2-progress-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 10px 7px 0;
    font-size: 13px;
    color: #9ca3af;
    background: transparent;
    position: relative;
    z-index: 1;
    animation: agent-v2-slide-in 0.3s ease-out both;
    transition: opacity 0.3s ease;
}
@keyframes agent-v2-slide-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes agent-v2-slide-out {
    0% {
        opacity: 1;
        max-height: 50px;
        transform: translateY(0);
        padding-top: 7px;
        padding-bottom: 7px;
    }
    50% {
        opacity: 0;
        transform: translateY(-6px);
    }
    100% {
        opacity: 0;
        max-height: 0;
        transform: translateY(-6px);
        padding-top: 0;
        padding-bottom: 0;
    }
}
.agent-v2-progress-item.evicting {
    animation: agent-v2-slide-out 0.35s ease-in forwards;
    overflow: hidden;
    pointer-events: none;
}
.agent-v2-progress-item.active {
    color: #e5e7eb;
}
.agent-v2-progress-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.04) 50%,
        transparent 100%
    );
    animation: agent-v2-shimmer 2s infinite;
    z-index: -1;
}
@keyframes agent-v2-shimmer {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}
.agent-v2-progress-item.completed {
    color: #6b7280;
}
.agent-v2-progress-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 10px;
    border-radius: 50%;
    background: #1f2937;
    border: 2px solid #374151;
    transition: all 0.3s ease;
    position: relative;
}
.agent-v2-progress-icon i {
    font-size: 9px;
    transition: transform 0.3s ease;
}
.agent-v2-progress-item.active[data-type="thinking"] .agent-v2-progress-icon {
    border-color: #a78bfa;
    color: #a78bfa;
    box-shadow: 0 0 8px rgba(167, 139, 250, 0.3);
}
.agent-v2-progress-item.active[data-type="search"] .agent-v2-progress-icon,
.agent-v2-progress-item.active[data-type="search_start"] .agent-v2-progress-icon {
    border-color: #3b82f6;
    color: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}
.agent-v2-progress-item.active[data-type="tool"] .agent-v2-progress-icon,
.agent-v2-progress-item.active[data-type="tool_start"] .agent-v2-progress-icon {
    border-color: #f59e0b;
    color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}
.agent-v2-progress-item.active[data-type="analyze"] .agent-v2-progress-icon,
.agent-v2-progress-item.active[data-type="analyzing"] .agent-v2-progress-icon {
    border-color: #06b6d4;
    color: #06b6d4;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}
.agent-v2-progress-item.active[data-type="generate"] .agent-v2-progress-icon,
.agent-v2-progress-item.active[data-type="generating"] .agent-v2-progress-icon {
    border-color: #10b981;
    color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}
.agent-v2-progress-item.active[data-type="fetch"] .agent-v2-progress-icon {
    border-color: #8b5cf6;
    color: #8b5cf6;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}
.agent-v2-progress-item.active .agent-v2-progress-icon::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid currentColor;
    opacity: 0;
    animation: agent-v2-pulse 1.5s ease-out infinite;
}
@keyframes agent-v2-pulse {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.4); opacity: 0; }
}
.agent-v2-progress-item.completed .agent-v2-progress-icon {
    border-color: #22c55e;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    box-shadow: none;
    animation: agent-v2-check-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes agent-v2-check-pop {
    0% { transform: scale(0.5); opacity: 0.5; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
.agent-v2-progress-icon i.fa-spin {
    animation: agent-v2-icon-spin 1s infinite linear;
}
@keyframes agent-v2-icon-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.agent-v2-progress-content {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}
.agent-v2-progress-text {
    display: flex;
    align-items: center;
    gap: 6px;
}
.agent-v2-progress-label {
    font-weight: 500;
    color: inherit;
    font-size: 12.5px;
    line-height: 1.4;
}
.agent-v2-progress-value {
    color: #6b7280;
    font-weight: 400;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}
.agent-v2-progress-timer {
    font-size: 11px;
    color: #4b5563;
    margin-left: auto;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    padding-top: 3px;
}
.agent-v2-progress-item.active .agent-v2-progress-timer {
    color: #6b7280;
}
.agent-v2-progress-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
    margin-left: 2px;
    border-radius: 4px;
    padding-top: 2px;
}
.agent-v2-progress-toggle:hover {
    opacity: 1;
    background: rgba(255,255,255,0.05);
}
.agent-v2-progress-item.expanded .agent-v2-progress-toggle {
    transform: rotate(180deg);
}
.agent-v2-progress-details {
    display: none;
    margin-top: 6px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    border-left: 2px solid rgba(59, 130, 246, 0.3);
    font-size: 11.5px;
    color: #9ca3af;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    animation: agent-v2-details-open 0.2s ease-out;
}
@keyframes agent-v2-details-open {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 200px; }
}
.agent-v2-progress-item.expanded .agent-v2-progress-details {
    display: block;
}
.agent-v2-progress-details pre {
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 11px;
    line-height: 1.4;
}
.agent-v2-progress-details a {
    color: #60a5fa;
    text-decoration: none;
}
.agent-v2-progress-details a:hover {
    text-decoration: underline;
}
@media (prefers-reduced-motion: reduce) {
    .agent-v2-progress-item,
    .agent-v2-progress-item.completed .agent-v2-progress-icon {
        animation: none;
    }
    .agent-v2-progress-item.active::after {
        animation: none;
        opacity: 0.5;
    }
    .agent-v2-progress-item.active .agent-v2-progress-icon::after {
        animation: none;
    }
}
.agent-v2-source-item {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.agent-v2-source-item:last-child {
    border-bottom: none;
}
.agent-v2-source-name {
    font-weight: 500;
    color: #d1d5db;
}
.agent-v2-source-score {
    font-size: 11px;
    color: #6b7280;
    margin-left: 8px;
}
.agent-v2-typing {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    width: fit-content;
    box-shadow: none;
}
.agent-v2-typing-icon {
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 0;
    color: #9ca3af;
    font-size: 12px;
}
.agent-v2-typing-icon i {
    animation: agent-v2-icon-spin 1s infinite linear;
}
.agent-v2-typing-text {
    font-size: 13px;
    font-weight: 400;
    color: #9ca3af;
}
.agent-v2-typing-timer {
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    color: #9ca3af;
    background: transparent;
    padding: 0;
    border-radius: 0;
    min-width: auto;
    text-align: left;
}
.agent-v2-cursor {
    display: inline;
    color: var(--agent-v2-primary);
    font-weight: normal;
    animation: agent-v2-cursor-blink 0.8s infinite;
    margin-left: 1px;
}
@keyframes agent-v2-cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
.agent-v2-msg-content.agent-v2-typing {
    display: block;
    min-height: 40px;
    padding: 12px 16px !important;
    background: var(--agent-v2-surface) !important;
    border: 1px solid var(--agent-v2-border) !important;
    border-radius: var(--agent-v2-radius) var(--agent-v2-radius) var(--agent-v2-radius) 4px !important;
}
.agent-v2-table-wrapper {
    overflow-x: auto;
    margin: 12px 0;
    max-width: 100%;
}
.agent-v2-table-wrapper table {
    margin: 0;
    font-size: 12px;
}
.agent-v2-table-truncated {
    text-align: center;
    padding: 8px 0;
    font-size: 12px;
    color: var(--agent-v2-text-light, #6b7280);
}
.agent-v2-table-show-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border: 1px solid var(--agent-v2-border, #e5e7eb);
    border-radius: 6px;
    background: var(--agent-v2-surface, #f9fafb);
    color: var(--agent-v2-accent, #6366f1);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.agent-v2-table-show-more:hover {
    background: var(--agent-v2-accent, #6366f1);
    color: white;
    border-color: var(--agent-v2-accent, #6366f1);
}
.agent-v2-footer {
    padding: 8px 12px 6px;
    background: var(--agent-v2-surface);
    border-top: none;
    flex-shrink: 0;
}
.agent-v2-input-container {
    display: flex;
    flex-direction: column;
    background: var(--agent-v2-bg);
    border: 1.5px solid var(--agent-v2-border);
    border-radius: 20px;
    padding: 0;
    transition: border-color var(--agent-v2-transition), box-shadow var(--agent-v2-transition);
    overflow: visible;
    position: relative;
}
.agent-v2-input-container:focus-within {
    border-color: var(--agent-v2-primary);
    box-shadow: 0 0 0 2px rgba(91,155,213,0.12);
}
.agent-v2-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--agent-v2-text);
    resize: none;
    outline: none;
    min-height: 28px;
    max-height: 80px;
    line-height: 1.5;
    padding: 12px 16px 4px;
    width: 100%;
    box-sizing: border-box;
}
.agent-v2-input::placeholder {
    color: var(--agent-v2-text-light);
}
.agent-v2-input-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 8px 6px;
    gap: 4px;
}
.agent-v2-input-bottom-left {
    display: flex;
    align-items: center;
    gap: 2px;
}
.agent-v2-input-bottom-right {
    display: flex;
    align-items: center;
    gap: 4px;
}
.agent-v2-send-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--agent-v2-primary);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--agent-v2-transition), transform 0.1s ease;
    flex-shrink: 0;
    font-size: 14px;
}
.agent-v2-send-btn:hover {
    background: var(--agent-v2-primary-dark);
    transform: scale(1.05);
}
.agent-v2-tier-selector {
    position: relative;
}
.agent-v2-tier-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid var(--agent-v2-border);
    border-radius: 8px;
    padding: 3px 10px 3px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--agent-v2-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    height: 28px;
}
.agent-v2-tier-btn:hover {
    border-color: var(--agent-v2-primary);
    color: var(--agent-v2-text);
}
.agent-v2-tier-btn.active {
    color: var(--agent-v2-primary);
}
.agent-v2-tier-chevron {
    font-size: 9px;
    transition: transform 0.2s ease;
}
.agent-v2-tier-dropdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    background: var(--agent-v2-surface);
    border: 1px solid var(--agent-v2-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 6px;
    z-index: 9999;
}
.agent-v2-tier-dropdown.open {
    display: block;
}
.agent-v2-tier-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s ease;
    font-size: 13px;
    color: var(--agent-v2-text);
}
.agent-v2-tier-option:hover:not(.disabled) {
    background: var(--agent-v2-primary-soft);
}
.agent-v2-tier-option.active {
    background: var(--agent-v2-primary-soft);
    font-weight: 600;
}
.agent-v2-tier-option.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.agent-v2-tier-option > i:first-child {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: var(--agent-v2-primary);
}
.agent-v2-tier-option.disabled > i:first-child {
    color: var(--agent-v2-text-muted);
}
.agent-v2-tier-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.agent-v2-tier-name {
    font-weight: 600;
    font-size: 13px;
}
.agent-v2-tier-desc {
    font-size: 11px;
    color: var(--agent-v2-text-muted);
}
.agent-v2-tier-badge {
    font-size: 10px;
    font-weight: 600;
    background: var(--agent-v2-border);
    color: var(--agent-v2-text-muted);
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}
.agent-v2-tier-check {
    color: var(--agent-v2-primary);
    font-size: 13px;
}
.agent-v2-mic-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: var(--agent-v2-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--agent-v2-transition);
    flex-shrink: 0;
    font-size: 14px;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}
.agent-v2-mic-btn:hover {
    background: var(--agent-v2-primary-soft);
    color: var(--agent-v2-primary);
    border-color: var(--agent-v2-primary);
}
.agent-v2-mic-btn.recording {
    background: var(--agent-v2-error);
    color: white;
    border-color: var(--agent-v2-error);
    animation: agent-v2-mic-pulse 1s infinite;
}
@keyframes agent-v2-mic-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}
.agent-v2-mic-btn.transcribing {
    background: var(--agent-v2-warning);
    color: white;
    border-color: var(--agent-v2-warning);
    cursor: wait;
}
.agent-v2-stt-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-top: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--agent-v2-radius-sm);
    color: var(--agent-v2-error);
    font-size: 12px;
    animation: agent-v2-stt-error-in 0.3s ease;
}
@keyframes agent-v2-stt-error-in {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.agent-v2-stt-error i {
    font-size: 14px;
}
.agent-v2-footer-hint {
    margin-top: 4px;
    text-align: center;
    font-size: 11px;
    color: var(--agent-v2-text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
}
.agent-v2-disclaimer {
    opacity: 0.65;
    font-size: 11px;
}
.agent-v2-session-debug {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 10px;
    color: var(--agent-v2-text-light);
    opacity: 0.6;
}
.agent-v2-session-debug:hover {
    opacity: 1;
}
.agent-v2-session-id {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.agent-v2-copy-session-btn {
    background: none;
    border: none;
    color: var(--agent-v2-text-light);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 10px;
    border-radius: 3px;
    transition: all 0.2s ease;
}
.agent-v2-copy-session-btn:hover {
    background: var(--agent-v2-primary-soft);
    color: var(--agent-v2-primary);
}
.agent-v2-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2147483647; 
    display: none;
}
.agent-v2-selector-modal.open {
    display: flex;
    align-items: center;
    justify-content: center;
}
.agent-v2-selector-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}
.agent-v2-selector-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: var(--agent-v2-surface);
    border-radius: var(--agent-v2-radius-lg);
    box-shadow: var(--agent-v2-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: agent-v2-modal-in 0.2s ease;
}
@keyframes agent-v2-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.agent-v2-selector-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--agent-v2-border);
}
.agent-v2-selector-search {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--agent-v2-border);
    border-radius: var(--agent-v2-radius-sm);
    background: var(--agent-v2-bg);
    color: var(--agent-v2-text);
    font-size: 14px;
    outline: none;
}
.agent-v2-selector-search:focus {
    border-color: var(--agent-v2-primary);
}
.agent-v2-selector-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--agent-v2-radius-sm);
    color: var(--agent-v2-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.agent-v2-selector-close:hover {
    background: var(--agent-v2-bg);
    color: var(--agent-v2-text);
}
.agent-v2-selector-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}
.agent-v2-selector-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
    color: var(--agent-v2-text-muted);
}
.agent-v2-selector-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 12px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--agent-v2-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid var(--agent-v2-border);
    margin-top: 8px;
}
.agent-v2-selector-section:first-of-type {
    border-top: none;
    margin-top: 0;
}
.agent-v2-selector-section i {
    font-size: 12px;
    color: var(--agent-v2-primary);
}
.agent-v2-selector-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--agent-v2-radius-sm);
    cursor: pointer;
    transition: all var(--agent-v2-transition);
    border: 1px solid transparent;
}
.agent-v2-selector-item:hover {
    background: var(--agent-v2-bg);
    border-color: var(--agent-v2-border);
}
.agent-v2-selector-item.auto-routing {
    background: linear-gradient(135deg, var(--agent-v2-primary-soft) 0%, rgba(91, 155, 213, 0.15) 100%);
    border: 1px solid var(--agent-v2-primary);
    margin-bottom: 12px;
}
.agent-v2-selector-item.auto-routing:hover {
    background: linear-gradient(135deg, rgba(91, 155, 213, 0.2) 0%, rgba(91, 155, 213, 0.25) 100%);
}
.agent-v2-selector-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--agent-v2-border);
    flex-shrink: 0;
    background: var(--agent-v2-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.agent-v2-selector-avatar.auto {
    background: linear-gradient(135deg, var(--agent-v2-primary) 0%, #3a7bc8 100%);
    border-color: var(--agent-v2-primary);
    color: white;
    font-size: 18px;
}
.agent-v2-selector-avatar.custom {
    border-color: #10b981;
}
.agent-v2-selector-avatar.core {
    border-color: var(--agent-v2-primary);
}
.agent-v2-selector-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.agent-v2-selector-info {
    flex: 1;
    min-width: 0;
}
.agent-v2-selector-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--agent-v2-text);
    margin-bottom: 2px;
}
.agent-v2-selector-desc {
    font-size: 12px;
    color: var(--agent-v2-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.agent-v2-selector-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--agent-v2-bg);
    color: var(--agent-v2-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}
.agent-v2-selector-badge.featured {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}
.agent-v2-selector-category {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--agent-v2-text-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.agent-v2-selector-industry {
    border-radius: var(--agent-v2-radius-sm);
    overflow: hidden;
    margin-bottom: 4px;
    border: 1px solid var(--agent-v2-border);
    background: var(--agent-v2-surface);
}
.agent-v2-selector-industry.expanded {
    border-color: var(--agent-v2-primary);
    box-shadow: 0 2px 8px rgba(91, 155, 213, 0.15);
}
.agent-v2-selector-industry-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
    transition: background var(--agent-v2-transition);
}
.agent-v2-selector-industry-header:hover {
    background: var(--agent-v2-bg);
}
.agent-v2-industry-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--agent-v2-radius-sm);
    overflow: hidden;
    border: 1px solid var(--agent-v2-border);
    background: var(--agent-v2-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.agent-v2-industry-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.agent-v2-industry-avatar i {
    font-size: 16px;
    color: var(--agent-v2-text-muted);
}
.agent-v2-industry-info {
    flex: 1;
    min-width: 0;
}
.agent-v2-industry-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--agent-v2-text);
    display: block;
}
.agent-v2-industry-stats {
    font-size: 11px;
    color: var(--agent-v2-text-muted);
}
.agent-v2-industry-chevron {
    color: var(--agent-v2-text-muted);
    font-size: 12px;
    transition: transform var(--agent-v2-transition);
}
.agent-v2-selector-industry.expanded .agent-v2-industry-chevron {
    transform: rotate(180deg);
}
.agent-v2-selector-agents {
    border-top: 1px solid var(--agent-v2-border);
    background: var(--agent-v2-bg);
    padding: 8px;
    max-height: 300px;
    overflow-y: auto;
}
.agent-v2-selector-agents .agent-v2-selector-item {
    background: var(--agent-v2-surface);
    margin-bottom: 4px;
    border: 1px solid var(--agent-v2-border);
}
.agent-v2-selector-agents .agent-v2-selector-item:last-child {
    margin-bottom: 0;
}
.agent-v2-selector-agents .agent-v2-selector-item:hover {
    border-color: var(--agent-v2-primary);
    box-shadow: 0 2px 4px rgba(91, 155, 213, 0.1);
}
.agent-v2-selector-loading.small {
    padding: 20px;
    font-size: 12px;
}
.agent-v2-selector-industry-header:hover {
    background: var(--agent-v2-bg);
}
.agent-v2-selector-industry-header img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
}
.agent-v2-selector-industry-header i:first-child {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--agent-v2-bg);
    border-radius: 6px;
    color: var(--agent-v2-text-muted);
}
.agent-v2-selector-industry-header span {
    flex: 1;
    font-size: 14px;
    color: var(--agent-v2-text);
}
.agent-v2-selector-count {
    font-size: 12px;
    color: var(--agent-v2-text-light);
    background: var(--agent-v2-bg);
    padding: 2px 8px;
    border-radius: 10px;
}
.agent-v2-selector-industry-header i:last-child {
    color: var(--agent-v2-text-light);
    font-size: 12px;
    transition: transform var(--agent-v2-transition);
}
.agent-v2-selector-industry.expanded .agent-v2-selector-industry-header i:last-child {
    transform: rotate(90deg);
}
.agent-v2-selector-agents {
    padding: 4px 0 4px 40px;
    background: var(--agent-v2-bg);
}
.agent-v2-body::-webkit-scrollbar,
.agent-v2-selector-body::-webkit-scrollbar {
    width: 6px;
}
.agent-v2-body::-webkit-scrollbar-track,
.agent-v2-selector-body::-webkit-scrollbar-track {
    background: transparent;
}
.agent-v2-body::-webkit-scrollbar-thumb,
.agent-v2-selector-body::-webkit-scrollbar-thumb {
    background: var(--agent-v2-border);
    border-radius: 3px;
}
.agent-v2-body::-webkit-scrollbar-thumb:hover,
.agent-v2-selector-body::-webkit-scrollbar-thumb:hover {
    background: var(--agent-v2-text-light);
}
.agent-v2-selector-columns {
    display: flex;
    gap: 16px;
    padding: 0 8px;
}
.agent-v2-selector-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.agent-v2-selector-column-left {
    flex: 1.2; 
}
.agent-v2-selector-column-right {
    flex: 0.8;
}
.agent-v2-selector-column-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--agent-v2-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid var(--agent-v2-border);
    margin-bottom: 4px;
}
.agent-v2-selector-column-header i {
    font-size: 14px;
}
.agent-v2-selector-count {
    font-weight: 400;
    opacity: 0.7;
}
.agent-v2-selector-item.standard-agent {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(155, 89, 182, 0.1));
    border: 1px solid rgba(52, 152, 219, 0.2);
}
.agent-v2-selector-item.standard-agent:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.2), rgba(155, 89, 182, 0.2));
    border-color: rgba(52, 152, 219, 0.4);
}
.agent-v2-selector-item.standard-agent.selected {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.3), rgba(155, 89, 182, 0.3));
    border-color: var(--agent-v2-primary);
}
.agent-v2-selector-avatar.standard {
    background: linear-gradient(135deg, #3498db, #9b59b6);
    color: white;
}
.agent-v2-selector-item.create-agent {
    border: 2px dashed var(--agent-v2-border);
    background: transparent;
}
.agent-v2-selector-item.create-agent:hover {
    border-color: var(--agent-v2-primary);
    background: rgba(var(--agent-v2-primary-rgb, 52, 152, 219), 0.1);
}
.agent-v2-selector-avatar.create {
    background: transparent;
    border: 2px dashed var(--agent-v2-text-muted);
    color: var(--agent-v2-text-muted);
}
.agent-v2-selector-item.create-agent:hover .agent-v2-selector-avatar.create {
    border-color: var(--agent-v2-primary);
    color: var(--agent-v2-primary);
}
.agent-v2-selector-badge.recommended {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.agent-v2-selector-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    color: var(--agent-v2-text-muted);
    font-size: 13px;
    text-align: center;
}
.agent-v2-selector-empty i {
    font-size: 24px;
    opacity: 0.5;
}
.agent-v2-agent-header.locked {
    opacity: 0.7;
    cursor: not-allowed;
}
.agent-v2-agent-header.locked::after {
    content: '🔒';
    margin-left: 8px;
    font-size: 12px;
}
.agent-v2-selector-content {
    max-width: 700px !important;
}
@media (max-width: 768px) {
    .agent-v2-wrapper[data-position="right"],
    .agent-v2-wrapper[data-position="left"] {
        width: 100% !important;
    }
    .agent-v2-splitter {
        display: none;
    }
    .agent-v2-sidebar {
        display: none !important;
    }
    .agent-v2-selector-content {
        width: 100%;
        max-width: none !important;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }
    .agent-v2-selector-columns {
        flex-direction: column;
    }
    .agent-v2-selector-column-left,
    .agent-v2-selector-column-right {
        flex: 1;
    }
    .agent-v2-doc-card {
        min-width: 150px;
        flex: 1 1 150px;
    }
    .agent-v2-suggestion-btn {
        white-space: normal;
        text-align: left;
    }
}
.agent-v2-feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
}
.agent-v2-feedback-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}
.agent-v2-feedback-dialog {
    position: relative;
    background: var(--agent-v2-bg);
    border-radius: var(--agent-v2-radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow: hidden;
    animation: agent-v2-modal-appear 0.2s ease;
}
@keyframes agent-v2-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.agent-v2-feedback-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--agent-v2-border);
}
.agent-v2-feedback-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--agent-v2-text);
}
.agent-v2-feedback-close {
    background: none;
    border: none;
    color: var(--agent-v2-text-light);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    border-radius: 4px;
    transition: all 0.15s ease;
}
.agent-v2-feedback-close:hover {
    background: var(--agent-v2-bg-secondary);
    color: var(--agent-v2-text);
}
.agent-v2-feedback-body {
    padding: 20px;
}
.agent-v2-feedback-body label {
    display: block;
    font-size: 13px;
    color: var(--agent-v2-text-muted);
    margin-bottom: 8px;
}
.agent-v2-feedback-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--agent-v2-border);
    border-radius: var(--agent-v2-radius-sm);
    background: var(--agent-v2-bg);
    color: var(--agent-v2-text);
    font-size: 14px;
    margin-bottom: 16px;
    cursor: pointer;
}
.agent-v2-feedback-select:focus {
    outline: none;
    border-color: var(--agent-v2-primary);
    box-shadow: 0 0 0 3px var(--agent-v2-primary-soft);
}
.agent-v2-feedback-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--agent-v2-border);
    border-radius: var(--agent-v2-radius-sm);
    background: var(--agent-v2-bg);
    color: var(--agent-v2-text);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}
.agent-v2-feedback-textarea:focus {
    outline: none;
    border-color: var(--agent-v2-primary);
    box-shadow: 0 0 0 3px var(--agent-v2-primary-soft);
}
.agent-v2-feedback-textarea::placeholder {
    color: var(--agent-v2-text-light);
}
.agent-v2-feedback-hint {
    margin-top: 12px;
    font-size: 11px;
    color: var(--agent-v2-text-light);
    font-style: italic;
}
.agent-v2-feedback-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--agent-v2-border);
    background: var(--agent-v2-bg-secondary);
}
.agent-v2-feedback-cancel {
    padding: 8px 16px;
    background: none;
    border: 1px solid var(--agent-v2-border);
    border-radius: var(--agent-v2-radius-sm);
    color: var(--agent-v2-text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.agent-v2-feedback-cancel:hover {
    background: var(--agent-v2-bg);
    border-color: var(--agent-v2-text-light);
}
.agent-v2-feedback-submit {
    padding: 8px 20px;
    background: var(--agent-v2-primary);
    border: none;
    border-radius: var(--agent-v2-radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.agent-v2-feedback-submit:hover {
    background: var(--agent-v2-primary-dark, #4a8ac7);
    transform: translateY(-1px);
}
@media print {
    .agent-v2-wrapper,
    .agent-v2-trigger {
        display: none !important;
    }
}
@keyframes agent-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.agent-v2-fade-in {
    animation: agent-fade-in 0.4s ease-out forwards;
}
.agent-v2-fade-in .agent-v2-msg-content {
    animation: agent-fade-in 0.5s ease-out 0.1s forwards;
    opacity: 0;
}
.agent-v2-streaming .agent-v2-msg-content {
    min-height: 28px;
}
.agent-v2-stream-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: #60a5fa;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: agent-v2-cursor-blink 0.7s step-end infinite;
    border-radius: 1px;
}
@keyframes agent-v2-cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .agent-v2-stream-cursor {
        animation: none;
        opacity: 0.7;
    }
}
.agent-v2-suggestions {
    padding: 8px 16px 12px;
    animation: agent-fade-in 0.3s ease-out forwards;
}
.agent-v2-suggestions-label {
    font-size: 11px;
    color: var(--agent-v2-text-secondary, #94a3b8);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.agent-v2-suggestions-label i {
    color: #f59e0b;
    font-size: 10px;
}
.agent-v2-suggestions-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.agent-v2-suggestion-btn {
    padding: 6px 14px;
    background: var(--agent-v2-bg-secondary, #f1f5f9);
    border: 1px solid var(--agent-v2-border, #e2e8f0);
    border-radius: 16px;
    color: var(--agent-v2-text-primary, #334155);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.agent-v2-suggestion-btn:hover {
    background: var(--agent-v2-primary, #5b9bd5);
    color: white;
    border-color: var(--agent-v2-primary, #5b9bd5);
    transform: translateY(-1px);
}
.agent-v2-doc-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}
.agent-v2-doc-card {
    background: var(--agent-v2-bg-secondary, #f8fafc);
    border: 1px solid var(--agent-v2-border, #e2e8f0);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 180px;
    max-width: 300px;
    flex: 1 1 180px;
}
.agent-v2-doc-card:hover {
    border-color: var(--agent-v2-primary, #5b9bd5);
    box-shadow: 0 2px 8px rgba(91, 155, 213, 0.15);
    transform: translateY(-1px);
}
.agent-v2-doc-card-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--agent-v2-bg-tertiary, #e2e8f0);
}
.agent-v2-doc-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.agent-v2-doc-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--agent-v2-text-primary, #1e293b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.agent-v2-doc-card-meta {
    font-size: 11px;
    color: var(--agent-v2-text-secondary, #64748b);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.agent-v2-doc-card-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
}
.agent-v2-doc-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    align-self: flex-start;
}
.agent-v2-doc-card-badge.paid { background: #dcfce7; color: #16a34a; }
.agent-v2-doc-card-badge.open { background: #fef3c7; color: #d97706; }
.agent-v2-doc-card-badge.overdue { background: #fee2e2; color: #dc2626; }
html.dark-side .agent-v2-doc-card-badge.paid,
[data-theme="dark"] .agent-v2-doc-card-badge.paid { background: rgba(22, 163, 74, 0.2); color: #4ade80; }
html.dark-side .agent-v2-doc-card-badge.open,
[data-theme="dark"] .agent-v2-doc-card-badge.open { background: rgba(217, 119, 6, 0.2); color: #fbbf24; }
html.dark-side .agent-v2-doc-card-badge.overdue,
[data-theme="dark"] .agent-v2-doc-card-badge.overdue { background: rgba(220, 38, 38, 0.2); color: #f87171; }
.agent-v2-action-btns-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--agent-v2-border, #e2e8f0);
}
.agent-v2-inline-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: var(--agent-v2-bg-secondary, #f1f5f9);
    border: 1px solid var(--agent-v2-border, #e2e8f0);
    border-radius: var(--agent-v2-radius-sm, 8px);
    color: var(--agent-v2-primary, #5b9bd5);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.agent-v2-inline-action-btn:hover {
    background: var(--agent-v2-primary, #5b9bd5);
    color: white;
    border-color: var(--agent-v2-primary, #5b9bd5);
}
.agent-v2-inline-action-btn i {
    font-size: 11px;
}
.agent-v2-code-copy-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--agent-v2-bg-secondary);
    border: 1px solid var(--agent-v2-border);
    border-radius: var(--agent-v2-radius-sm, 8px);
    color: var(--agent-v2-text-secondary, #64748b);
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
    z-index: 2;
}
pre:hover .agent-v2-code-copy-btn,
.agent-v2-code-copy-btn:focus-visible {
    opacity: 1;
}
.agent-v2-code-copy-btn:hover {
    background: var(--agent-v2-primary, #5b9bd5);
    color: white;
    border-color: var(--agent-v2-primary, #5b9bd5);
}
.agent-v2-code-copy-btn.success {
    opacity: 1;
    background: var(--agent-v2-success, #22c55e);
    color: white;
    border-color: var(--agent-v2-success, #22c55e);
}
.agent-v2-code-lang {
    font-family: monospace;
    text-transform: uppercase;
    font-size: 10px;
    opacity: 0.7;
}
.agent-v2-retry-container {
    margin-top: 8px;
}
.agent-v2-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: transparent;
    border: 1px solid var(--agent-v2-border);
    border-radius: var(--agent-v2-radius-sm, 8px);
    color: var(--agent-v2-primary, #5b9bd5);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.agent-v2-retry-btn:hover {
    background: var(--agent-v2-primary, #5b9bd5);
    color: white;
    border-color: var(--agent-v2-primary, #5b9bd5);
}
.agent-v2-drop-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 100;
    background: rgba(91, 155, 213, 0.12);
    border: 2px dashed var(--agent-v2-primary, #5b9bd5);
    border-radius: var(--agent-v2-radius, 16px);
    align-items: center;
    justify-content: center;
    pointer-events: none;
    backdrop-filter: blur(2px);
}
.agent-v2-drop-overlay.visible {
    display: flex;
}
.agent-v2-drop-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--agent-v2-primary, #5b9bd5);
    font-size: 14px;
    font-weight: 600;
}
.agent-v2-drop-overlay-content i {
    font-size: 36px;
    opacity: 0.8;
}
.agent-v2-drop-overlay-content small {
    font-weight: 400;
    font-size: 11px;
    opacity: 0.7;
}
.agent-v2-attach-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--agent-v2-text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.15s ease;
    flex-shrink: 0;
    font-size: 14px;
}
.agent-v2-attach-btn:hover {
    background: var(--agent-v2-hover, rgba(0,0,0,0.06));
    color: var(--agent-v2-primary, #5b9bd5);
}
.agent-v2-attachment-bar {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    overflow-x: auto;
    border-bottom: 1px solid var(--agent-v2-border, #e0e0e0);
    scrollbar-width: thin;
}
.agent-v2-attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: var(--agent-v2-bg-secondary, #f5f5f5);
    border-radius: 8px;
    border: 1px solid var(--agent-v2-border, #e0e0e0);
    min-width: 0;
    max-width: 200px;
    flex-shrink: 0;
    position: relative;
}
.agent-v2-attachment-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.agent-v2-attachment-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e74c3c15;
    color: #e74c3c;
    border-radius: 4px;
    font-size: 18px;
    flex-shrink: 0;
}
.agent-v2-attachment-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}
.agent-v2-attachment-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--agent-v2-text, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.agent-v2-attachment-size {
    font-size: 10px;
    color: var(--agent-v2-text-secondary, #888);
}
.agent-v2-attachment-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--agent-v2-border, #ddd);
    background: var(--agent-v2-bg, white);
    color: var(--agent-v2-text-secondary, #888);
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
}
.agent-v2-attachment-remove:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}
.agent-v2-attachment-toast {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: #e74c3c;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 200;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: agent-toast-in 0.3s ease, agent-toast-out 0.3s ease 3.5s forwards;
}
@keyframes agent-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes agent-toast-out {
    from { opacity: 1; }
    to { opacity: 0; }
}
.agent-v2-stop-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 4px;
}
.agent-v2-stop-btn:hover {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}
.agent-v2-stop-btn i {
    font-size: 11px;
}
