/* Root variables for theming - Standard Theme */
:root {
    /* ChatGPT-style color tokens - Standard Theme */
    --surface-0: #f7f8fa;
    --surface-1: #ffffff;
    --surface-2: #f7f7f8;
    --accent: #10a37f;
    --text-primary: #f7fafd;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-light: #e5e5e5;
    --border-medium: #d1d5db;
    --hover-bg: #f3f4f6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-lg: 20px;
    /* Layout dimensions */
    --nav-width: 260px;
    --top-bar-height: 60px;
    --composer-height: auto;
    /* Transition */
    --transition: 200ms ease-out;
}

/* Theme Variants */
[data-theme="dark"] {
    --surface-0: #121212;
    --surface-1: #1e1e1e;
    --surface-2: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-tertiary: #666666;
    --border-light: #404040;
    --border-medium: #525252;
    --hover-bg: #333333;
}

[data-theme="dnadarkblue"] {
    --surface-0: #121212;
    --surface-1: transparent;
    --surface-2: #fefefe;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-tertiary: #666666;
    --border-light: #404040;
    --border-medium: #525252;
    --hover-bg: #333333;
}

[data-theme="high-contrast"] {
    --surface-0: #ffffff;
    --surface-1: #ffffff;
    --surface-2: #f5f5f5;
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-tertiary: #666666;
    --accent: #0066cc;
    --border-light: #000000;
    --border-medium: #333333;
}

[data-theme="ocean-light"] {
    --surface-0: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --surface-1: rgba(255, 255, 255, 0.9);
    --surface-2: rgba(255, 255, 255, 0.7);
    --accent: #4f46e5;
}

[data-theme="money-green"] {
    --surface-0: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --surface-1: rgba(255, 255, 255, 0.9);
    --surface-2: rgba(255, 255, 255, 0.7);
    --accent: #059669;
}

:root {
  --dt-color-background: #0d0e1f;
  --dt-color-background-stripe-1: #4e4949;
    
  --dt-color-text: #f9f5f5;
}

html.dark {
  --dt-color-background: #333333;
  --dt-color-text: #ffffff;
}

body {
background:
        radial-gradient(circle at top left, rgb(0 0 0 / 45%), transparent 55%),
        radial-gradient(circle at bottom right, rgb(1 11 13 / 35%), transparent 60%),
        radial-gradient(circle at center, rgb(4 15 28 / 90%), rgb(0 3 10 / 98%)) ;    
}

/* Apply these variables in your CSS */
.dataTables_wrapper {
  background-color: var(--dt-color-background);
  color: var(--dt-color-text);
}


table.dataTable tbody tr {
    background-color: var(--dt-color-background);
}

table.dataTable tbody tr.selected {
    background-color: #b0bed9
}

table.dataTable tbody th,table.dataTable tbody td {
    padding: 8px 10px
}


table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td {
    border-top: none
}

.table td  {
    color: white;
}

table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td {
    border-top: 1px solid var(--dt-color-background);
    border-right: 1px solid var(--dt-color-background);
}

table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child {
    border-left: 1px solid #ddd
}

table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td {
    border-top: none
}

table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd {
    background-color: var(--dt-color-background);
}

table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected {
    background-color: #acbad4
}

table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover {
    background-color: var(--dt-color-background);
}

table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected {
    xbackground-color: #393d45
}

table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3 {
    background-color: var(--dt-color-background);
}

table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3 {
    background-color: #acbad5
}

table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1 {
    background-color: var(--dt-color-background-stripe);
}

table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2 {
    background-color: var(--dt-color-background);
}

table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3 {
    background-color: var(--dt-color-background);
}

table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1 {
    background-color: #a6b4cd
}

table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2 {
    background-color: #a8b5cf
}

table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3 {
    background-color: #a9b7d1
}

table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1 {
    background-color: var(--dt-color-background-stripe-1);
}

table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2 {
    background-color: #fcfcfc
}

table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3 {
    background-color: #fefefe
}

table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1 {
    background-color: #acbad5
}

