/**
 * ============================================================
 * PaperOffice Agent v2 - CSS Component
 * ============================================================
 * Claude-like Chat Widget mit modernem Design
 * ============================================================
 */

/* ============================================================
   CSS Variables
   ============================================================ */
: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;
    
    /* 2026-02-15: Fehlende Variablen fuer DocCards, Suggestions, ActionButtons */
    --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;
}

/* Dark Mode */
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);
    
    /* 2026-02-15: Darkmode fuer DocCards, Suggestions, ActionButtons */
    --agent-v2-bg-secondary: #2a2e35;
    --agent-v2-bg-tertiary: #363b44;
    --agent-v2-text-primary: #e6e8eb;
    --agent-v2-text-secondary: #9ca3af;
}

html.dark-side .agent-v2-message.user .agent-v2-msg-content,
[data-theme="dark"] .agent-v2-message.user .agent-v2-msg-content {
    background: #2f3338;
    color: var(--agent-v2-text);
}

/* ============================================================
   Trigger Button (in Command Palette)
   ============================================================ */
.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;
}

/* ============================================================
   Main Wrapper
   ============================================================ */
.agent-v2-wrapper {
    position: fixed;
    top: 0;
    height: 100vh;
    width: 800px; /* Claude-like Desktop-Breite */
    min-width: min(800px, 100vw);
    z-index: 2147483647; /* Maximaler z-index Wert */
    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; /* Wrapper selbst blockiert keine Klicks */
}

/* Kinder brauchen pointer-events wenn sichtbar */
.agent-v2-wrapper > * {
    pointer-events: auto;
}

/* Hidden State */
.agent-v2-wrapper[data-position="hidden"] {
    transform: translateX(100%);
    pointer-events: none;
    opacity: 0;
}

/* Right Position */
.agent-v2-wrapper[data-position="right"] {
    right: 0;
    flex-direction: row-reverse;
}

/* Left Position */
.agent-v2-wrapper[data-position="left"] {
    left: 0;
    flex-direction: row;
}

.agent-v2-wrapper[data-position="left"][data-position="hidden"] {
    transform: translateX(-100%);
}

/* Fullscreen Position — echtes Fullscreen wie Claude */
.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;
}

/* ============================================================
   Sidebar — Chat-History (nur im Fullscreen sichtbar)
   ============================================================ */
.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;
}

/* Sidebar Header */
.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);
}

/* Sidebar Chat-Liste */
.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;
}

/* Gruppen-Header (Heute, Gestern, Letzte 7 Tage, ...) */
.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;
}

/* Einzelner Chat-Eintrag */
.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);
}

/* Three-Dot-Menu — erscheint bei Hover */
.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);
}

/* Dropdown — fixed Position damit overflow:auto es nicht clippt */
.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);
}

/* Inline-Editing fuer Chat-Titel (Rename) */
.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;
}

/* Chat Skeleton Loader (Lade-Zustand beim Chat-Wechsel) */
@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%; }

/* Sidebar Empty State */
.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;
}

/* Sidebar Loading */
.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;
}

/* Sidebar Footer */
.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;
}

/* Fullscreen: Container braucht keinen Border-Radius */
.agent-v2-wrapper[data-position="fullscreen"] .agent-v2-container {
    flex: 1;
}

/* ============================================================
   Charm Tab — ENTFERNT 2026-03-18
   Agent-Trigger ist jetzt im MegaSearch-Bar (index.htm)
   ============================================================ */
.agent-v2-charm-tab {
    display: none !important;
}

/* ============================================================
   Collapsed State (nicht gepinnt, nicht gehoverd)
   ============================================================ */
.agent-v2-wrapper.collapsed .agent-v2-container,
.agent-v2-wrapper.collapsed .agent-v2-splitter {
    pointer-events: none;
}

/* 2026-03-18: Collapsed = komplett versteckt (kein Charm-Tab mehr) */
.agent-v2-wrapper.collapsed {
    width: 0 !important;
    overflow: hidden;
    pointer-events: none;
}

/* Splitter nur anzeigen wenn gepinnt */
.agent-v2-wrapper[data-pinned="false"] .agent-v2-splitter {
    display: none;
}

/* Expanded State (gepinnt oder gehoverd) */
.agent-v2-wrapper.expanded .agent-v2-container,
.agent-v2-wrapper[data-pinned="true"] .agent-v2-container {
    opacity: 1;
    pointer-events: auto;
}

/* 2026-03-18: Charm-Tab-Referenzen entfernt */

/* Splitter nur bei gepinntem Zustand sichtbar */
.agent-v2-wrapper[data-pinned="true"] .agent-v2-splitter {
    display: flex;
}

/* ============================================================
   Splitter (Resize Handle) - Cursor-Style
   ============================================================ */
.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;
}

/* Splitter Line (vertikale Linie in der Mitte) */
.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;
}

/* ============================================================
   Main Container
   ============================================================ */
.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;
}

/* Container Border - immer auf der Splitter-Seite */
.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;
}

/* ============================================================
   Header
   ============================================================ */
.agent-v2-header {
    height: var(--agent-v2-header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(229, 231, 235, 0.72);
    flex-shrink: 0;
}

/* Position Toggle (Legacy — entfernt, Dock jetzt im Options-Dropdown) */

/* Agent Info - gesamter Bereich ist klickbar */
.agent-v2-agent-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
    padding: 5px 7px;
    margin: -5px -7px;
    border-radius: 10px;
    transition: background-color 0.15s ease;
}

.agent-v2-agent-info:hover {
    background-color: rgba(15, 23, 42, 0.04);
}

.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%;
}

/* Selector Icon (visueller Hinweis, nicht mehr klickbar - Container ist klickbar) */
.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);
}

/* Header Controls */
.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);
}

/* Neu Chat Button - prominent mit Primary-Farbe */
.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;
}

/* Pin Button — Legacy (jetzt im Options-Dropdown, Klasse bleibt fuer Abwaertskompatibilitaet) */
.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;
}

/* Close Button — Legacy (jetzt im Options-Dropdown) */
.agent-v2-close-btn {
    display: none;
}

/* ============================================================
   Options-Dropdown (2026-04-13: Enterprise Header Redesign)
   ============================================================ */
.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;
}

/* ============================================================
   Status Bar (ersetzt Mode Tabs)
   ============================================================ */
.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;
}

/* ============================================================
   Scope Bar - Workspace-Auswahl (2026-03-03)
   ============================================================ */
.agent-v2-scope-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px 8px;
    background: rgba(248, 250, 252, 0.78);
    border-bottom: 1px solid rgba(226, 232, 240, 0.82);
    font-size: 12px;
    color: #475569;
    min-height: 40px;
    flex-wrap: wrap;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.agent-v2-scope-bar.scope-all {
    background: rgba(248, 250, 252, 0.78);
    border-bottom-color: rgba(226, 232, 240, 0.82);
}

.agent-v2-scope-bar.scope-multi {
    background: rgba(248, 250, 252, 0.78);
    border-bottom-color: rgba(226, 232, 240, 0.82);
}

.agent-v2-scope-bar.scope-document {
    background: rgba(248, 250, 252, 0.78);
    border-bottom-color: rgba(226, 232, 240, 0.82);
}

.agent-v2-scope-bar.scope-folder {
    background: rgba(248, 250, 252, 0.78);
    border-bottom-color: rgba(226, 232, 240, 0.82);
}

.agent-v2-scope-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1 1 220px;
    min-width: 0;
    padding: 2px 5px;
    border-radius: 9px;
    transition: background 0.15s;
}

.agent-v2-scope-toggle:hover {
    background: rgba(15, 23, 42, 0.045);
}

.agent-v2-scope-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 10px;
    flex-shrink: 0;
}

