/* ==============================================
   AUSPEX CHAT - Claude-Inspired Modern Design
   Uses Aunoo theme colors from aunoo-theme.css
   ============================================== */

/* ============================================
   FLOATING CHAT BUTTON
   ============================================ */
.floating-chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    background: var(--colors-accent-8, #ec4899);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--colors-accent-alpha-20, rgba(236, 72, 153, 0.2));
    z-index: 1000;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--colors-accent-alpha-30, rgba(236, 72, 153, 0.3));
    background: var(--colors-accent-9, #e93d82);
}

.floating-chat-button.minimized {
    width: 160px;
    border-radius: 26px;
    font-size: 13px;
    padding: 0 18px;
    justify-content: flex-start;
    gap: 10px;
}

.floating-chat-button.minimized::after {
    content: "Auspex Chat";
    font-weight: 500;
}

.floating-chat-button.pulse {
    animation: auspex-pulse 2s infinite;
}

@keyframes auspex-pulse {
    0%, 100% { box-shadow: 0 4px 12px var(--colors-accent-alpha-20, rgba(236, 72, 153, 0.2)); }
    50% { box-shadow: 0 4px 24px var(--colors-accent-alpha-30, rgba(236, 72, 153, 0.3)); }
}

/* Hide floating button when modal is open */
body.modal-open .floating-chat-button,
.chat-modal.show ~ .floating-chat-button {
    display: none !important;
}

/* ============================================
   MODAL - FULL LAYOUT
   ============================================ */
.chat-modal .modal-dialog {
    max-width: 95vw;
    width: 1100px;
    height: 85vh;
    margin: 7.5vh auto;
}

.chat-modal .modal-dialog.expanded,
.chat-modal .modal-dialog.modal-fullscreen {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
}

.chat-modal .modal-dialog.modal-fullscreen .modal-content {
    border-radius: 0;
    border: none;
}

.chat-modal .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--colors-neutral-4, #e9ecef);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    background: white;
}

.chat-modal .modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER - CLEAN & FUNCTIONAL
   ============================================ */