table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2 {
    background-color: #aebcd6
}

table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3 {
    background-color: #afbdd8
}

table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1 {
    background-color: #eaeaea
}

table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2 {
    background-color: #ececec
}

table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3 {
    background-color: #efefef
}

table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1 {
    background-color: #a2aec7
}

table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2 {
    background-color: #a3b0c9
}

table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3 {
    background-color: #a5b2cb
}

table.dataTable.no-footer {
    border-bottom: 1px solid #111
}

.tab-button {
    color: whitesmoke;
}
.tab-button.is-active {
    color: white;
    font-weight: 600;
}


/* Dropdown floating styles */
.userProfile {
    position: relative;
    display: inline-block;
    z-index: 11000;
}

.table td {
    background-color: black;
}

input {
    background: transparent; 
}

.user-dropdown-wrapper {
    cursor: pointer;
    z-index: 13600 !important;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 12010;
    display: none; /* default hidden, toggled via JS */
    background: black;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 150px;
    max-width: 160px;
}

.user-dropdown .dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    white-space: nowrap;
    color: var(--text-primary);
}

.user-dropdown .dropdown-item:hover {
    background: var(--hover-bg);
}

/* Global styles */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Inter, system-ui, 'Segoe UI', Roboto, sans-serif;
    background: var(--surface-0);
    color: var(--text-primary);
    overflow: hidden;
}

.d-flex {
    display: flex;
}

/* Root Layout - CSS Grid */
.app-layout {
    display: grid;
    grid-template-columns: var(--nav-width) 1fr auto;
    grid-template-rows: 100vh;
    height: 100vh;
    position: relative;
}

/* Left Navigation Drawer */
.left-nav {
    background: var(--surface-1);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
}

.nav-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.brand-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.brand-title {
    margin: 0;
    margin-bottom: 0.25rem;
    font-size: 1.0rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-tabs .nav-link {
    border-bottom-left-radius: 0px;
    border-bottom-right-radius: 0px;
}

.nav-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nav-toggle:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.new-chat-btn {
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition);
}

.new-chat-btn:hover {
    background: color-mix(in srgb, var(--accent) 90%, black);
}

.nav-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    transition: all var(--transition);
}

.left-nav.collapsed .nav-content {
    display: none;
}

.search-section {
    margin-bottom: 1rem;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrapper i {
    position: absolute;
    left: 0.75rem;
    color: var(--text-secondary);
    z-index: 1;
}

.search-input,input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    font-size: 0.875rem;
    color: black; /* var(--text-primary); */
    outline: none;
    transition: all var(--transition);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.conversation-item {
    padding: 0.15rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.conversation-item:hover {
    background: var(--hover-bg);
}

.conversation-item.active {
    background: var(--hover-bg);
    border-color: var(--accent);
}

.conversation-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.nav-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-light);
}

.settings-btn {
    width: 100%;
    background: none;
    border: none;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition);
}

.settings-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* Main Layout */
.main-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 0;
    background: var(--surface-0);
}