.agent-v2-scope-bar.scope-all .agent-v2-scope-icon {
    background: rgba(148, 163, 184, 0.12);
    color: #64748b;
}

.agent-v2-scope-bar.scope-multi .agent-v2-scope-icon {
    background: rgba(99, 102, 241, 0.09);
    color: #6366f1;
}

.agent-v2-scope-bar.scope-document .agent-v2-scope-icon {
    background: rgba(59, 130, 246, 0.09);
    color: #3b82f6;
}

.agent-v2-scope-bar.scope-folder .agent-v2-scope-icon {
    background: rgba(16, 185, 129, 0.09);
    color: #10b981;
}

.agent-v2-scope-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1 1 auto;
    min-width: 0;
}

.agent-v2-scope-label {
    font-weight: 700;
    color: #1f2937;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
    line-height: 1.25;
}

.agent-v2-scope-detail {
    display: none;
}

.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: 6px;
    flex-wrap: nowrap;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 45%;
    justify-content: flex-end;
    overflow: hidden;
}

.agent-v2-scope-warning {
    display: flex;
    width: calc(100% - 30px);
    margin-left: 30px;
    min-width: 0;
    flex: 1 0 calc(100% - 30px);
}

.agent-v2-scope-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(203, 213, 225, 0.78);
    border-radius: 12px;
    font-size: 10px;
    color: #475569;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: default;
    transition: background 0.15s;
}

.agent-v2-scope-chip:hover {
    background: rgba(248, 250, 252, 0.95);
}

.agent-v2-scope-chip-more {
    font-style: italic;
    color: #64748b;
}

.agent-v2-scope-chip-x {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    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;
}

/* Scope Dropdown */
.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;
}

/* Workspace Picker im Dropdown */
.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: 230px;
    overflow-y: auto;
    padding: 0 6px;
}

.agent-v2-scope-dd-ws-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.12s ease, box-shadow 0.12s ease;
}

.agent-v2-scope-dd-ws-item:hover {
    background: #f8fafc;
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.9);
}

.agent-v2-scope-dd-ws-item input[type="checkbox"] {
    accent-color: #3b82f6;
    flex-shrink: 0;
    margin-top: 2px;
}

.agent-v2-scope-dd-ws-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.agent-v2-scope-dd-ws-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #334155;
    font-weight: 500;
    line-height: 1.2;
}

.agent-v2-scope-dd-ws-meta {
    color: #94a3b8;
    font-size: 10.5px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-v2-scope-dd-ws-count {
    font-size: 10px;
    color: #9ca3af;
    flex-shrink: 0;
}

/* 2026-05-03: AI-DMS Counts (analyzed/total) mit Farb-Indikator */
.agent-v2-scope-dd-ws-counts {
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 8px;
    line-height: 1.4;
    font-weight: 500;
    white-space: nowrap;
}
.agent-v2-scope-dd-ws-counts.agent-v2-scope-pct-good {
    background: #dcfce7;
    color: #15803d;
}
.agent-v2-scope-dd-ws-counts.agent-v2-scope-pct-warn {
    background: #fef3c7;
    color: #b45309;
}
.agent-v2-scope-dd-ws-counts.agent-v2-scope-pct-bad {
    background: #fee2e2;
    color: #b91c1c;
}

.agent-v2-scope-dd-ws-score,
.agent-v2-scope-intel-score {
    flex: 0 0 auto;
    min-width: 38px;
    padding: 2px 7px;
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.92);
    color: #64748b;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.agent-v2-scope-dd-ws-score.is-basic,
.agent-v2-scope-intel-chip.is-basic .agent-v2-scope-intel-score {
    border-color: rgba(37, 99, 235, 0.22);
    background: rgba(37, 99, 235, 0.07);
    color: #2563eb;
}

.agent-v2-scope-dd-ws-score.is-strong,
.agent-v2-scope-dd-ws-score.is-ultra,
.agent-v2-scope-intel-chip.is-strong .agent-v2-scope-intel-score,
.agent-v2-scope-intel-chip.is-ultra .agent-v2-scope-intel-score {
    border-color: rgba(99, 102, 241, 0.24);
    background: rgba(99, 102, 241, 0.08);
    color: #4f46e5;
}

.agent-v2-scope-intel-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 30px;
    padding: 3px 10px 3px 4px;
    border: 1px solid rgba(185, 28, 28, 0.28);
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(254, 242, 242, 0.98), rgba(255, 247, 237, 0.92));
    color: #7f1d1d;
    font-size: 10.5px;
    line-height: 1.2;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.agent-v2-scope-intel-chip.agent-v2-scope-missing-chip .agent-v2-scope-intel-score {
    border-color: rgba(185, 28, 28, 0.34);
    background: rgba(254, 226, 226, 0.98);
    color: #991b1b;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.2);
}

.agent-v2-scope-intel-default,
.agent-v2-scope-intel-hover {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    width: 100%;
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.agent-v2-scope-intel-default {
    opacity: 1;
    transform: translateY(0);
}

.agent-v2-scope-intel-hover {
    position: absolute;
    inset: 0 10px;
    opacity: 0;
    transform: translateY(6px);
    color: #7f1d1d;
    font-weight: 800;
}

.agent-v2-scope-intel-chip:hover,
.agent-v2-scope-intel-chip:focus-visible {
    background: rgba(254, 226, 226, 0.98);
    border-color: rgba(185, 28, 28, 0.48);
    color: #7f1d1d;
    transform: translateY(-1px);
    outline: none;
}

.agent-v2-scope-intel-chip:hover .agent-v2-scope-intel-default,
.agent-v2-scope-intel-chip:focus-visible .agent-v2-scope-intel-default {
    opacity: 0;
    transform: translateY(-6px);
}

.agent-v2-scope-intel-chip:hover .agent-v2-scope-intel-hover,
.agent-v2-scope-intel-chip:focus-visible .agent-v2-scope-intel-hover {
    opacity: 1;
    transform: translateY(0);
}

.agent-v2-scope-intel-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.agent-v2-scope-intel-missing-count {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #9f1239;
    font-weight: 600;
}

.agent-v2-scope-intel-bar {
    display: flex;
    align-items: stretch;
    width: 68px;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(254, 226, 226, 0.7);
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.16);
}

.agent-v2-scope-dd-ws-main .agent-v2-scope-intel-bar {
    width: min(160px, 100%);
}

.agent-v2-scope-intel-segment {
    display: block;
    min-width: 2px;
    height: 100%;
}

.agent-v2-scope-intel-segment.is-storage {
    background: linear-gradient(90deg, #dc2626, #f97316);
}

.agent-v2-scope-intel-segment.is-basic {
    background: #fbbf24;
}

.agent-v2-scope-intel-segment.is-premium {
    background: #a3a3a3;
}

.agent-v2-scope-intel-segment.is-ultra {
    background: #525252;
}

.agent-v2-scope-intel-segment.is-empty {
    background: rgba(148, 163, 184, 0.24);
}

/* 2026-05-03: Counts in den Dropdown-Items selbst (Alle Workspaces / Multi-Workspace) */
.agent-v2-scope-dd-counts {
    font-size: 10px;
    color: #6b7280;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}
.agent-v2-scope-dd-item.active .agent-v2-scope-dd-counts {
    color: #3b82f6;
}

.agent-v2-scope-dd-counts.is-critical,
.agent-v2-scope-dd-item.active .agent-v2-scope-dd-counts.is-critical {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin-top: 4px;
    padding: 2px 7px;
    border: 1px solid rgba(185, 28, 28, 0.22);
    border-radius: 999px;
    background: rgba(254, 226, 226, 0.72);
    color: #991b1b;
    font-weight: 700;
}

.agent-v2-scope-dd-ws-apply {
    padding: 8px 12px 6px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.agent-v2-scope-dd-apply-btn,
.agent-v2-scope-dd-cancel-btn {
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.agent-v2-scope-dd-apply-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
}

.agent-v2-scope-dd-apply-btn:hover {
    background: #2563eb;
}

.agent-v2-scope-dd-cancel-btn {
    background: #fff;
    color: #64748b;
    border: 1px solid #dbe3ef;
}

.agent-v2-scope-dd-cancel-btn:hover {
    background: #f8fafc;
    color: #334155;
    border-color: #cbd5e1;
}

.agent-v2-scope-dd-loading,
.agent-v2-scope-dd-empty {
    padding: 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
}

/* ============================================================
   Chat Body
   ============================================================ */
.agent-v2-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px 20px 18px;
    background: var(--agent-v2-surface);
}

.agent-v2-messages {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    min-height: 100%;
}

/* ============================================================
   Welcome-Screen (Claude-like, bei leerem Chat)
   ============================================================ */
.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;
}

/* Leave-Animation */
.agent-v2-welcome-leaving {
    animation: agent-v2-welcome-out 0.3s ease forwards;
    pointer-events: none;
}

/* Keyframes */
@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); }
}