.floating-chat-header {
    background: white;
    border-bottom: 1px solid var(--colors-neutral-4, #e9ecef);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    min-height: 60px;
    gap: 12px;
}

.floating-chat-header h5,
.floating-chat-header .modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--colors-neutral-12, #111827);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.floating-chat-header h5 i,
.floating-chat-header .modal-title i {
    color: var(--colors-accent-8, #ec4899);
    font-size: 1.1rem;
}

.floating-chat-header small {
    font-size: 0.75rem;
    color: var(--colors-neutral-7, #adb5bd);
}

/* Header Controls */
.floating-chat-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Form Controls in Header */
.floating-chat-header .form-select,
.floating-chat-header select {
    height: 34px;
    padding: 4px 28px 4px 10px;
    font-size: 0.8125rem;
    border: 1px solid var(--colors-neutral-4, #e9ecef);
    border-radius: 6px;
    background-color: white;
    color: var(--colors-neutral-11, #212529);
    cursor: pointer;
    transition: all 0.15s ease;
}

.floating-chat-header .form-select:hover,
.floating-chat-header select:hover {
    border-color: var(--colors-neutral-5, #dee2e6);
}

.floating-chat-header .form-select:focus,
.floating-chat-header select:focus {
    outline: none;
    border-color: var(--colors-accent-7, #f769b7);
    box-shadow: 0 0 0 2px var(--colors-accent-alpha-10, rgba(236, 72, 153, 0.1));
}

.sampling-select {
    width: auto !important;
    min-width: auto !important;
    max-width: 130px !important;
}

.custom-limit-input {
    width: 70px;
    min-width: 70px;
    height: 34px;
    padding: 4px 8px;
    font-size: 0.8125rem;
    border: 1px solid var(--colors-neutral-4, #e9ecef);
    border-radius: 6px;
    display: none;
}

.custom-limit-input.show {
    display: block;
}

/* Context Info */
.context-info {
    background: var(--colors-neutral-3, #f1f3f5);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--colors-neutral-9, #495057);
}

/* Header Icon Buttons */
.floating-chat-icon-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--colors-neutral-8, #868e96);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-size: 0.875rem;
}

.floating-chat-icon-btn:hover {
    background: var(--colors-neutral-3, #f1f3f5);
    color: var(--colors-neutral-11, #212529);
}

.floating-chat-icon-btn.active,
.floating-chat-icon-btn.btn-success {
    background: var(--colors-accent-2, #fee9f5);
    color: var(--colors-accent-9, #e93d82);
}

/* Close Button - Standard dark X */
.floating-chat-header .btn-close {
    filter: none !important;
    opacity: 0.5 !important;
    width: 32px;
    height: 32px;
    background-size: 14px;
    flex-shrink: 0;
    margin-left: 4px;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.floating-chat-header .btn-close:hover {
    opacity: 1 !important;
    background-color: var(--colors-neutral-3, #f1f3f5);
}

/* ============================================
   CHAT CONTAINER - SIDEBAR + MAIN
   ============================================ */
.chat-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: 100%;
}

/* ============================================
   SIDEBAR - CHAT HISTORY
   ============================================ */
.chat-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--colors-neutral-2, #f8f9fa);
    border-right: 1px solid var(--colors-neutral-4, #e9ecef);
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
    overflow: hidden;
    box-shadow: none;
}

.chat-sidebar:not(.shown) {
    width: 0;
    min-width: 0;
    border-right: none;
}

.chat-sidebar-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--colors-neutral-4, #e9ecef);
    background: white;
    flex-shrink: 0;
}

.chat-sidebar-header h6 {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--colors-neutral-11, #212529);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-sidebar-header h6 i {
    color: var(--colors-accent-8, #ec4899);
    font-size: 0.875rem;
}

/* Chat Sessions List */
.chat-sessions-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-sessions-list::-webkit-scrollbar {
    width: 6px;
}

.chat-sessions-list::-webkit-scrollbar-track {
    background: transparent;
}

.chat-sessions-list::-webkit-scrollbar-thumb {
    background: var(--colors-neutral-5, #dee2e6);
    border-radius: 3px;
}

.chat-sessions-list::-webkit-scrollbar-thumb:hover {
    background: var(--colors-neutral-6, #ced4da);
}

/* Session Items - Correct class selectors */
.chat-session-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-session-item:hover {
    background: var(--colors-neutral-3, #f1f3f5);
}

.chat-session-item.active {
    background: var(--colors-accent-2, #fee9f5);
}

.chat-session-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.chat-session-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--colors-neutral-12, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-session-info {
    font-size: 0.6875rem;
    color: var(--colors-neutral-7, #adb5bd);
    margin-top: 2px;
}

.chat-session-info i {
    font-size: 0.625rem;
    margin-right: 3px;
}

.chat-session-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.chat-session-item:hover .chat-session-actions {
    opacity: 1;
}

/* Delete button in sessions - make small icon button */
.chat-session-actions .btn,
.chat-session-actions .btn-outline-danger,
.chat-session-actions button {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    padding: 0 !important;
    border-radius: 4px !important;
    font-size: 0.7rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    color: var(--colors-neutral-7, #adb5bd) !important;
}

.chat-session-actions .btn:hover,
.chat-session-actions .btn-outline-danger:hover,
.chat-session-actions button:hover {
    background: var(--colors-red-2, #fee2e2) !important;
    color: var(--colors-red-9, #dc2626) !important;
}

/* Empty State in Sidebar */
.chat-sessions-list .text-muted {
    color: var(--colors-neutral-7, #adb5bd);
    font-size: 0.8125rem;
}

.chat-sessions-list .text-center {
    font-size: 0.8125rem;
}

.chat-sessions-list .text-center i {
    font-size: 1.25rem;
    margin-bottom: 8px;
    display: block;
    color: var(--colors-neutral-6, #ced4da);
}

/* ============================================
   MAIN CHAT AREA
   ============================================ */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: var(--colors-neutral-2, #f8f9fa);
}

/* Main Controls (Sidebar Toggle & Expand) */
.chat-main-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: white;
    border-bottom: 1px solid var(--colors-neutral-4, #e9ecef);
    flex-shrink: 0;
}

.chat-main-controls .floating-chat-icon-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.8rem !important;
    background: var(--colors-neutral-2, #f8f9fa) !important;
    border: 1px solid var(--colors-neutral-4, #e9ecef) !important;
    border-radius: 6px !important;
}

.chat-main-controls .floating-chat-icon-btn:hover {
    background: var(--colors-neutral-3, #f1f3f5) !important;
    border-color: var(--colors-neutral-5, #dee2e6) !important;
}

#expandWindowBtn {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.8rem !important;
}

/* Toggle icon rotation when sidebar is hidden */
.chat-sidebar:not(.shown) ~ .chat-main #toggleSidebar i {
    transform: rotate(180deg);
}

/* ============================================
   MESSAGES AREA
   ============================================ */
.floating-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* In fullscreen mode, constrain the messages area and center it */
.modal-dialog.expanded .floating-chat-messages,
.modal-dialog.modal-fullscreen .floating-chat-messages {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* Messages stay aligned left/right within the constrained area */
.modal-dialog.expanded .floating-chat-messages .floating-message,
.modal-dialog.modal-fullscreen .floating-chat-messages .floating-message {
    max-width: 85%;
}

.floating-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.floating-chat-messages::-webkit-scrollbar-track {
    background: var(--colors-neutral-3, #f1f3f5);
    border-radius: 4px;
}

.floating-chat-messages::-webkit-scrollbar-thumb {
    background: var(--colors-neutral-5, #dee2e6);
    border-radius: 4px;
}

.floating-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--colors-neutral-6, #ced4da);
}

/* ============================================
   MESSAGE BUBBLES
   ============================================ */
.floating-message {
    display: flex;
    gap: 12px;
    max-width: 90%;
    animation: messageSlideIn 0.25s ease-out;
    position: relative;
}

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

/* Message Avatar */
.floating-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
}

/* User Messages */
.floating-message.user,
.floating-message.user-message {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.floating-message.user .floating-message-avatar,
.floating-message.user-message .floating-message-avatar {
    background: var(--colors-accent-8, #ec4899);
    color: white;
}

.floating-message.user .floating-message-content,
.floating-message.user-message .floating-message-content {
    background: var(--colors-accent-8, #ec4899);
    color: white;
    border-radius: 16px 16px 4px 16px;
}

.floating-message.user .floating-message-content a,
.floating-message.user-message .floating-message-content a {
    color: white;
    text-decoration: underline;
}

/* Assistant Messages */
.floating-message.assistant,
.floating-message.assistant-message {
    align-self: flex-start;
}

.floating-message.assistant .floating-message-avatar,
.floating-message.assistant-message .floating-message-avatar {
    background: var(--colors-accent-2, #fee9f5);
    color: var(--colors-accent-9, #e93d82);
}

.floating-message.assistant .floating-message-content,
.floating-message.assistant-message .floating-message-content {
    background: white;
    color: var(--colors-neutral-12, #111827);
    border-radius: 4px 16px 16px 16px;
    border: 1px solid var(--colors-neutral-4, #e9ecef);
}

/* Copy Button */
.floating-message-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

.floating-message:hover .floating-message-copy {
    opacity: 1;
}

.floating-message-copy:hover {
    color: #ec4899;
    background: rgba(236, 72, 153, 0.1);
}

.floating-message-copy:focus {
    outline: none;
}

/* Message Content */
.floating-message-content {
    padding: 12px 16px;
    font-size: 0.9rem;
    line-height: 1.6;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    position: relative;
}

/* Chart Container Styling */
.auspex-chart-container {
    margin: 15px 0;
    padding: 16px;
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    border-radius: 12px;
    border: 1px solid #f9a8d4;
}

.auspex-chart-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: #831843;
    font-size: 1rem;
}

.floating-message-content strong {
    font-weight: 600;
}

.floating-message-content h1,
.floating-message-content h2,
.floating-message-content h3,
.floating-message-content h4 {
    margin: 1em 0 0.5em 0;
    font-weight: 600;
    line-height: 1.3;
}

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

.floating-message-content h2 { font-size: 1.2rem; }
.floating-message-content h3 { font-size: 1.05rem; }
.floating-message-content h4 { font-size: 0.95rem; }

.floating-message-content p {
    margin: 0 0 0.75em 0;
}

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

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

.floating-message-content li {
    margin: 0.3em 0;
}

.floating-message-content a {
    color: var(--colors-accent-9, #e93d82);
    text-decoration: none;
}

.floating-message-content a:hover {
    text-decoration: underline;
}

.floating-message-content code {
    background: var(--colors-neutral-3, #f1f3f5);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: 'SF Mono', 'Consolas', monospace;
}

.floating-message-content pre {
    background: var(--colors-neutral-11, #212529);
    color: var(--colors-neutral-3, #f1f3f5);
    padding: 12px 14px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.75em 0;
    font-size: 0.8rem;
}

.floating-message-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.floating-message-content blockquote {
    border-left: 3px solid var(--colors-accent-6, #fa8fc9);
    margin: 0.75em 0;
    padding: 0.5em 0 0.5em 1em;
    color: var(--colors-neutral-9, #495057);
    background: var(--colors-accent-alpha-10, rgba(236, 72, 153, 0.1));
    border-radius: 0 6px 6px 0;
}

.floating-message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75em 0;
    font-size: 0.85rem;
}

.floating-message-content th,
.floating-message-content td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--colors-neutral-4, #e9ecef);
}

.floating-message-content th {
    font-weight: 600;
    background: var(--colors-neutral-2, #f8f9fa);
}

/* ============================================
   CHAT BOTTOM AREA - CENTERED INPUT & TOOLS
   ============================================ */
.chat-bottom-area {
    flex-shrink: 0;
    background: white;
    border-top: 1px solid var(--colors-neutral-4, #e9ecef);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

/* ============================================
   QUICK QUERIES / PLUGIN TOOLS
   ============================================ */
.floating-quick-queries {
    padding: 12px 24px;
    background: transparent;
    border-top: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.floating-quick-queries label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--colors-neutral-8, #868e96);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.floating-quick-queries .loading-tools {
    font-size: 0.8125rem;
    color: var(--colors-neutral-7, #adb5bd);
}

#pluginToolsContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

/* Plugin Tool Buttons - Use correct class .floating-quick-btn */
.floating-quick-btn {
    padding: 6px 14px !important;
    font-size: 0.75rem !important;
    border-radius: 16px !important;
    background: var(--colors-neutral-3, #f1f3f5) !important;
    border: 1px solid var(--colors-neutral-4, #e9ecef) !important;
    color: var(--colors-neutral-11, #212529) !important;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.floating-quick-btn:hover {
    background: var(--colors-accent-2, #fee9f5) !important;
    border-color: var(--colors-accent-4, #fcc5e3) !important;
    color: var(--colors-accent-11, #c42b5c) !important;
}

.floating-quick-btn.active,
.floating-quick-btn.deep-research-btn.active,
.floating-quick-btn.web-search-btn.active,
.floating-quick-btn.charts-btn.active {
    background: var(--colors-accent-8, #ec4899) !important;
    border-color: var(--colors-accent-8, #ec4899) !important;
    color: white !important;
}

.floating-quick-btn i {
    font-size: 0.7rem;
}

/* ============================================
   INPUT AREA - CLAUDE-STYLE
   ============================================ */
.floating-chat-input {
    padding: 16px 24px 20px;
    background: transparent;
    border-top: none;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
    max-width: 800px;
    width: 100%;
    box-sizing: border-box;
}

.floating-chat-input textarea,
.floating-chat-input .form-control {
    flex: 1;
    border: 1px solid var(--colors-neutral-4, #e9ecef);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 0.9rem;
    resize: none;
    min-height: 42px;
    max-height: 150px;
    line-height: 1.5;
    background: var(--colors-neutral-2, #f8f9fa);
    color: var(--colors-neutral-12, #111827);
    transition: all 0.2s ease;
}

.floating-chat-input textarea::placeholder {
    color: var(--colors-neutral-7, #adb5bd);
}

.floating-chat-input textarea:focus,
.floating-chat-input .form-control:focus {
    outline: none;
    background: white;
    border-color: var(--colors-accent-6, #fa8fc9);
    box-shadow: 0 0 0 3px var(--colors-accent-alpha-10, rgba(236, 72, 153, 0.1));
}

.floating-chat-input textarea:disabled,
.floating-chat-input .form-control:disabled {
    background: var(--colors-neutral-3, #f1f3f5);
    cursor: not-allowed;
}

/* Input Buttons */
.floating-chat-input .btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

/* Save Button */
#floatingChatSave {
    background: transparent;
    border: 1px solid var(--colors-neutral-4, #e9ecef);
    color: var(--colors-neutral-7, #adb5bd);
}

#floatingChatSave:hover:not(:disabled) {
    background: var(--colors-neutral-3, #f1f3f5);
    color: var(--colors-neutral-11, #212529);
    border-color: var(--colors-neutral-5, #dee2e6);
}

#floatingChatSave:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Send Button */
#floatingChatSend {
    background: var(--colors-accent-8, #ec4899);
    border: none;
    color: white;
}

#floatingChatSend:hover:not(:disabled) {
    background: var(--colors-accent-9, #e93d82);
    transform: scale(1.05);
}

#floatingChatSend:disabled {
    background: var(--colors-neutral-5, #dee2e6);
    color: var(--colors-neutral-7, #adb5bd);
    cursor: not-allowed;
}

/* ============================================
   CLAUDE-STYLE CENTERED LAYOUT (Empty State)
   ============================================ */
/* When chat is empty, center input in middle of screen */
.chat-main.empty-state {
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.chat-main.empty-state .floating-chat-messages {
    display: none;
}

.chat-main.empty-state .chat-main-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: transparent;
    border-bottom: none;
}

/* Centered welcome greeting */
.chat-centered-welcome {
    text-align: center;
    margin-bottom: 24px;
}

.chat-centered-welcome h2 {
    font-size: 2rem;
    font-weight: 400;
    color: var(--colors-neutral-12, #111827);
    margin: 0;
}

.chat-centered-welcome h2 i {
    color: var(--colors-accent-8, #ec4899);
    margin-right: 8px;
}

/* Centered input wrapper */
.chat-centered-input-wrapper {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
}

.chat-main.empty-state .floating-chat-input {
    background: white;
    border: 1px solid var(--colors-neutral-4, #e9ecef);
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 8px 12px;
}

.chat-main.empty-state .floating-chat-input textarea {
    background: transparent;
    border: none;
    box-shadow: none;
}

.chat-main.empty-state .floating-chat-input textarea:focus {
    box-shadow: none;
    border: none;
}

/* Centered tools below input */
.chat-main.empty-state .floating-quick-queries {
    border-top: none;
    background: transparent;
    justify-content: center;
    padding: 16px 0;
}

.chat-main.empty-state .floating-quick-queries label {
    display: none;
}

/* ============================================
   LOADING STATE
   ============================================ */
.floating-chat-loading {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid var(--colors-neutral-4, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--colors-neutral-8, #868e96);
}

.floating-chat-loading i {
    color: var(--colors-accent-8, #ec4899);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    width: fit-content;
    border: 1px solid var(--colors-neutral-4, #e9ecef);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--colors-neutral-6, #ced4da);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        background: var(--colors-neutral-6, #ced4da);
    }
    30% {
        transform: translateY(-6px);
        background: var(--colors-accent-6, #fa8fc9);
    }
}

/* ============================================
   DEEP RESEARCH PROGRESS
   ============================================ */
.research-progress-container {
    max-width: 500px;
    margin: 0 0 12px 0;  /* Left-aligned like assistant messages */
}

/* ============================================
   CHART CONTAINERS
   ============================================ */
.auspex-charts-area {
    margin-bottom: 12px;
}

.auspex-chart-container {
    margin: 12px 0;
    padding: 16px;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--colors-neutral-4, #e9ecef);
}

.auspex-chart-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--colors-neutral-12, #111827);
    font-size: 0.9rem;
}

/* ============================================
   TOOLS CONFIG MODAL - Pink Theme
   ============================================ */
#toolsConfigModal .modal-content {
    border-radius: 16px;
    overflow: hidden;
}

#toolsConfigModal .form-check-input {
    width: 40px;
    height: 20px;
    cursor: pointer;
    border: 2px solid #d1d5db;
    background-color: #e5e7eb;
}

#toolsConfigModal .form-check-input:checked {
    background-color: #ec4899 !important;
    border-color: #ec4899 !important;
}

#toolsConfigModal .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
    border-color: #ec4899;
}

#toolsConfigModal .form-switch .form-check-input:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='white'/%3e%3c/svg%3e");
}

.tool-config-item {
    transition: all 0.15s ease;
}

.tool-config-item:hover {
    background: #f3f4f6 !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 992px) {
    .chat-modal .modal-dialog {
        width: 95vw;
        max-width: 95vw;
        height: 90vh;
        margin: 5vh auto;
    }

    .chat-sidebar {
        width: 220px;
        min-width: 220px;
    }

    .floating-chat-controls {
        gap: 6px;
    }

    .floating-chat-header .form-select,
    .floating-chat-header select {
        font-size: 0.75rem;
        padding: 4px 24px 4px 8px;
    }

    .sampling-select {
        width: 100px;
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .chat-modal .modal-dialog {
        width: 100%;
        max-width: 100%;
        height: 100%;
        margin: 0;
    }

    .chat-modal .modal-content {
        border-radius: 0;
    }

    .floating-chat-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
        gap: 10px;
    }

    .floating-chat-header > div:first-child {
        width: 100%;
    }

    .floating-chat-controls {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .chat-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 10;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .chat-sidebar:not(.shown) {
        transform: translateX(-100%);
    }

    .floating-chat-messages {
        padding: 16px;
    }

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

    .floating-chat-button {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }

    .context-info {
        display: none !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-muted {
    color: var(--colors-neutral-7, #adb5bd) !important;
}

.text-accent {
    color: var(--colors-accent-9, #e93d82) !important;
}

.bg-accent-light {
    background: var(--colors-accent-2, #fee9f5) !important;
}

.opacity-75 {
    opacity: 0.75;
}

.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-3 { margin-bottom: 1rem; }
.p-3 { padding: 1rem; }
.ms-2 { margin-left: 0.5rem; }