/* Top Bar */
.top-bar {
    height: var(--top-bar-height);
    background: black;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 50;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.conversation-title {
    margin: 0;
    font-size: 1.0rem;
    font-weight: 300;
    color: var(--text-primary);
    border: none;
    background: none;
    outline: none;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.conversation-title:focus {
    background: var(--hover-bg);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.model-picker {
    background: var(--surface-0);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    max-width: 150px;
}


.top-bar-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.top-bar-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* Conversation Pane */
.conversation-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    xmax-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1rem;
}

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

.welcome-message {
    text-align: center;
    margin-bottom: 2rem;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.user-message {
    align-self: flex-end;
    max-width: 80%;
}

.assistant-message {
    align-self: flex-start;
    max-width: 95%;
}

.message-content {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: 1.0rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-content table {
    overflow-x: scroll;
    max-width: 100%;
    display: block;
}

.user-message .message-content {
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 6px;
}

.assistant-message .message-content {
    background: black;
    color: white;
    border: 1px solid var(--border-light);
    border-bottom-left-radius: 6px;
    box-shadow: var(--shadow);
}

/* Message wrapper and actions */
.message-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.message-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity var(--transition);
    align-self: flex-end;
}

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

.assistant-message .message-actions {
    align-self: flex-start;
}

.message:hover .message-actions {
    opacity: 1;
}

.message-action-btn {
    background: var(--surface-1);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 1.75rem;
}

.message-action-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.message-action-btn:active {
    transform: scale(0.95);
}

/* Toast notifications */
.toast {
    background: var(--surface-1);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow);
    color: var(--text-primary);
    font-size: 0.875rem;
    max-width: 300px;
    word-wrap: break-word;
}

.toast-success {
    border-left: 4px solid var(--accent);
}

.toast-error {
    border-left: 4px solid #ef4444;
}

/* Markdown content styling for assistant messages */
.assistant-message .message-content h1, .assistant-message .message-content h2, .assistant-message .message-content h3, .assistant-message .message-content h4, .assistant-message .message-content h5, .assistant-message .message-content h6 {
    margin: 0.5rem 0 0.25rem 0;
    color: #ffffff; /* var(--text-primary); */
    font-weight: 600;
}

.assistant-message .message-content h1 {
    font-size: 1.25rem;
}

.assistant-message .message-content h2 {
    font-size: 1.1rem;
}

.assistant-message .message-content h3 {
    font-size: 1rem;
}

.assistant-message .message-content h4, .assistant-message .message-content h5, .assistant-message .message-content h6 {
    font-size: 0.9rem;
}

.assistant-message .message-content p {
    margin: 0.5rem 0;
}

.assistant-message .message-content code {
    background: #424040;
    color: yellow;
    font-weight: 600;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.assistant-message .message-content pre {
    background: var(--surface-2);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 0.5rem 0;
}

.assistant-message .message-content pre code {
    background: none;
    padding: 0;
    background: #1f1f25;
    color: yellow;
    font-weight: 600;
}

.assistant-message .message-content blockquote {
    border-left: 3px solid var(--border-medium);
    padding-left: 1rem;
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

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

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

.assistant-message .message-content a {
    color: var(--accent);
    text-decoration: none;
}

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

.assistant-message .message-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.5rem 0;
}

.assistant-message .message-content th, .assistant-message .message-content td {
    border: 1px solid var(--border-light);
    padding: 0.5rem;
    text-align: left;
}

.assistant-message .message-content th {
    background: var(--surface-2);
    color: blue;
    font-weight: 600;
}

/* Loading animation */
.chat-loading {
    padding: 1rem 0;
    display: flex;
    justify-content: flex-start;
    margin-left: 1.5rem;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    animation: loading-bounce 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Thinking component styles */
.thinking-container {
    margin: 0.75rem 0;
}

.thinking-pill {
    background: #3c3a3a;// var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.thinking-pill:hover {
    border-color: var(--border-medium);
}

.thinking-pill.expanded {
    border-color: var(--accent);
}

.thinking-header {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
    transition: background-color var(--transition);
}

.thinking-header:hover {
    background: var(--hover-bg);
}

.thinking-text {
    font-weight: 500;
    color: var(--text-primary);
}

.thinking-dots {
    display: flex;
    gap: 3px;
    align-items: center;
}

.thinking-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    animation: thinking-bounce 1.4s infinite ease-in-out;
}

.stream-complete .thinking-dots {
    display: none;
}

.thinking-pill {
  opacity: 1;
  max-height: 100px;     /* set this to roughly your pill’s full height */
  overflow: hidden;      /* so it collapses cleanly */
  transition:
    opacity 2s ease,
    max-height 2s ease;
}

.stream-complete .thinking-pill {
  opacity: 0;
  max-height: 0;
}

.messxage {
    opacity: 1;
   
    
}

.message.fading {
 opacity: 0;
  max-height: 0;
  transition:
    opacity 3s ease,
    max-height 3s ease;
}

.thinking-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.thinking-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes thinking-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.thinking-toggle {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 0.8rem;
    transition: transform var(--transition);
}

.thinking-pill.expanded .thinking-toggle {
    transform: rotate(90deg);
}

.thinking-content {
    padding: 0 1rem 1rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    border-top: 1px solid var(--border-light);
    background: var(--surface-1);
    white-space: pre-wrap;
}

/* Composer */
.composer {
    background: var(--surface-1);
    border-top: 1px solid var(--border-light);
    padding: 1.5rem;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.attachment-staging {
    margin-bottom: 1rem;
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}

.staging-content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.attachment-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: var(--surface-1);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    max-width: 200px;
    gap: 0.5rem;
}

.attachment-item.image-attachment {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.25rem;
}

.attachment-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
    margin: 0;
}

.attachment-size {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
}

.attachment-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.composer-wrapper {
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 1rem;
}

.composer-tools {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.composer-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.composer-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.composer-btn.active {
    background: var(--accent) !important;
    color: white;
}

.composer-btn.active:hover {
    background: var(--accent);
    color: white;
    opacity: 0.9;
}

.composer-input-wrapper {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    xoverflow: hidden;
}

.composer-input {
    width: 100%;
    border: none;
    background: none;
    padding: 1rem 1.5rem;
    padding-right: 120px;
    resize: none;
    min-height: 24px;
    max-height: 200px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}

.composer-input::placeholder {
    color: var(--text-secondary);
}

.composer-controls {
    right: 0.75rem;
    bottom: 0.75rem;
    display: flex;
    gap: 0.5rem;
    align-items: right;
    margin-left: 56px;
}

.chat-send, .chat-cancel {
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.chat-send {
    background: var(--accent);
    color: white;
}

.chat-send:hover {
    background: color-mix(in srgb, var(--accent) 90%, black);
}

.chat-send:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
}

.chat-cancel {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-medium);
}

.chat-cancel:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* Right Side-sheet */
.right-sheet {
    width: 300px;
    min-width: 300px;
    max-width: 60vw;
    background: var(--surface-1);
    border-left: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    z-index: 50;
    position: relative;
}

.sheet-resizer {
    width: 4px;
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    cursor: col-resize;
    background: transparent;
    z-index: 1351;
}

.sheet-resizer:hover {
    background: var(--border-medium);
}

.sheet-resizer.resizing {
    background: var(--primary);
}

.sheet-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sheet-header-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sheet-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.sheet-action-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.sheet-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sheet-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.sheet-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Artifact Display (in right sheet) */
.artifact-display {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.artifact-content {
    max-height: none;
    overflow: visible;
    background: white;
}

/* Artifact Summary Pills in Chat */
.artifact-summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.9rem;
    max-width: 280px;
}

.artifact-summary-pill:hover {
    background: var(--hover-bg);
    border-color: var(--border-medium);
    transform: translateY(-1px);
}

.artifact-summary-pill .artifact-icon {
    color: var(--primary);
    font-size: 1rem;
}

.artifact-summary-pill .artifact-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
    font-weight: 500;
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    transition: opacity var(--transition);
}

.mobile-overlay.active {
    display: block;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar, .nav-content::-webkit-scrollbar, .sheet-content::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track, .nav-content::-webkit-scrollbar-track, .sheet-content::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb, .nav-content::-webkit-scrollbar-thumb, .sheet-content::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover, .nav-content::-webkit-scrollbar-thumb:hover, .sheet-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 1440px) {
    .right-sheet {
        xwidth: 350px;
    }
}

@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .left-nav {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: var(--nav-width);
        transform: translateX(-100%);
        z-index: 200;
    }

    .left-nav.open {
        transform: translateX(0);
    }

    .mobile-nav-toggle {
        display: block;
    }

    .mobile-overlay.active {
        display: block;
    }

    .userInfo {
        position: fixed;
        right: 10px;
        top:  10px;
        xdisplay: initial;
        z-index: 12000;
        height: 30px;
        width: 130px;
        text-align: right;
    }

    .right-sheet {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        z-index: 150;
        transform: translateX(100%);
        transition: transform var(--transition);
    }

    .right-sheet.open {
        transform: translateX(0);
    }
}