/* Reduced motion */
@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;
    }
}

/* Responsive: Kleinere Chips auf schmalem Panel */
@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;
    }
}

/* ============================================================
   Messages
   ============================================================ */
.agent-v2-message {
    width: 100%;
    max-width: 100%;
    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;
    width: min(92%, 640px);
    max-width: 92%;
    position: relative;
    z-index: 2;
}

.agent-v2-messages > .agent-v2-message.user:not(:first-child) {
    margin-top: 16px;
}

.agent-v2-message.assistant {
    align-self: flex-start;
    width: 100%;
    max-width: 100%;
}

/* Message Content */
.agent-v2-msg-content {
    padding: 0;
    border-radius: var(--agent-v2-radius);
    font-size: 15px;
    line-height: 1.65;
    color: var(--agent-v2-text);
    overflow-x: hidden;
    min-width: 0;
}

.agent-v2-message.user .agent-v2-msg-content {
    background: #f4f4f5;
    color: #111827;
    border-radius: 12px;
    padding: 10px 16px;
    width: fit-content;
    max-width: min(100%, 80%);
    margin-left: auto;
}

.agent-v2-message.assistant .agent-v2-msg-content {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    text-align: left;
}

/* Legacy-DocCards und DOCCARDS-Marker: gleiche Breite/Ausrichtung wie ui_blocks */
.agent-v2-message.assistant .agent-v2-msg-content .agent-v2-doc-cards,
.agent-v2-message.assistant > .agent-v2-doc-cards {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

/* FIX 2026-02-02: Dokument-Thumbnail Styles */
.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);
}

/* ============================================================
   Message Header (Agent Info + TTS Button) - FIX 2026-01-22
   TTS Button jetzt OBEN RECHTS neben Avatar statt im Footer
   ============================================================ */
.agent-v2-msg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 4px;
}

/* Agent Badge mit groesserem Avatar - FIX 2026-01-22 */
.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);
}

/* TTS Replay-Button — konsistent mit anderen Action-Buttons im Footer */
/* Waehrend Loading/Playing muss der gesamte Actions-Container sichtbar sein */
.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; }
}

/* Message Footer - Zeit und Action Buttons */
.agent-v2-msg-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 4px;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease, visibility 0.16s ease;
}

.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-user-activity {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transform: translateY(-3px);
    transition: max-height 0.18s ease, margin-top 0.18s ease, opacity 0.16s ease, visibility 0.16s ease, transform 0.16s ease;
}

.agent-v2-message.user:hover .agent-v2-user-activity,
.agent-v2-message.user:focus-within .agent-v2-user-activity,
.agent-v2-user-activity.is-running {
    margin-top: 7px;
    max-height: 320px;
    opacity: 1;
    visibility: visible;
    overflow: visible;
    transform: translateY(0);
}

.agent-v2-message.user:hover,
.agent-v2-message.user:focus-within {
    z-index: 20;
}

/* Action Buttons (Copy, Thumbs Up, Thumbs Down) */
.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-message:hover .agent-v2-msg-footer,
.agent-v2-message:focus-within .agent-v2-msg-footer {
    opacity: 1;
    visibility: visible;
}

.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-wrapper [data-po-tooltip] {
    position: relative;
}

.agent-v2-wrapper [data-po-tooltip]::after {
    content: attr(data-po-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    z-index: 80;
    max-width: 220px;
    width: max-content;
    padding: 6px 9px;
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.96);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    white-space: normal;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 4px);
    transition: opacity 0.14s ease, visibility 0.14s ease, transform 0.14s ease;
    pointer-events: none;
}

.agent-v2-wrapper [data-po-tooltip]::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 3px);
    z-index: 81;
    border: 5px solid transparent;
    border-top-color: rgba(17, 24, 39, 0.96);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 4px);
    transition: opacity 0.14s ease, visibility 0.14s ease, transform 0.14s ease;
    pointer-events: none;
}

.agent-v2-wrapper [data-po-tooltip]:hover::after,
.agent-v2-wrapper [data-po-tooltip]:hover::before,
.agent-v2-wrapper [data-po-tooltip]:focus-visible::after,
.agent-v2-wrapper [data-po-tooltip]:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.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);
}


/* ============================================================
   Reasoning Section - FIX 2026-01-22: OBERHALB der Antwort (ChatGPT/Claude Style)
   ============================================================ */
.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;
}

/* ============================================================
   Message Meta Info - FIX 2026-01-22: Vertikal (untereinander)
   ============================================================ */
.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;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease, visibility 0.16s ease;
}

.agent-v2-message:hover .agent-v2-msg-meta,
.agent-v2-message:focus-within .agent-v2-msg-meta {
    opacity: 1;
    visibility: visible;
}

/* Tools Row - vertikal */
.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: #f4f4f5;
    color: var(--agent-v2-text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-family: var(--po-font-family);
    font-weight: 500;
    border: 1px solid var(--agent-v2-border);
}

.agent-v2-activity-meta {
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: flex-end;
}

.agent-v2-activity-badges {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.agent-v2-activity-badge,
.agent-v2-metrics-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.74);
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.agent-v2-metrics-badge {
    cursor: default;
}

.agent-v2-metrics-popup {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 50;
    min-width: 245px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.16);
    color: #111827;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px) scale(0.98);
    transition: opacity 0.16s ease, visibility 0.16s ease, transform 0.16s ease;
    pointer-events: none;
}

.agent-v2-metrics-badge:hover .agent-v2-metrics-popup,
.agent-v2-metrics-badge:focus-visible .agent-v2-metrics-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.agent-v2-metrics-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    font-size: 11px;
    line-height: 1.35;
}

.agent-v2-metrics-row:last-child {
    border-bottom: none;
}

.agent-v2-metrics-row span {
    color: #64748b;
}

.agent-v2-metrics-row strong {
    color: #0f172a;
    font-weight: 500;
    text-align: right;
}

/* Stats Row - vertikal */
.agent-v2-stats-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--agent-v2-text-muted);
    font-family: var(--po-font-family);
    font-size: 12px;
}

.agent-v2-stats-row > i {
    font-size: 12px;
}

.agent-v2-stats-dot {
    opacity: 0.4;
}

.agent-v2-tier-badge {
    font-weight: 600;
    font-size: 11px;
    color: #6b7280;
}

/* Legacy: alte Stats-Klasse fuer Kompatibilitaet */
.agent-v2-stats {
    display: flex;
    gap: 12px;
    color: var(--agent-v2-text-muted);
    font-family: var(--po-font-family);
}

.agent-v2-stats span::before {
    content: "•";
    margin-right: 6px;
    opacity: 0.5;
}

.agent-v2-stats span:first-child::before {
    display: none;
}

/* Legacy: alte Tools-Klasse */
.agent-v2-tools-used {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

/* Legacy: alte Thinking-Klasse */
.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;
}

/* ============================================================
   Markdown Styling in Messages
   ============================================================ */
.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: var(--po-font-family);
    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;
}
/* FIX 2026-04-14 (Issue #378 P3): Links in User-Bubbles brauchen genug Kontrast. */
.agent-v2-message.user .agent-v2-msg-content a {
    color: var(--agent-v2-primary);
}
.agent-v2-message.user .agent-v2-msg-content a:hover {
    color: var(--agent-v2-primary-dark);
    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;
}

/* Table Styling */
.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;
}

/* ============================================================
   Progress Container - Cursor-Style (2026-01-30)
   Zeigt Aktionen als Liste mit Shimmer-Effekt
   ============================================================ */

/* Container fuer alle Progress-Items */
/* ============================================================
   Progress Steps - "Thinking" UI (Redesign 2026-03-03)
   Timeline-Layout mit typ-spezifischen Farben, Slide-In
   und Checkmark-Pop Animation
   ============================================================ */
.agent-v2-progress-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 8px 0 8px 6px;
    margin-bottom: 8px;
    position: relative;
}

.agent-v2-user-activity .agent-v2-progress-container {
    overflow: hidden;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid rgba(203, 213, 225, 0.72);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.72);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
    backdrop-filter: blur(10px);
}

.agent-v2-user-activity .agent-v2-progress-container:not(.done)::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 0%, rgba(148, 163, 184, 0.13) 45%, transparent 70%);
    animation: agent-v2-activity-scan 2.8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes agent-v2-activity-scan {
    0% { transform: translateX(-100%); opacity: 0; }
    35% { opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

/* Summary-Zeile (immer sichtbar) */
.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-user-activity .agent-v2-progress-summary {
    color: #475569;
    padding: 4px 8px 4px 0;
}

.agent-v2-user-activity .agent-v2-progress-summary-text {
    font-size: 12px;
    font-weight: 500;
}
.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-user-activity .agent-v2-progress-summary-icon {
    width: 21px;
    height: 21px;
    border-color: #cbd5e1;
    color: #64748b;
    background: rgba(255, 255, 255, 0.72);
}

.agent-v2-user-activity .agent-v2-progress-container:not(.done) .agent-v2-progress-summary-icon {
    border-color: #94a3b8;
    color: #64748b;
}

.agent-v2-user-activity .agent-v2-progress-container.done .agent-v2-progress-summary-icon {
    border-color: #86efac;
    color: #16a34a;
    background: rgba(240, 253, 244, 0.8);
}
.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);
}

/* Details-Liste (nur sichtbar wenn expanded) */
.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;
}

/* Vertikale Timeline-Linie — nur in expanded */
.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-user-activity .agent-v2-progress-details-list::before {
    left: 16px;
    background: linear-gradient(180deg, rgba(148,163,184,0.38), rgba(148,163,184,0.18));
}
/* Alte Timeline-Linie am Container entfernen */
.agent-v2-progress-container::before {
    display: none;
}

/* Einzelnes Progress-Item */
.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);
    }
}

/* Slide-Out Animation fuer aelteste Items (Sliding-Window, max 6 sichtbar) */
@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;
}

/* Aktives Item */
.agent-v2-progress-item.active {
    color: #e5e7eb;
}

.agent-v2-user-activity .agent-v2-progress-item.active {
    color: #334155;
}

.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(148, 163, 184, 0.07) 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; }
}

/* Abgeschlossenes Item */
.agent-v2-progress-item.completed {
    color: #6b7280;
}

.agent-v2-user-activity .agent-v2-progress-item.completed {
    color: #64748b;
}

/* Icon Container — runder Node auf der Timeline */
.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;
}

/* Typ-spezifische Farben fuer aktive Items */
.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);
}

/* Pulse-Animation fuer aktive Icons */
.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; }
}

/* Completed Icon — Gruen mit Pop-Animation */
.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;
}

.agent-v2-user-activity .agent-v2-progress-icon {
    background: rgba(255, 255, 255, 0.78);
    border-color: #cbd5e1;
    color: #64748b;
    box-shadow: none;
}

.agent-v2-user-activity .agent-v2-progress-item.active .agent-v2-progress-icon {
    border-color: #94a3b8;
    color: #475569;
    box-shadow: none;
}

.agent-v2-user-activity .agent-v2-progress-item.completed .agent-v2-progress-icon {
    border-color: #86efac;
    color: #16a34a;
    background: rgba(240, 253, 244, 0.78);
}

@keyframes agent-v2-check-pop {
    0% { transform: scale(0.5); opacity: 0.5; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* Spinning Icon Animation */
.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); }
}

/* Text Container */
.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;
}

/* Timer */
.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;
}

/* Chevron fuer Collapsible */
.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);
}

/* Collapsible Details */
.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;
}

/* Details Content Styling */
.agent-v2-progress-details pre {
    margin: 0;
    font-family: var(--po-font-family);
    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;
}

/* Reduced Motion */
@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;
    }
}

/* Source Item in Details */
.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;
}

/* Legacy Typing Indicator (Fallback) */
.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;
}

/* ============================================================
   Typewriter Cursor (fuer echten Typewriter-Effekt)
   ============================================================ */
.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; }
}

/* Waehrend Typewriter-Effekt laeuft - FIX 2026-01-30: Padding EXPLIZIT setzen! */
.agent-v2-msg-content.agent-v2-typing {
    display: block;
    min-height: 40px;
    /* FIX: Padding muss explizit gesetzt werden, da .agent-v2-typing es auf 0 setzt */
    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;
}

/* Tabellen-Wrapper fuer besseres Scrolling (FIX #174) */
.agent-v2-table-wrapper {
    overflow-x: auto;
    margin: 12px 0;
    max-width: 100%;
}

.agent-v2-table-wrapper table {
    margin: 0;
    font-size: 12px;
}

/* Truncated Table: Show-More Button */
.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);
}

/* ============================================================
   Footer / Input — Claude-like Design (2026-03-27)
   ============================================================ */
.agent-v2-footer {
    padding: 14px 22px 12px;
    background: var(--agent-v2-surface);
    border-top: none;
    flex-shrink: 0;
}

.agent-v2-input-container {
    display: flex;
    flex-direction: column;
    background: var(--agent-v2-surface);
    border: 1px solid #d4d4d8;
    border-radius: 22px;
    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: #c7c7cc;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.agent-v2-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--agent-v2-text);
    resize: none;
    outline: none;
    min-height: 42px;
    max-height: 150px;
    line-height: 1.5;
    padding: 18px 20px 6px;
    width: 100%;
    box-sizing: border-box;
}

.agent-v2-input::placeholder {
    color: var(--agent-v2-text-light);
}

/* Bottom-Bar innerhalb des Input-Containers (Buttons-Zeile) */
.agent-v2-input-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 16px 14px;
    gap: 10px;
}

.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: #c96442;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--agent-v2-transition), background var(--agent-v2-transition), transform 0.1s ease;
    flex-shrink: 0;
    font-size: 14px;
}

.agent-v2-input-container:not(.has-content) .agent-v2-send-btn {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.88);
}

.agent-v2-send-btn:hover {
    background: #b75638;
    transform: scale(1.05);
}

.agent-v2-send-btn.is-running {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: scale(1) !important;
    background: #111827;
    border-radius: 10px;
}

.agent-v2-send-btn.is-running:hover {
    background: #000000;
    transform: scale(1.05) !important;
}