@media (max-width: 640px) {
    :root {
        --nav-width: 280px;
        --top-bar-height: 50px;
    }

    .top-bar {
        padding: 0 1rem;
    }

    .conversation-title {
        font-size: 1rem;
    }

    .top-bar-right {
        gap: 0.5rem;
    }

    .composer {
        padding: 1rem;
    }

    .composer-tools {
        display: none;
    }

    .conversation-pane {
        padding: 0 0.5rem;
    }

    .chat-messages {
        padding: 1rem 0;
        gap: 1rem;
    }

    .message-content {
        padding: 0.75rem 1rem;
    }

    .btn-text {
        display: none;
    }

    .right-sheet {
        width: 100vw;
    }
}

/* Utility classes for theme switching */
.theme-switcher {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: var(--surface-1);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 0.25rem;
}

/* Settings Modal */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--surface-1);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.settings-section {
    margin-bottom: 2rem;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.theme-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.theme-controls .theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--surface-2);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.theme-controls .theme-btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.theme-controls .theme-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.theme-icon {
    font-size: 1.5rem;
    display: block;
}

.theme-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.theme-controls .theme-btn.active .theme-name {
    color: white;
}

@media (max-width: 640px) {
    .theme-controls {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast adjustments */
@media (prefers-contrast: high) {
    :root {
        --border-light: #000000;
        --border-medium: #000000;
        --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
}

.xLongRunningTaskStatus {
    width: 300px;
    height: 100px;
    border: 1px solid #e3e3e6;
    /* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#ffffff+0,e5e5e5+100;White+3D */
    background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%);
    /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
    color: #133ea9;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 8px 7px 5px -2px rgba(0,0,0,0.54);
    -webkit-box-shadow: 8px 7px 5px -2px rgba(0,0,0,0.54);
    -moz-box-shadow: 8px 7px 5px -2px rgba(0,0,0,0.54);
    margin-bottom: 200px;
}

.LongRunningTaskStatus {
    width: 320px;
    min-height: 110px;
    background: linear-gradient(180deg, #0e1b2a 0%, #0a1220 100%);
    color: #e6f0ff;
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
}

.LongRunningTaskStatus .progressBarOuter {
    margin-top: 12px;
    width: 100%;
    height: 12px;
    padding: 2px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
}

.LongRunningTaskStatus .progressBarInner {
    height: 8px;
    margin: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, #38bdf8 0%, #4ade80 60%, #f59e0b 100%);
    box-shadow: 0 0 10px rgba(56,189,248,0.35);
}

.userInfo i {
    font-size: 1.5em;
}

.initials-avatar {
    width: 28px;
    height: 28px;
    background-color: #4a90e2;
    color: white;
    font-weight: bold;
    font-size: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: sans-serif;
    cursor: pointer;
}

/*─────────────────────────────*/
/*     Banner / Header         */
/*─────────────────────────────*/
.research-banner {
    background: linear-gradient(to bottom, #0a1c3a 0%, #000000 100%);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 1.5rem;
    padding-top: 10px;
    padding-bottom: 10px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10110;
}

.research-banner.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 5px 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}


.banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.login-register-button {
    display: none;
}

.modal-box-shadow {
    border: 3px solid #678cf0 !important;
}


/* Toggle Switch (compatible markup) */
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 22px; top:4px; left: 4px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #4b5563; transition: var(--chat-transition); border-radius: 999px; }
.toggle-switch .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 2px; bottom: 2px; background-color: var(--chat-text-light); transition: var(--chat-transition); border-radius: 50%; }
.toggle-switch input:checked + .slider { background-color: var(--chat-accent-blue); }
.toggle-switch input:checked + .slider:before { transform: translateX(20px); }


.workspace-selector-popout {
    border: none;
    background: transparent;
}