/* ---- Tier Selector (Basic/Premium/Ultra) ---- */
.agent-v2-tier-selector {
    position: relative;
}

.agent-v2-tier-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--agent-v2-border);
    border-radius: 8px;
    padding: 4px 10px 4px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--agent-v2-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    height: 30px;
    max-width: 230px;
}

.agent-v2-tier-btn-label,
.agent-v2-tier-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.agent-v2-tier-btn-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-v2-tier-btn-effort,
.agent-v2-tier-effort {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.10);
    color: var(--agent-v2-primary);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    padding: 3px 6px;
    white-space: nowrap;
}

.agent-v2-tier-btn-effort {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.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: 300px;
    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: 4px;
    z-index: 9999;
}

.agent-v2-tier-dropdown.open {
    display: block;
}

.agent-v2-tier-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 13px;
    color: var(--agent-v2-text);
}

.agent-v2-tier-option:first-child {
    border-radius: 10px 10px 0 0;
}

.agent-v2-tier-option:last-child {
    border-radius: 0 0 10px 10px;
}

.agent-v2-tier-option:only-child {
    border-radius: 10px;
}

.agent-v2-tier-option:hover:not(.disabled) {
    background: var(--agent-v2-hover, rgba(0,0,0,0.04));
}

.agent-v2-tier-option.active {
    background: transparent;
}

.agent-v2-tier-option + .agent-v2-tier-option {
    border-top: 1px solid var(--agent-v2-border, rgba(0,0,0,0.08));
}

.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);
    display: none;
}

.agent-v2-tier-option.disabled > i:first-child {
    color: var(--agent-v2-text-muted);
    display: none;
}

.agent-v2-tier-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.agent-v2-tier-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--agent-v2-text);
}

.agent-v2-tier-desc {
    font-size: 12px;
    color: var(--agent-v2-text-muted);
    line-height: 1.3;
}

.agent-v2-tier-price {
    display: none;
}

.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: 14px;
    opacity: 0;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.agent-v2-tier-option.active .agent-v2-tier-check {
    opacity: 1;
}

/* ============================================================
   STT Mic Button (Speech-to-Text) - 2026-02-03
   ============================================================ */
.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);
}

/* Recording State - Pulsierendes Rot */
.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);
    }
}

/* Transcribing State - Spinner */
.agent-v2-mic-btn.transcribing {
    background: var(--agent-v2-warning);
    color: white;
    border-color: var(--agent-v2-warning);
    cursor: wait;
}

/* STT Error Message */
.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;
}

/* FIX 2026-01-22: Session Debug Anzeige */
.agent-v2-session-debug {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--po-font-family);
    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 Selector Modal
   ============================================================ */
.agent-v2-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2147483647; /* Maximaler z-index Wert */
    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);
}

/* Section Headers */
.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 Items */
.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%);
}

/* Avatar Styles */
.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;
}

/* Info Section */
.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;
}

/* Badge (Featured etc.) */
.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;
}

/* Category Label in expanded Industry */
.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;
}

/* Industry Accordion */
.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);
}

/* Industry Avatar */
.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);
}

/* Industry Info */
.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);
}

/* Chevron */
.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);
}

/* Agents Container (inside Industry) */
.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);
}

/* Small Loading */
.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);
}

/* ============================================================
   Scrollbar Styling
   ============================================================ */
.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);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .agent-v2-wrapper[data-position="right"],
    .agent-v2-wrapper[data-position="left"] {
        width: 100% !important;
    }
    
    .agent-v2-splitter {
        display: none;
    }
    
    /* Sidebar auf Mobile versteckt */
    .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-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr) auto;
    }
    
    .agent-v2-selector-rail,
    .agent-v2-selector-custom-panel {
        max-height: 180px;
        border-left: none;
        border-right: none;
        border-bottom: 1px solid var(--agent-v2-border);
    }

    .agent-v2-selector-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .agent-v2-selector-controls {
        justify-content: space-between;
    }

    .agent-v2-selector-grid {
        grid-template-columns: 1fr;
    }
    
    /* DocCards auf Mobile: volle Breite */
    .agent-v2-doc-card {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }
    
    /* 2026-02-15: Suggestion-Buttons auf Mobile volle Breite */
    .agent-v2-suggestion-btn {
        white-space: normal;
        text-align: left;
    }
}

/* ============================================================
   Feedback Modal (wie Claude)
   ============================================================ */
.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);
}

/* ============================================================
   Print
   ============================================================ */
@media print {
    .agent-v2-wrapper,
    .agent-v2-trigger {
        display: none !important;
    }
}

/* ============================================================
   Antwort-Reveal: Block-Stagger (Gemini-Style) + Legacy-Fade fuer Fehler
   ============================================================ */
@keyframes agent-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes agent-v2-reveal-block {
    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-message.agent-v2-msg-animated .agent-v2-msg-content {
    opacity: 1;
}

.agent-v2-reveal-block {
    opacity: 0;
    transform: translateY(10px);
    animation: agent-v2-reveal-block 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(40ms + (var(--reveal-i, 0) * 58ms));
}

.agent-v2-msg-content.agent-v2-msg-reveal-single {
    animation: agent-v2-reveal-block 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.agent-v2-ui-blocks.agent-v2-ui-blocks-reveal {
    opacity: 0;
    animation: agent-v2-reveal-block 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 120ms;
}

.agent-v2-message.agent-v2-from-stream .agent-v2-msg-content {
    transition: opacity 0.2s ease;
}

.agent-v2-message.agent-v2-msg-reveal-instant .agent-v2-reveal-block,
.agent-v2-message.agent-v2-msg-reveal-instant .agent-v2-msg-content.agent-v2-msg-reveal-single,
.agent-v2-message.agent-v2-msg-reveal-instant .agent-v2-ui-blocks-reveal {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .agent-v2-reveal-block,
    .agent-v2-msg-content.agent-v2-msg-reveal-single,
    .agent-v2-ui-blocks-reveal,
    .agent-v2-fade-in,
    .agent-v2-fade-in .agent-v2-msg-content {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================================
   2026-03-13: Streaming Text Bubble (Live-LLM-Output)
   ============================================================ */
.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;
    }
}

/* ============================================================
   2026-02-15: Follow-Up Suggestions (klickbare Vorschlaege)
   ============================================================ */
.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);
}

/* ============================================================
   Document Cards (Generative UI) — volle Breite, linksbündig
   ============================================================ */
.agent-v2-doc-cards {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    margin: 10px 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.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: 0;
    max-width: 100%;
    width: 100%;
    flex: 1 1 auto;
    box-sizing: border-box;
}

.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: 96px;
    height: 96px;
    min-width: 96px;
    border-radius: 10px;
    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; }

/* 2026-02-15: Darkmode Badge-Farben (helle Badges auf dunklem Hintergrund sind zu grell) */
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; }

/* ============================================================
   2026-02-15: Action Buttons in Nachrichten (backend-injiziert)
   ============================================================ */
.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;
}

/* ============================================================
   2026-02-15: Code-Block Copy Button (Enterprise-Grade, wie Claude/ChatGPT)
   ============================================================ */
.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: var(--po-font-family);
    text-transform: uppercase;
    font-size: 10px;
    opacity: 0.7;
}

/* ============================================================
   2026-02-15: Retry-Button bei Fehlermeldungen
   ============================================================ */
.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);
}

/* ============================================================
   2026-04-29: Enterprise-Grade Error Banner (Desktop)
   ============================================================ */
.po-error-banner {
    margin: 14px 12px;
    padding: 16px 18px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 244, 230, 0.95) 0%, rgba(255, 250, 240, 0.95) 100%);
    border: 1px solid rgba(234, 130, 47, 0.35);
    box-shadow: 0 8px 24px rgba(234, 130, 47, 0.10), 0 1px 2px rgba(0, 0, 0, 0.04);
    color: #1f2937;
    font-size: 14px;
    line-height: 1.55;
    animation: po-error-banner-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.po-error-banner--error {
    background: linear-gradient(180deg, rgba(254, 226, 226, 0.95) 0%, rgba(254, 242, 242, 0.95) 100%);
    border-color: rgba(220, 38, 38, 0.4);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.12), 0 1px 2px rgba(0, 0, 0, 0.04);
}
@keyframes po-error-banner-in {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.po-error-banner__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.po-error-banner__icon {
    color: #ea822f;
    display: inline-flex;
    align-items: center;
}
.po-error-banner--error .po-error-banner__icon {
    color: #dc2626;
}
.po-error-banner__title {
    font-weight: 700;
    font-size: 15px;
    color: #111827;
    flex: 1 1 auto;
    min-width: 0;
}

.po-plan-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    letter-spacing: 0.2px;
    white-space: nowrap;
    background: #e5e7eb;
    color: #374151;
    border: 1px solid #d1d5db;
}
.po-plan-badge--basic    { background: #f3f4f6; color: #4b5563; border-color: #e5e7eb; }
.po-plan-badge--premium  { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.po-plan-badge--ultra    { background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%); color: #92400e; border-color: #fcd34d; }
.po-plan-badge--unlimited{ background: linear-gradient(90deg, #ddd6fe 0%, #c4b5fd 100%); color: #4c1d95; border-color: #a78bfa; }

.po-error-banner__body {
    color: #374151;
    margin-bottom: 12px;
    white-space: pre-line;
}

.po-error-banner__countdown {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    font-size: 13px;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}
.po-error-banner__countdown::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ea822f;
    box-shadow: 0 0 0 0 rgba(234, 130, 47, 0.7);
    animation: po-countdown-pulse 1.4s ease-out infinite;
}
@keyframes po-countdown-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(234, 130, 47, 0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(234, 130, 47, 0); }
    100% { box-shadow: 0 0 0 0 rgba(234, 130, 47, 0); }
}

.po-error-banner__actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.po-error-banner__retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: linear-gradient(180deg, #ea822f 0%, #d96d1c 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(234, 130, 47, 0.32), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.18s ease;
    letter-spacing: 0.2px;
}
.po-error-banner__retry-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #f29044 0%, #e07724 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(234, 130, 47, 0.4), 0 1px 2px rgba(0, 0, 0, 0.06);
}
.po-error-banner__retry-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(234, 130, 47, 0.3);
}
.po-error-banner__retry-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.po-error-banner__retry-icon {
    font-size: 16px;
    display: inline-block;
}
.po-error-banner__cancel-btn {
    padding: 10px 16px;
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.po-error-banner__cancel-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #374151;
    border-color: #9ca3af;
}

.po-error-banner__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 12px;
    color: #6b7280;
}
.po-error-banner__incident code {
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--po-font-family);
    font-size: 11px;
    color: #4b5563;
}
.po-error-banner__support {
    color: #ea822f;
    text-decoration: none;
    font-weight: 600;
}
.po-error-banner__support:hover {
    text-decoration: underline;
    color: #d96d1c;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .po-error-banner {
        background: linear-gradient(180deg, rgba(60, 35, 15, 0.85) 0%, rgba(45, 30, 15, 0.85) 100%);
        border-color: rgba(234, 130, 47, 0.45);
        color: #e5e7eb;
    }
    .po-error-banner--error {
        background: linear-gradient(180deg, rgba(60, 20, 20, 0.85) 0%, rgba(45, 18, 18, 0.85) 100%);
        border-color: rgba(248, 113, 113, 0.5);
    }
    .po-error-banner__title { color: #f3f4f6; }
    .po-error-banner__body  { color: #d1d5db; }
    .po-error-banner__countdown {
        background: rgba(255, 255, 255, 0.06);
        color: #9ca3af;
    }
    .po-error-banner__cancel-btn {
        color: #d1d5db;
        border-color: rgba(255, 255, 255, 0.18);
    }
    .po-error-banner__cancel-btn:hover {
        background: rgba(255, 255, 255, 0.06);
        color: #f3f4f6;
    }
    .po-error-banner__footer {
        border-top-color: rgba(255, 255, 255, 0.08);
        color: #9ca3af;
    }
    .po-error-banner__incident code {
        background: rgba(255, 255, 255, 0.08);
        color: #d1d5db;
    }
    .po-plan-badge--basic    { background: rgba(255, 255, 255, 0.06); color: #d1d5db; border-color: rgba(255, 255, 255, 0.12); }
    .po-plan-badge--premium  { background: rgba(59, 130, 246, 0.18); color: #93c5fd; border-color: rgba(59, 130, 246, 0.35); }
    .po-plan-badge--ultra    { background: rgba(245, 158, 11, 0.18); color: #fcd34d; border-color: rgba(245, 158, 11, 0.4); }
    .po-plan-badge--unlimited{ background: rgba(139, 92, 246, 0.18); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.4); }
}

/* ============================================================
   2026-03-21: File Drag & Drop + Attachments
   ============================================================ */

/* Drop-Overlay (ueberlagert den gesamten Chat-Container beim Drag) */
.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.is-blocked {
    background: rgba(254, 242, 242, 0.88);
    border-color: rgba(220, 38, 38, 0.42);
}
.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.is-blocked .agent-v2-drop-overlay-content {
    color: #991b1b;
}
.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;
}

/* Attachment-Button (links neben Input) */
.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-attach-btn.is-disabled,
.agent-v2-attach-btn.is-disabled:hover {
    opacity: 0.45;
    cursor: not-allowed;
    background: transparent;
    color: var(--agent-v2-text-muted);
}

/* Attachment Preview Bar (ueber dem Input) */
.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;
}

/* Toast fuer Attachment-Fehler */
.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-Selector breites Layout Override (2026-04-25)
   ============================================================ */
.agent-v2-selector-content {
    width: 1600px !important;
    max-width: calc(100vw - 40px) !important;
    height: 900px !important;
    max-height: calc(100vh - 40px) !important;
    border-radius: 16px !important;
    border: 1px solid var(--agent-v2-border) !important;
    box-shadow: 0 24px 80px rgba(0,0,0,0.28) !important;
}
.agent-v2-selector-body { padding: 0 !important; overflow: hidden !important; min-height: 0 !important; }
.agent-v2-selector-layout { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); width: 100%; height: 100%; min-height: 0; }
.agent-v2-selector-rail { width: 300px; max-width: 300px; min-width: 0; min-height: 0; background: var(--agent-v2-bg); display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--agent-v2-border); box-sizing: border-box; }
.agent-v2-selector-custom-panel { display: none !important; }
.agent-v2-selector-rail-header { min-height: 48px; padding: 12px 16px; border-bottom: 1px solid var(--agent-v2-border); display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--agent-v2-text-muted); text-transform: uppercase; letter-spacing: 0.05em; flex-shrink: 0; }
.agent-v2-selector-rail-header i { color: var(--agent-v2-primary); }
.agent-v2-selector-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--agent-v2-text-light); background: var(--agent-v2-surface); border-radius: 999px; padding: 2px 8px; }
.agent-v2-selector-rail-list { flex: 1; width: 100%; max-width: 300px; min-width: 0; min-height: 0; overflow-y: auto; padding: 8px 0; box-sizing: border-box; }
.agent-v2-selector-custom-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0; }
.agent-v2-selector-industry-row { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 12px; border-left: 3px solid transparent; cursor: pointer; color: var(--agent-v2-text); transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
.agent-v2-selector-industry-row:hover { background: var(--agent-v2-hover, rgba(0,0,0,0.04)); }
.agent-v2-selector-industry-row.active { background: rgba(91, 155, 213, 0.12); border-left-color: var(--agent-v2-primary); color: var(--agent-v2-primary); font-weight: 700; }
.agent-v2-selector-industry-row--custom { margin-bottom: 8px; border-bottom: 1px solid var(--agent-v2-border); }
.agent-v2-selector-industry-row i { width: 16px; text-align: center; color: var(--agent-v2-primary); flex-shrink: 0; }
.agent-v2-selector-industry-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.agent-v2-selector-industry-count { flex-shrink: 0; min-width: 24px; text-align: center; border-radius: 999px; background: var(--agent-v2-surface); color: var(--agent-v2-text-muted); font-size: 11px; padding: 2px 6px; }
.agent-v2-selector-industry-row.active .agent-v2-selector-industry-count { background: var(--agent-v2-primary); color: #fff; }
.agent-v2-selector-main { width: 100%; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--agent-v2-surface); overflow: hidden; }
.agent-v2-selector-toolbar { padding: 14px 18px; border-bottom: 1px solid var(--agent-v2-border); display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.agent-v2-selector-standard-card { flex: 1; min-width: 240px; margin: 0 !important; }
.agent-v2-selector-controls { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.agent-v2-selector-sort { border: 1px solid var(--agent-v2-border); border-radius: 9px; background: var(--agent-v2-bg); color: var(--agent-v2-text); font-size: 13px; padding: 9px 11px; cursor: pointer; }
.agent-v2-selector-result-count { color: var(--agent-v2-text-muted); font-size: 12px; white-space: nowrap; }
.agent-v2-selector-chips { display: none; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--agent-v2-border); background: var(--agent-v2-bg); max-height: 112px; overflow-y: auto; flex-shrink: 0; }
.agent-v2-selector-chips.visible { display: flex; }
.agent-v2-selector-chip { border: 1px solid var(--agent-v2-border); border-radius: 999px; background: var(--agent-v2-surface); color: var(--agent-v2-text-muted); cursor: pointer; padding: 6px 10px; font-size: 12px; transition: all 0.15s ease; }
.agent-v2-selector-chip:hover,
.agent-v2-selector-chip.active { border-color: var(--agent-v2-primary); background: var(--agent-v2-primary); color: #fff; }
.agent-v2-selector-chip span { opacity: 0.72; margin-left: 4px; }
.agent-v2-selector-grid-scroll { flex: 1; width: 100%; min-height: 0; overflow-y: auto; padding: 12px; box-sizing: border-box; }
.agent-v2-selector-grid { display: grid; width: 100%; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 14px; align-content: start; }
.agent-v2-selector-agent-card { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; width: 100%; min-height: 82px; padding: 12px; border: 1px solid var(--agent-v2-border); border-radius: 13px; background: var(--agent-v2-bg); color: var(--agent-v2-text); cursor: pointer; text-align: left; transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
.agent-v2-selector-agent-card:hover { transform: translateY(-1px); border-color: var(--agent-v2-primary); box-shadow: 0 8px 22px rgba(0,0,0,0.08); background: var(--agent-v2-surface); }
.agent-v2-selector-agent-card.selected { border-color: var(--agent-v2-primary); box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.22); }
.agent-v2-selector-agent-card.loading { opacity: 0.68; pointer-events: none; }
.agent-v2-selector-agent-avatar { width: 54px; height: 54px; border-radius: 13px; overflow: hidden; flex-shrink: 0; background: var(--agent-v2-surface); border: 1px solid var(--agent-v2-border); }
.agent-v2-selector-agent-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.agent-v2-selector-agent-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.agent-v2-selector-agent-name { color: var(--agent-v2-text); font-size: 14px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.agent-v2-selector-agent-meta { color: var(--agent-v2-text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-v2-selector-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0; border-radius: 12px; cursor: pointer; transition: all var(--agent-v2-transition); border: 1px solid transparent; background: var(--agent-v2-bg); min-width: 0; }
.agent-v2-selector-item:hover { background: var(--agent-v2-surface); border-color: var(--agent-v2-border); }
.agent-v2-selector-item.selected,
.agent-v2-selector-item.standard-agent.selected { background: linear-gradient(135deg, rgba(52, 152, 219, 0.18), rgba(155, 89, 182, 0.16)); border-color: var(--agent-v2-primary); }
.agent-v2-selector-avatar { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; border: 1px 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.standard { border-radius: 50%; background: linear-gradient(135deg, #3498db, #9b59b6); }
.agent-v2-selector-avatar.custom { border-color: #10b981; }
.agent-v2-selector-avatar.create { background: transparent; border: 2px dashed var(--agent-v2-text-muted); color: var(--agent-v2-text-muted); }
.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: 700; color: var(--agent-v2-text); margin-bottom: 3px; }
.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.recommended { background: linear-gradient(135deg, #27ae60, #2ecc71); 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(91, 155, 213, 0.08); }
.agent-v2-selector-empty,
.agent-v2-selector-loading,
.agent-v2-selector-error,
.agent-v2-selector-load-more { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 32px 18px; color: var(--agent-v2-text-muted); font-size: 13px; text-align: center; }
.agent-v2-selector-empty-wide,
.agent-v2-selector-loading,
.agent-v2-selector-error,
.agent-v2-selector-load-more { grid-column: 1 / -1; }
.agent-v2-selector-empty i,
.agent-v2-selector-loading i,
.agent-v2-selector-error i { font-size: 24px; opacity: 0.55; }
.agent-v2-selector-empty strong { color: var(--agent-v2-text); }
.agent-v2-selector-empty small { color: var(--agent-v2-text-light); }
.agent-v2-selector-rail-list::-webkit-scrollbar,
.agent-v2-selector-custom-list::-webkit-scrollbar,
.agent-v2-selector-grid-scroll::-webkit-scrollbar,
.agent-v2-selector-chips::-webkit-scrollbar { width: 7px; }
.agent-v2-selector-rail-list::-webkit-scrollbar-track,
.agent-v2-selector-custom-list::-webkit-scrollbar-track,
.agent-v2-selector-grid-scroll::-webkit-scrollbar-track,
.agent-v2-selector-chips::-webkit-scrollbar-track { background: transparent; }
.agent-v2-selector-rail-list::-webkit-scrollbar-thumb,
.agent-v2-selector-custom-list::-webkit-scrollbar-thumb,
.agent-v2-selector-grid-scroll::-webkit-scrollbar-thumb,
.agent-v2-selector-chips::-webkit-scrollbar-thumb { background: var(--agent-v2-border); border-radius: 4px; }
@media (max-width: 768px) {
    .agent-v2-selector-content { width: 100% !important; max-width: none !important; height: 100% !important; max-height: none !important; border-radius: 0 !important; }
    .agent-v2-selector-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
    .agent-v2-selector-rail { max-height: 220px; border-right: none; border-bottom: 1px solid var(--agent-v2-border); }
    .agent-v2-selector-toolbar { align-items: stretch; flex-direction: column; }
    .agent-v2-selector-controls { justify-content: space-between; }
    .agent-v2-selector-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Strukturierte Agent-UI-Blöcke (Desktop + responsive)
   Linksbündig, 100 % der Nachrichtenspalte (kein „schwebendes“ Zentrum)
   ============================================================ */
.agent-v2-message.assistant:has(.agent-v2-ui-blocks) {
    align-self: stretch;
    width: 100%;
    max-width: 100%;
}

.agent-v2-ui-blocks {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    align-self: stretch;
    gap: 10px;
    margin-top: 12px;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    text-align: left;
}

.agent-v2-ui-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    align-self: stretch;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,252,0.86));
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    padding: 14px;
    color: var(--agent-v2-text);
}
html.dark-side .agent-v2-ui-card,
[data-theme="dark"] .agent-v2-ui-card {
    background: linear-gradient(180deg, rgba(34,38,43,0.96), rgba(30,34,39,0.9));
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
}
.agent-v2-ui-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 12px;
    text-align: left;
    width: 100%;
}
.agent-v2-ui-eyebrow {
    color: var(--agent-v2-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.agent-v2-ui-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    font-size: 15px;
    font-weight: 760;
    line-height: 1.3;
    text-align: left;
}
.agent-v2-ui-title i {
    color: var(--agent-v2-primary);
}
.agent-v2-ui-subtitle {
    color: var(--agent-v2-text-muted);
    font-size: 12px;
    text-align: left;
    width: 100%;
}
.agent-v2-ui-field-grid,
.agent-v2-ui-field-grid-inline .agent-v2-ui-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.agent-v2-ui-field-grid-inline {
    width: 100%;
    max-width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    box-sizing: border-box;
}
.agent-v2-ui-field {
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    background: rgba(255,255,255,0.62);
    padding: 9px 10px;
}
html.dark-side .agent-v2-ui-field,
[data-theme="dark"] .agent-v2-ui-field {
    background: rgba(255,255,255,0.04);
}
.agent-v2-ui-field span {
    display: block;
    color: var(--agent-v2-text-muted);
    font-size: 11px;
    margin-bottom: 3px;
}
.agent-v2-ui-field strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--agent-v2-text);
    font-size: 13px;
    font-weight: 720;
}
.agent-v2-ui-field.tone-highlight strong {
    color: #0f766e;
    font-size: 15px;
}
.agent-v2-ui-field.tone-muted strong {
    color: var(--agent-v2-text-muted);
    font-weight: 600;
}
.agent-v2-ui-doc-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
@media (min-width: 520px) {
    .agent-v2-ui-doc-has-hero .agent-v2-ui-doc-layout {
        flex-direction: row;
        align-items: flex-start;
    }
}
.agent-v2-ui-doc-hero {
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.72);
    line-height: 0;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.agent-v2-ui-doc-hero:hover,
.agent-v2-ui-doc-hero:focus-visible {
    border-color: var(--agent-v2-primary);
    box-shadow: 0 4px 14px rgba(91, 155, 213, 0.22);
    outline: none;
}
.agent-v2-ui-doc-hero-thumb {
    display: block;
    width: 100%;
    max-width: 280px;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    background: #f1f5f9;
}
.agent-v2-ui-doc-hero-fallback {
    width: 200px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    color: var(--agent-v2-primary);
}
.agent-v2-ui-doc-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.agent-v2-ui-doc-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.agent-v2-ui-doc-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.02em;
    background: var(--agent-v2-primary-soft);
    color: var(--agent-v2-primary);
}
.agent-v2-ui-doc-workspace {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 650;
    color: var(--agent-v2-primary);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.agent-v2-ui-doc-workspace.muted {
    cursor: default;
    text-decoration: none;
    color: var(--agent-v2-text-muted);
}
.agent-v2-ui-doc-file-link {
    font-size: 11px;
    color: var(--agent-v2-text-muted);
    text-decoration: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.agent-v2-ui-doc-file-link:not(.muted):hover {
    color: var(--agent-v2-primary);
    text-decoration: underline;
}
.agent-v2-ui-doc-summary {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.5);
    padding: 10px 12px;
}
html.dark-side .agent-v2-ui-doc-summary,
[data-theme="dark"] .agent-v2-ui-doc-summary {
    background: rgba(255, 255, 255, 0.04);
}
.agent-v2-ui-doc-summary-head {
    font-size: 12px;
    font-weight: 800;
    color: var(--agent-v2-text);
    margin-bottom: 4px;
}
.agent-v2-ui-doc-summary-body {
    font-size: 13px;
    line-height: 1.45;
    color: var(--agent-v2-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.agent-v2-ui-doc-list-items {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}
.agent-v2-ui-doc-row {
    display: grid;
    grid-template-columns: minmax(72px, 88px) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 13px;
    padding: 9px;
    background: rgba(255,255,255,0.54);
}
.agent-v2-ui-doc-index {
    grid-column: 1 / -1;
    color: var(--agent-v2-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
}
html.dark-side .agent-v2-ui-doc-row,
[data-theme="dark"] .agent-v2-ui-doc-row {
    background: rgba(255,255,255,0.04);
}
.agent-v2-ui-doc-row-has-thumb {
    grid-template-columns: 88px minmax(0, 1fr) auto;
}
.agent-v2-ui-doc-row-hero .agent-v2-ui-doc-hero-thumb {
    width: 88px;
    height: 110px;
    max-width: 88px;
    max-height: 110px;
    object-fit: cover;
    border-radius: 10px;
}
.agent-v2-ui-doc-row-hero.agent-v2-ui-doc-hero-fallback,
.agent-v2-ui-doc-row-hero .agent-v2-ui-doc-hero-fallback {
    width: 88px;
    height: 110px;
    max-width: 88px;
    font-size: 28px;
}
.agent-v2-ui-doc-row-summary {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--agent-v2-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.agent-v2-ui-doc-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--agent-v2-primary-soft);
    color: var(--agent-v2-primary);
}
.agent-v2-ui-doc-body {
    min-width: 0;
}
.agent-v2-ui-doc-title {
    color: var(--agent-v2-text);
    font-size: 13px;
    font-weight: 720;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    line-height: 1.35;
    text-align: left;
}
.agent-v2-ui-doc-file {
    margin-top: 2px;
    color: var(--agent-v2-text-light);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.agent-v2-ui-doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    color: var(--agent-v2-text-muted);
    font-size: 11px;
}
.agent-v2-ui-doc-meta span {
    max-width: min(100%, 420px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.agent-v2-ui-doc-open,
.agent-v2-ui-doc-action,
.agent-v2-ui-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(91, 155, 213, 0.3);
    background: rgba(91, 155, 213, 0.08);
    color: var(--agent-v2-primary-dark);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 11px;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.agent-v2-ui-doc-open:hover,
.agent-v2-ui-doc-action:hover,
.agent-v2-ui-action:hover {
    transform: translateY(-1px);
    background: rgba(91, 155, 213, 0.14);
    border-color: rgba(91, 155, 213, 0.55);
}
.agent-v2-ui-doc-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    width: 100%;
}
.agent-v2-ui-doc-action.primary {
    background: var(--agent-v2-primary);
    border-color: var(--agent-v2-primary);
    color: #fff;
}
.agent-v2-ui-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-start;
    width: 100%;
}
.agent-v2-ui-action.primary {
    background: var(--agent-v2-primary);
    border-color: var(--agent-v2-primary);
    color: #fff;
}
.agent-v2-ui-table-wrap {
    overflow-x: auto;
}
.agent-v2-ui-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.agent-v2-ui-table-wrap th,
.agent-v2-ui-table-wrap td {
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    padding: 8px;
    text-align: left;
}
@media (max-width: 768px) {
    .agent-v2-body {
        padding-left: 14px;
        padding-right: 14px;
    }
    .agent-v2-ui-card { border-radius: 14px; padding: 12px; }
    .agent-v2-ui-field-grid,
    .agent-v2-ui-field-grid-inline .agent-v2-ui-field-grid { grid-template-columns: 1fr; }
    .agent-v2-ui-doc-row { grid-template-columns: 30px minmax(0, 1fr); }
    .agent-v2-ui-doc-open,
    .agent-v2-ui-doc-action { width: auto; min-width: 0; flex: 0 1 auto; }
    .agent-v2-ui-doc-actions { justify-content: flex-start; }
    .agent-v2-ui-actions { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; }
    .agent-v2-ui-action { width: auto; flex: 0 1 auto; }
}
