:root {
  --bg-page: #ffffff;
  --bg-dark: #ffffff;
  --bg-sidebar: #fcfaf8;
  --sidebar-bg: #fcfaf8;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-surface-hover: #f1f5f9;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --bg-code: #f1f5f9;
  --text-primary: #111827;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  --border-color: #e5e7eb;
  --border-subtle: #f3f4f6;
  --user-bubble-bg: #f3f4f6;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --sidebar-width: 260px;
  --nav-active-bg: #e2e8f0;
  --nav-active-text: #0f172a;
  --scrollbar-thumb: rgba(0, 0, 0, 0.25);
  --scrollbar-thumb-hover: rgba(0, 0, 0, 0.45);
  --scrollbar-track: transparent;
}

/* Global Cursor Caret & Selection Controls to eliminate text carets on buttons/nav labels */
.sidebar,
.nav-item,
.nav-text,
.history-title,
.history-group-title,
.history-item-wrap,
.chat-btn,
.settings-tab-btn,
.proj-tab-btn,
.user-profile-card,
.btn,
.btn-black,
.btn-secondary {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

input, textarea, [contenteditable="true"] {
  user-select: text !important;
  -webkit-user-select: text !important;
  caret-color: var(--accent-blue, #0284c7);
}

[data-theme="dark"], html.dark, body.dark {
  --bg-page: #0b0f17;
  --bg-dark: #0b0f17;
  --bg-sidebar: #0f172a;
  --sidebar-bg: #0f172a;
  --bg-surface: #1e293b;
  --bg-card: #1e293b;
  --bg-surface-hover: #334155;
  --bg-card-hover: #334155;
  --bg-input: #111827;
  --bg-code: #0b1220;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  --border-color: #334155;
  --border-subtle: #1e293b;
  --user-bubble-bg: #1e293b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --nav-active-bg: #1e293b;
  --nav-active-text: #f8fafc;
  --scrollbar-thumb: rgba(255, 255, 255, 0.22);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.45);
  --scrollbar-track: transparent;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: none;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
  padding: 0 2px 0 6px;
}

#sidebarBrandTitle {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 175px;
  display: inline-block;
  vertical-align: middle;
  line-height: 1.3;
  cursor: pointer;
  transition: color 0.15s ease;
  margin-left: 6px;
}

#sidebarBrandTitle:hover {
  color: var(--accent-blue, #38bdf8);
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 400;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  outline: none;
}

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

.nav-item.active {
  background: var(--nav-active-bg, var(--bg-surface-hover));
  color: var(--nav-active-text, var(--text-primary));
  border: 1px solid var(--border-color);
  font-weight: 500;
}

.nav-section {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 24px;
  margin-bottom: 8px;
  padding-left: 12px;
  font-weight: 400;
}

.history-group-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 16px 8px 6px 8px;
}

.history-item-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
  border-radius: 8px;
  transition: background 0.15s ease;
  position: relative;
}

.history-item-wrap:hover,
.history-item-wrap.active {
  background: var(--bg-card-hover, rgba(255, 255, 255, 0.07));
}

.history-item-wrap .nav-item {
  padding: 6px 10px;
  font-size: 0.85rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 8px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
}

.history-item-wrap .nav-item.active {
  background: var(--bg-card-hover, rgba(255, 255, 255, 0.08));
  font-weight: 600;
  color: var(--text-primary);
}

.conv-more-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  margin-right: 4px;
  border-radius: 6px;
  opacity: 0;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-item-wrap:hover .conv-more-btn,
.history-item-wrap.active .conv-more-btn {
  opacity: 0.8;
}

.conv-more-btn:hover {
  opacity: 1 !important;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

/* Floating Context Dropdown Menu */
.conv-dropdown-menu {
  background: var(--bg-surface, #1e1f26);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  padding: 6px;
  min-width: 190px;
  animation: fadeInMenu 0.15s ease;
}

@keyframes fadeInMenu {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.conv-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-align: left;
}

.conv-dropdown-item svg {
  stroke: var(--text-muted);
  transition: stroke 0.15s ease;
  flex-shrink: 0;
}

.conv-dropdown-item:hover {
  background: var(--bg-card-hover, rgba(255, 255, 255, 0.08));
  color: var(--text-primary);
}

.conv-dropdown-item:hover svg {
  stroke: var(--text-primary);
}

.conv-dropdown-item.danger {
  color: #f87171;
}

.conv-dropdown-item.danger svg {
  stroke: #f87171;
}

.conv-dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-dark);
}

.topbar {
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.content-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Chat Container Layout */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

/* Dynamic Model Header Bar */
.chat-model-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.chat-model-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 4px 24px 4px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Chat Rows & Alignments */
.chat-message-row {
  display: flex;
  width: 100%;
  margin-bottom: 4px;
}

.chat-message-row.user-row {
  justify-content: flex-end;
}

.chat-message-row.agent-row {
  justify-content: flex-start;
}

.message-bubble {
  line-height: 1.6;
  font-size: 0.95rem;
  color: var(--text-primary);
  word-break: break-word;
}

/* User Message Bubble — Plain clean text without wrapper box */
.message-bubble.user {
  align-self: flex-end;
  max-width: 75%;
  width: fit-content;
  padding: 4px 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-primary);
  position: relative;
  font-size: 0.95rem;
  line-height: 1.55;
  transition: all 0.2s ease;
  text-align: right;
}

.composer-model-select {
  background: var(--bg-surface-hover, #f8fafc);
  color: var(--text-primary, #111827);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-model-select:hover {
  border-color: var(--accent);
}

.composer-model-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.user-message-content {
  white-space: pre-wrap;
  word-break: break-word;
}

.message-user-action-btns {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.message-bubble.user:hover .message-user-action-btns {
  opacity: 1;
}

.user-msg-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-msg-action-btn svg {
  stroke: var(--text-muted);
  transition: stroke 0.15s ease;
}

.user-msg-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.user-msg-action-btn:hover svg {
  stroke: var(--text-primary);
}

/* AI Message Card (A13 Surface Panel) */
.message-bubble.agent {
  align-self: flex-start;
  max-width: 820px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  position: relative;
  transition: all 0.2s ease;
}

.agent-avatar-header {
  display: none !important;
  border-bottom: none !important;
}

.agent-avatar-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.agent-meta-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.status-badge {
  font-size: 0.78rem;
  padding: 0;
  margin-top: 4px;
  font-weight: 400;
  border: none !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  opacity: 0.75;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.status-badge.online { color: #22c55e !important; }
.status-badge.stopped,
.status-badge.failed { color: var(--text-muted) !important; opacity: 0.7; }

.agent-content-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-primary);
}

/* Claude Dashboard Styles */
.claude-dashboard {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.dashboard-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.dashboard-title {
  font-family: Georgia, serif;
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--text-primary);
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.icon-btn:hover {
  color: var(--text-primary);
}

.btn-black {
  background: #000;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-black:hover {
  opacity: 0.8;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 60px;
}

.empty-icon {
  margin-bottom: 24px;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.empty-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 400px;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Legacy Dashboard Cards (overridden for light theme) */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

/* Chat View */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  background: transparent;
  border-radius: 0;
  border: none;
  box-shadow: none;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px 32px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.chat-message-row {
  display: flex;
  width: 100%;
  margin-bottom: 4px;
}

.chat-message-row.user-row {
  justify-content: flex-end;
}

.chat-message-row.agent-row {
  justify-content: flex-start;
}

.message-bubble {
  line-height: 1.6;
  font-size: 0.95rem;
  color: var(--text-primary);
  word-break: break-word;
}

.message-bubble.user {
  align-self: flex-end;
  max-width: 75%;
  width: fit-content;
  padding: 4px 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-primary);
  position: relative;
  transition: all 0.2s ease;
  text-align: right;
}

.user-message-content {
  white-space: pre-wrap;
  word-break: break-word;
}

.message-user-action-btns {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.message-bubble.user:hover .message-user-action-btns {
  opacity: 1;
}

.user-msg-action-btn {
  background: transparent;
  border: none;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}

.user-msg-action-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}

.message-bubble.agent {
  align-self: flex-start;
  max-width: 800px;
  width: 100%;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  color: var(--text-primary);
}

.agent-avatar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.agent-avatar-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.3px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.3);
}

.agent-meta-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.status-badge {
  font-size: 0.78rem;
  padding: 0;
  margin-top: 4px;
  font-weight: 400;
  border: none !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  opacity: 0.75;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.status-badge.stopped,
.status-badge.failed { background: transparent !important; color: var(--text-muted) !important; border: none !important; }

.agent-content-body {
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--text-primary);
}

.chat-input-bar {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.chat-input::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}
.chat-input:focus {
  border-color: var(--accent);
}

.chat-btn {
  padding: 12px 20px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.chat-btn:hover {
  opacity: 0.85;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}
.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}
.data-table th {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
}
.badge-active { background: rgba(16, 185, 129, 0.15); color: #10b981; border-color: rgba(16, 185, 129, 0.3); }
.badge-inactive { background: var(--bg-surface-hover); color: var(--text-muted); border-color: var(--border-color); }

/* Global Modal Container */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-content {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  width: 94%;
  max-width: 760px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  overflow: hidden;
  transition: max-width 0.2s ease;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
}
.modal-title { font-weight: 600; font-size: 1.1rem; color: var(--text-primary); }
.modal-close {
  background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted);
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 24px; color: var(--text-primary); }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-surface);
}
.btn-secondary {
  padding: 10px 16px;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--bg-surface-hover); }

/* Toast Notification System */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  width: calc(100% - 40px);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 10px;
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  font-size: 0.9rem;
  line-height: 1.4;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}
.toast.toast-info { border-left: 4px solid #38bdf8; }
.toast.toast-success { border-left: 4px solid #22c55e; }
.toast.toast-warning { border-left: 4px solid #f59e0b; }
.toast.toast-error { border-left: 4px solid #ef4444; }

.toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: 12px;
  line-height: 1;
}
.toast-close:hover { color: #f8fafc; }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* History Group Headers */
.history-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-top: 14px;
  margin-bottom: 6px;
  padding-left: 8px;
}

/* Status Badges */
.badge-running, .badge-planning { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.badge-completed { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.badge-failed { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge-pending { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.badge-cancelled { background: #f1f5f9; color: #64748b; border-color: #cbd5e1; }

/* Mobile Support */
.hamburger-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}
.drawer-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 40;
}
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0; left: -260px;
    height: 100vh;
    z-index: 50;
    transition: left 0.3s ease;
  }
  .sidebar.open { left: 0; }
  .drawer-overlay.open { display: block; }
  .content-container { padding: 12px; }
  .chat-model-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
  }
  .chat-input-bar {
    gap: 6px;
  }
  #chatModelSelect {
    width: 140px !important;
  }
}

@media (max-width: 480px) {
  .chat-model-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  #chatModelSelect {
    width: 100% !important;
  }
  .chat-input-bar {
    flex-wrap: wrap;
  }
  #chatInput {
    min-width: 100%;
    order: 1;
  }
  #chatAttachBtn {
    order: 2;
  }
  #chatSendBtn {
    order: 3;
    flex: 1;
  }
}

/* Skeleton Loading & Inline Loaders */
@keyframes pulseSkeleton {
  0% { opacity: 0.5; }
  50% { opacity: 0.85; }
  100% { opacity: 0.5; }
}

.skeleton-box {
  background: var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  animation: pulseSkeleton 1.5s infinite ease-in-out;
}

.inline-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spinLoader 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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

.section-error-card {
  padding: 32px 24px;
  max-width: 500px;
  margin: 30px auto;
  text-align: center;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
  border-radius: 12px;
}

/* Home Landing View Styling */
.home-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  box-sizing: border-box;
  transform: translateY(-4%);
}

.home-welcome {
  text-align: center;
  margin-bottom: 24px;
  width: 100%;
}

.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.2);
  border-radius: 20px;
  color: #0284c7;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 18px;
}

.home-title {
  font-size: 2.1rem;
  font-weight: 400;
  color: var(--text-primary, #1e293b);
  margin-bottom: 28px;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.home-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.5;
}

.home-model-bar {
  width: 100%;
  max-width: 760px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.home-composer-card {
  width: 100%;
  max-width: 760px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.home-composer-card:focus-within {
  border-color: #0284c7;
  box-shadow: 0 12px 36px rgba(2, 132, 199, 0.12);
}

.home-textarea {
  width: 100%;
  min-height: 80px;
  max-height: 240px;
  resize: none;
  border: none !important;
  background: transparent !important;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.5;
  padding: 0;
  outline: none !important;
}

.home-composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  margin-top: 8px;
}

.home-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
  max-width: 760px;
}

.quick-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.quick-pill:hover {
  background: var(--bg-card-hover);
  border-color: #0284c7;
  color: #0284c7;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .home-title {
    font-size: 1.7rem;
  }
  .home-container {
    padding: 16px 10px;
    min-height: calc(100vh - 80px);
  }
  .home-model-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .home-quick-actions {
    flex-direction: column;
    width: 100%;
  }
  .quick-pill {
    width: 100%;
    text-align: left;
  }
}

@media (min-width: 769px) {
  .topbar {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .topbar {
    display: flex !important;
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    height: auto !important;
    background: transparent !important;
    border-bottom: none !important;
    padding: 0 !important;
    z-index: 40 !important;
    pointer-events: none !important;
  }

  .topbar .page-title,
  .topbar .topbar-right,
  .topbar .topbar-model-select-wrap {
    display: none !important;
  }

  .hamburger-btn {
    pointer-events: auto !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-radius: 12px !important;
    color: #ffffff !important;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
    transition: all 0.2s ease;
  }

  .hamburger-btn:active {
    background: rgba(56, 189, 248, 0.25) !important;
    transform: scale(0.95);
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    width: 280px !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 1000 !important;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.5) !important;
  }

  .sidebar.open {
    left: 0 !important;
  }

  .drawer-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 999 !important;
    display: none;
  }

  .drawer-overlay.open {
    display: block !important;
  }
}

.minimal-composer-card {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 26px;
  padding: 4px 8px 4px 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.minimal-composer-card:focus-within {
  border-color: var(--accent, #3b82f6);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.12);
}

.minimal-composer-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
}

.composer-flex-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

.composer-textarea-container {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 24px;
}

.composer-textarea {
  width: 100%;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  resize: none;
  min-height: 24px;
  max-height: 240px;
  font-size: 0.96rem;
  line-height: 1.4;
  color: var(--text-primary, #1e293b);
  padding: 3px 0;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-sizing: border-box;
  font-family: inherit;
}

.composer-textarea::-webkit-scrollbar {
  display: none;
}

.composer-right-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  align-self: flex-end;
}

.minimal-composer-card.expanded {
  max-width: 900px;
  border-radius: 20px;
}

.minimal-composer-card.expanded .composer-textarea {
  min-height: 120px;
  max-height: 360px;
}

.composer-expand-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #6b6b6b);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.composer-expand-btn:hover {
  background: var(--bg-card-hover, #f3f3ee);
  color: var(--text-primary, #1e1e1e);
}

.composer-plus-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #6b6b6b);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
  align-self: flex-end;
}

.composer-plus-btn:hover {
  background: var(--bg-card-hover, rgba(0, 0, 0, 0.05));
  color: var(--text-primary, #1e1e1e);
}

.composer-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary, #0f172a);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
  align-self: flex-end;
}

.composer-send-btn:hover {
  background: var(--bg-card-hover, rgba(0, 0, 0, 0.05));
  color: var(--accent-blue, #2563eb);
  transform: scale(1.08);
}

.composer-send-btn.stop-state {
  background: #ef4444 !important;
  color: #ffffff !important;
}

.composer-send-btn:disabled,
.composer-send-btn.no-models-disabled {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
  transform: none !important;
  color: var(--text-muted, #94a3b8) !important;
  background: transparent !important;
  pointer-events: none !important;
}

/* Attachment preview wrapped grid at top */
.composer-attachments-row,
.attachment-pill-container {
  display: flex;
  flex-wrap: wrap;
  max-height: 180px;
  overflow-y: auto;
  gap: 8px;
  padding: 4px 2px 6px 2px;
  margin-bottom: 8px;
  width: 100%;
  box-sizing: border-box;
  scrollbar-width: thin;
}

.composer-attachment-card {
  position: relative;
  flex-shrink: 0;
  box-sizing: border-box;
}

.composer-attachment-card.image-card {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card-hover, #f8fafc);
}

.composer-attachment-card.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-upload-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  gap: 4px;
  backdrop-filter: blur(2px);
}

.composer-attachment-card.doc-card {
  height: 52px;
  flex: 1 1 150px;
  min-width: 130px;
  max-width: 220px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.composer-attachment-card.doc-card.error-state {
  border-color: #fca5a5;
  background: #fff5f5;
}

.doc-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.doc-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.doc-filename {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.doc-subtext {
  font-size: 0.68rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  margin-top: 1px;
}

.spinner-small {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-top-color: #0284c7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.attachment-retry-btn {
  font-size: 0.68rem;
  background: #fee2e2;
  color: #ef4444;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
  margin-top: 2px;
  font-weight: 600;
}

.attachment-remove-btn {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(100, 116, 139, 0.85);
  color: #ffffff;
  border: 1.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 9px;
  z-index: 5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: background 0.15s ease, transform 0.15s ease;
}

.attachment-remove-btn:hover {
  background: #ef4444;
  transform: scale(1.1);
}

/* User Profile Card at Sidebar Bottom */
.user-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-color, #e5e3db);
  margin-top: auto;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-logout-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.user-logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ======================================================
   A13 NATIVE USER CHAT UI — OPEN WEBUI Inspired Styling
   ====================================================== */

/* Code Blocks & Markdown Formatting */
.markdown-body {
  line-height: 1.6;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.markdown-body p {
  margin-bottom: 0.75rem;
}
.markdown-body p:last-child {
  margin-bottom: 0;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.markdown-body ul, .markdown-body ol {
  margin-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.markdown-body blockquote {
  border-left: 3px solid var(--accent-blue, #38bdf8);
  padding-left: 12px;
  margin: 0.75rem 0;
  color: var(--text-muted);
  font-style: italic;
  background: rgba(56, 189, 248, 0.05);
  border-radius: 0 6px 6px 0;
  padding-top: 4px;
  padding-bottom: 4px;
}

.markdown-table-wrapper {
  overflow-x: auto;
  margin: 1rem 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.markdown-body th, .markdown-body td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
}

.markdown-body th {
  background: rgba(15, 23, 42, 0.06);
  font-weight: 600;
}

.inline-code {
  background: var(--bg-code);
  color: #f43f5e;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
  border: 1px solid var(--border-subtle);
}

/* Fenced Code Block UI */
.code-block-wrapper {
  margin: 1rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-code);
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  padding: 6px 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  border-bottom: 1px solid var(--border-color);
}

.code-block-lang {
  font-weight: 600;
  color: var(--accent);
  text-transform: lowercase;
}

.code-block-copy-btn {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.code-block-copy-btn:hover {
  background: var(--accent);
  color: #ffffff;
}

.code-block-content {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.5;
}

/* Message Actions & Metrics Bar */
.message-footer-bar {
  display: none !important;
  border-top: none !important;
}

.message-metrics-badge {
  font-size: 0.73rem;
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.message-action-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.msg-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.msg-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Settings Modal Tabs */
.settings-tabs-row {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 22px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.settings-tabs-row::-webkit-scrollbar {
  display: none;
}

.settings-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  border-radius: 8px 8px 0 0;
}

.settings-tab-btn svg {
  flex-shrink: 0;
  opacity: 0.75;
  transition: all 0.2s ease;
}

.settings-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.settings-tab-btn:hover svg {
  opacity: 1;
}

.settings-tab-btn.active {
  color: var(--accent-blue, #0284c7);
  border-bottom-color: var(--accent-blue, #0284c7);
  font-weight: 600;
  background: rgba(2, 132, 199, 0.08);
}

.settings-tab-btn.active svg {
  opacity: 1;
  stroke: var(--accent-blue, #0284c7);
}

.settings-tab-panel {
  display: none;
  animation: fadeInTab 0.2s ease;
}

.settings-tab-panel.active {
  display: block;
}

@keyframes fadeInTab {
  from { opacity: 0.4; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-color);
}

.settings-section-title svg {
  color: var(--accent-blue, #0284c7);
  flex-shrink: 0;
}

/* Conversation Sidebar Item Actions */
.conv-item-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.88rem;
  transition: background 0.2s ease;
}

.conv-item-row:hover {
  background: var(--bg-card-hover, #f3f3ee);
}

.conv-item-row.active {
  background: var(--nav-active-bg, var(--bg-surface-hover));
  color: var(--nav-active-text, var(--text-primary));
  border: 1px solid var(--border-color);
  font-weight: 500;
}

.conv-item-actions {
  display: none;
  gap: 4px;
}

.conv-item-row:hover .conv-item-actions {
  display: flex;
}

.conv-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

.conv-action-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}

/* Collapsible Sidebar for Desktop */
.sidebar.collapsed {
  width: 72px;
  padding: 16px 8px;
}

.sidebar.collapsed .brand span,
.sidebar.collapsed .brand-title,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .history-group-title,
.sidebar.collapsed #recentHistoryList,
.sidebar.collapsed .history-item-wrap,
.sidebar.collapsed .conv-item-row,
.sidebar.collapsed .sidebar-search-box,
.sidebar.collapsed .user-info {
  display: none !important;
}

.sidebar.collapsed .brand {
  justify-content: center !important;
  margin-bottom: 20px;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
  width: 44px;
  height: 44px;
  margin: 0 auto 4px auto;
  border-radius: 10px;
}

.sidebar.collapsed .nav-item svg {
  margin: 0 auto;
}

.sidebar.collapsed .user-profile-card {
  justify-content: center;
  padding: 8px 4px;
}

.sidebar.collapsed .user-logout-btn {
  display: none !important;
}

/* Sidebar Search Nav Item */
.nav-search-li {
  list-style: none;
  margin-top: 2px;
}

.nav-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.chat-input-search {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.82rem;
  border-radius: 8px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
}

.chat-input-search:focus {
  border-color: var(--accent);
}

/* Markdown Tables */
.markdown-table-wrapper {
  overflow-x: auto;
  margin: 14px 0;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.markdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.markdown-table th {
  background: var(--bg-dark);
  padding: 10px 14px;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-primary);
}

.markdown-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.markdown-table tr:last-child td {
  border-bottom: none;
}

.markdown-table tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

/* Syntax Highlighting for Native Code Blocks */
.code-block-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.86rem;
  line-height: 1.5;
}

.hl-keyword {
  color: #f43f5e;
  font-weight: 600;
}

.hl-string {
  color: #10b981;
}

.hl-comment {
  color: #94a3b8;
  font-style: italic;
}

.hl-number {
  color: #f59e0b;
}

/* Composer Audio Dictation Button */
.composer-audio-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-dark);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 4px;
}

.composer-audio-btn:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.composer-audio-btn.recording {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  animation: pulse-audio 1.5s infinite;
}

@keyframes pulse-audio {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* User Message Actions */
.message-bubble.user {
  position: relative;
}

.user-action-btn {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.user-action-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
}

.chat-markdown-link {
  color: #38bdf8;
  text-decoration: underline;
  word-break: break-all;
}

.chat-markdown-link:hover {
  color: #0284c7;
}



/* Empty Chat Welcome Hero */
.empty-chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 60px auto 30px auto;
  padding: 0 16px;
  width: 100%;
}

.empty-chat-title {
  font-size: 1.85rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  line-height: 1.35;
  max-width: 680px;
  margin: 0 auto;
}

/* Agent Message Action Bar & Buttons */
.agent-msg-action-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.msg-action-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 5px 7px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.msg-action-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.msg-action-icon-btn.active {
  color: var(--accent-blue);
  background: rgba(2, 132, 199, 0.15);
}

/* Floating Message Context Menu */
.msg-context-menu {
  position: fixed;
  z-index: 10000;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fadeInFast 0.15s ease;
}

.msg-context-header {
  padding: 6px 12px 8px 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
  font-weight: 500;
}

.msg-context-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s ease;
}

.msg-context-item:hover {
  background: var(--sidebar-bg);
  color: var(--accent-blue);
}

.msg-context-item svg {
  flex-shrink: 0;
  opacity: 0.85;
}

/* --- Rich File Attachments & Image Previews --- */
.user-images-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.user-attached-img-card {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.user-attached-img-card:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.user-attached-img-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-attached-img-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  color: #ffffff;
  font-size: 0.72rem;
  pointer-events: none;
}

.user-attached-img-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
  font-weight: 500;
}

.user-attached-img-size {
  opacity: 0.8;
  font-size: 0.68rem;
}

.user-attached-img-dl {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 2;
}

.user-attached-img-card:hover .user-attached-img-dl {
  opacity: 1;
}

.user-attached-img-dl:hover {
  background: var(--accent-blue, #0284c7);
}

.user-attached-img-card.img-load-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.7);
}

.user-attached-img-card.img-load-fallback::before {
  content: "";
  display: block;
  width: 32px;
  height: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='%2306b6d4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'%3E%3C/circle%3E%3Cpolyline points='21 15 16 10 5 21'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  margin-bottom: 24px;
}

.user-docs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.user-attached-doc-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  max-width: 360px;
  box-sizing: border-box;
}

.user-attached-doc-card:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.user-doc-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-doc-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-doc-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-doc-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
}

.user-doc-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.user-doc-label {
  font-size: 0.74rem;
}

.user-doc-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.user-doc-action-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Lightbox Modal */
.image-lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 26, 0.88);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.image-lightbox-modal.active {
  display: flex;
}

.image-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-lightbox-content img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
}

.image-lightbox-bar {
  margin-top: 10px;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 0.88rem;
  padding: 4px 8px;
}

.image-lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.15s ease;
}

.image-lightbox-close:hover {
  background: #ef4444;
}

.doc-badge-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  display: inline-block;
}

/* Artifacts & Documents Compact View Styles */
.artifact-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.artifact-compact-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.artifact-compact-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.artifact-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.artifact-del-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.artifact-del-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.artifact-img-thumb {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e2e8f0);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.artifact-img-thumb:hover {
  opacity: 0.9;
}

.artifact-icon-box {
  width: 100%;
  height: 70px;
  background: var(--sidebar-bg, #f8fafc);
  border: 1px dashed var(--border-color, #e2e8f0);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.artifact-more-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.artifact-more-btn:hover {
  color: var(--text-primary, #f8fafc);
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.08));
}

/* DeepSeek-Inspired Landing Page Styling */
.ds-landing-wrapper {
  position: relative;
  min-height: calc(100vh - 48px);
  flex: 1;
  width: calc(100% + 64px);
  margin: -24px -32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px 36px 32px;
  box-sizing: border-box;
  background-color: var(--bg-dark, #0b0f19);
  background-image: 
    radial-gradient(circle at 50% 22%, rgba(56, 189, 248, 0.13) 0%, transparent 60%),
    radial-gradient(circle at 85% 75%, rgba(99, 102, 241, 0.09) 0%, transparent 50%),
    radial-gradient(circle at 15% 65%, rgba(14, 165, 233, 0.09) 0%, transparent 50%),
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  background-position: center center;
  overflow-y: auto;
  color: var(--text-primary);
}

[data-theme="light"] .ds-landing-wrapper,
.light .ds-landing-wrapper {
  background-color: #f1f5f9;
  background-image: 
    radial-gradient(circle at 50% 20%, rgba(56, 189, 248, 0.2) 0%, transparent 65%),
    radial-gradient(circle at 85% 75%, rgba(168, 85, 247, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 15% 65%, rgba(14, 165, 233, 0.12) 0%, transparent 50%),
    linear-gradient(to right, rgba(0, 50, 100, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 50, 100, 0.04) 1px, transparent 1px);
}

@media (max-width: 768px) {
  .ds-landing-wrapper {
    width: calc(100% + 24px);
    margin: -12px -12px;
    padding: 16px 16px 24px 16px;
    min-height: calc(100vh - 24px);
  }
}

.ds-landing-header {
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  z-index: 10;
}

.ds-landing-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
}

.ds-brand-logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}

.ds-landing-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ds-lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary, #cbd5e1);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ds-lang-badge:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.ds-landing-main {
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: auto 0;
  padding: 40px 0;
  z-index: 5;
}

.ds-announcement-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  backdrop-filter: blur(10px);
  border-radius: 30px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 28px;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.ds-announcement-badge:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.2);
}

.ds-badge-sparkle {
  color: #38bdf8;
  font-size: 0.95rem;
}

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

.ds-badge-arrow {
  color: #38bdf8;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.ds-announcement-badge:hover .ds-badge-arrow {
  transform: translateX(3px);
}

.ds-hero-title {
  font-size: 3.2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-primary, #ffffff);
  margin: 0 0 36px 0;
  line-height: 1.15;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
}

@media (max-width: 768px) {
  .ds-hero-title {
    font-size: 2.2rem;
    margin-bottom: 24px;
  }
}

.ds-prompt-card {
  width: 100%;
  max-width: 760px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 20px 24px 14px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  text-align: left;
}

[data-theme="light"] .ds-prompt-card,
.light .ds-prompt-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 50, 100, 0.12);
  box-shadow: 0 20px 45px rgba(0, 60, 120, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.ds-prompt-card:focus-within {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(56, 189, 248, 0.2);
  transform: translateY(-2px);
}

.ds-prompt-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1.05rem;
  line-height: 1.5;
  resize: none;
  min-height: 54px;
  max-height: 200px;
  font-family: inherit;
  box-sizing: border-box;
  padding: 4px 0;
}

.ds-prompt-textarea::placeholder {
  color: var(--text-muted, #64748b);
  font-size: 1.05rem;
  font-weight: 400;
}

.ds-prompt-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 10px;
}

.ds-prompt-left-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ds-prompt-attach-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary, #cbd5e1);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ds-prompt-attach-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

.ds-model-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ds-model-select option {
  background: #0f172a;
  color: #f8fafc;
}

.ds-prompt-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.45);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ds-prompt-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.6);
  background: linear-gradient(135deg, #0369a1, #0284c7);
}

.ds-prompt-send-btn:active {
  transform: scale(0.95);
}

/* Modern Theme-Adaptive Loyihalar (Projects) CSS */
.loyihalar-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 24px 32px;
  box-sizing: border-box;
  color: var(--text-primary);
  text-align: left;
}

.loyihalar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  width: 100%;
}

.loyihalar-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
  text-align: left;
}

.btn-yangi-loyiha {
  background: var(--accent, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 9px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-yangi-loyiha:hover {
  background: var(--accent-hover, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.loyihalar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 240px));
  gap: 18px;
  justify-content: start;
  width: 100%;
}

.loyiha-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px 20px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.loyiha-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent, #3b82f6);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--accent, #3b82f6);
}

.loyiha-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.loyiha-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-surface-hover);
  color: var(--accent, #3b82f6);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.loyiha-card-menu-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
  transition: all 0.15s ease;
}

.loyiha-card-menu-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.loyiha-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 14px 0 4px 0;
  word-break: break-word;
  line-height: 1.35;
  text-align: left;
}

.loyiha-card-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: left;
  font-weight: 500;
}

/* Creation View / Modal */
.create-loyiha-container {
  max-width: 680px;
  margin: 30px auto;
  text-align: center;
  padding: 0 16px;
}

.create-loyiha-icon-header {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.4rem;
}

.create-loyiha-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.create-loyiha-input-wrap {
  margin-bottom: 32px;
}

.create-loyiha-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 600;
  padding: 8px 4px;
  outline: none;
  transition: border-color 0.2s ease;
  text-align: center;
}

.create-loyiha-input::placeholder {
  color: var(--text-muted);
}

.create-loyiha-input:focus {
  border-color: var(--accent, #3b82f6);
}

.create-loyiha-presets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  text-align: left;
  margin-bottom: 32px;
}

.preset-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.preset-card:hover {
  border-color: var(--accent, #3b82f6);
  background: var(--bg-card-hover);
}

.preset-card.selected {
  background: var(--bg-card-hover);
  border-color: var(--accent, #3b82f6);
  box-shadow: 0 0 0 1px var(--accent, #3b82f6);
}

.preset-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-surface-hover);
  color: var(--accent, #3b82f6);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.preset-card-checkmark {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent, #3b82f6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
}

.preset-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.preset-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Loyiha Detail View */
.loyiha-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border: none !important;
}

.loyiha-detail-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  border: none !important;
}

.loyiha-detail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--bg-surface-hover);
  color: var(--accent, #3b82f6);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.loyiha-detail-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a) !important;
  margin: 0;
  border: none !important;
  letter-spacing: -0.01em;
}

.btn-manba-qoshish {
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a) !important;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.btn-manba-qoshish:hover {
  background: var(--accent, #2563eb);
  color: #ffffff !important;
  border-color: var(--accent, #2563eb);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.loyiha-detail-menu-btn {
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a) !important;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.loyiha-detail-menu-btn:hover {
  background: var(--bg-surface-hover, #f1f5f9);
  border-color: var(--accent, #3b82f6);
  color: var(--accent, #3b82f6) !important;
}

/* Loyiha Sozlamalari Modal */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border-color, #e2e8f0);
  transition: .25s ease;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s ease;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent, #2563eb);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.project-instructions-textarea {
  width: 100%;
  background: var(--bg-input, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text-primary, #0f172a) !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
}

.project-instructions-textarea:focus {
  border-color: var(--accent, #2563eb);
}

.gemini-ask-capsule {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 28px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.gemini-ask-capsule:focus-within {
  border-color: var(--accent, #3b82f6);
  box-shadow: 0 0 0 1px var(--accent, #3b82f6), 0 4px 16px rgba(59, 130, 246, 0.12);
}

.gemini-ask-plus-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary, #475569) !important;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.gemini-ask-plus-btn:hover {
  color: var(--text-primary, #0f172a) !important;
  background: var(--bg-surface-hover, #f1f5f9);
}

.gemini-ask-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary, #0f172a) !important;
  font-size: 0.95rem;
  outline: none;
  padding: 6px 0;
}

.gemini-ask-input::placeholder {
  color: var(--text-muted, #64748b) !important;
}

.gemini-model-select {
  background: var(--bg-surface-hover, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-primary, #0f172a) !important;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
  padding: 5px 12px;
  border-radius: 12px;
  font-weight: 500;
  transition: border-color 0.2s ease;
}

.gemini-model-select:hover {
  border-color: var(--accent, #3b82f6);
}

.avvalgi-chatlar-section {
  margin-top: 28px;
}

.avvalgi-chatlar-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-secondary, #475569) !important;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.chat-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 8px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.chat-item-row:hover {
  background: var(--bg-surface-hover, #f8fafc);
  border-color: var(--accent, #3b82f6);
  transform: translateX(2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.chat-item-title {
  font-size: 0.94rem;
  color: var(--text-primary, #0f172a) !important;
  font-weight: 600;
}

.chat-item-date {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b) !important;
  white-space: nowrap;
  font-weight: 500;
}

.chat-item-menu-btn {
  background: transparent;
  color: var(--text-muted, #64748b) !important;
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: all 0.15s ease;
  opacity: 0.75;
}

.chat-item-row:hover .chat-item-menu-btn {
  opacity: 1;
}

.chat-item-menu-btn:hover {
  background: var(--bg-surface-hover, #f1f5f9);
  color: var(--text-primary, #0f172a) !important;
}

/* Universal Themed Dropdown Styles */
.dropdown-menu-themed {
  position: absolute;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 6px 0;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 4px 6px rgba(0, 0, 0, 0.05);
  min-width: 160px;
}

[data-theme="dark"] .dropdown-menu-themed,
body.dark .dropdown-menu-themed {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dropdown-item-themed {
  padding: 8px 14px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-primary, #0f172a) !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.dropdown-item-themed:hover {
  background: var(--bg-surface-hover, #f1f5f9);
}

.dropdown-item-themed.danger {
  color: var(--danger, #ef4444) !important;
}

.dropdown-item-themed.danger:hover {
  background: rgba(239, 68, 68, 0.08);
}

/* Project Settings & Memory Scope Cards */
.project-scope-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.project-scope-card {
  position: relative;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--bg-surface, #f8fafc);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .project-scope-card,
body.dark .project-scope-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.project-scope-card:hover {
  border-color: var(--accent, #2563eb);
  background: var(--bg-surface-hover, #f1f5f9);
  transform: translateY(-1px);
}

[data-theme="dark"] .project-scope-card:hover,
body.dark .project-scope-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent, #3b82f6);
}

.project-scope-card.selected {
  border-color: var(--accent, #2563eb);
  background: rgba(37, 99, 235, 0.08);
  box-shadow: 0 0 0 1px var(--accent, #2563eb);
}

[data-theme="dark"] .project-scope-card.selected,
body.dark .project-scope-card.selected {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--accent, #3b82f6);
  box-shadow: 0 0 0 1px var(--accent, #3b82f6);
}

.project-scope-radio-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s ease;
}

.project-scope-card.selected .project-scope-radio-icon {
  border-color: var(--accent, #2563eb);
  background: var(--accent, #2563eb);
}

.project-scope-radio-inner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

.project-scope-card.selected .project-scope-radio-inner {
  opacity: 1;
  transform: scale(1);
}

.project-scope-content {
  flex: 1;
}

.project-scope-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.project-scope-title {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}

.project-scope-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent, #2563eb);
}

.project-scope-desc {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}

.project-settings-field-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  margin-bottom: 4px;
}

.project-settings-field-sub {
  font-size: 0.83rem;
  color: var(--text-muted, #64748b);
  line-height: 1.4;
  margin-bottom: 8px;
}

.project-instructions-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-surface, #f8fafc);
  color: var(--text-primary, #0f172a);
  font-size: 0.88rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 90px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .project-instructions-textarea,
body.dark .project-instructions-textarea {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.project-instructions-textarea:focus {
  outline: none;
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ========================================================
   AGENT HUB WORKSPACE & AUTONOMOUS EXECUTION STYLES
   ======================================================== */
.agent-hub-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 16px 60px 16px;
  box-sizing: border-box;
}

/* Hero Section */
.agent-hub-hero {
  text-align: center;
  margin-bottom: 28px;
}

.agent-hub-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 999px;
  color: #38bdf8;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 12px;
}

.agent-hub-hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary, #ffffff);
  letter-spacing: -0.5px;
  margin: 0 0 8px 0;
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.agent-hub-hero-desc {
  font-size: 0.96rem;
  color: var(--text-muted, #94a3b8);
  margin: 0 auto;
  max-width: 580px;
  line-height: 1.55;
}

/* Capsule Task Input */
.agent-task-capsule-wrapper {
  margin-bottom: 36px;
}

.agent-task-capsule {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  padding: 8px 14px 8px 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .agent-task-capsule,
body.dark .agent-task-capsule {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.14);
}

.agent-task-capsule:focus-within {
  border-color: var(--accent, #3b82f6);
  box-shadow: 0 12px 36px rgba(37, 99, 235, 0.3), 0 0 0 2px rgba(59, 130, 246, 0.35);
  background: #1e293b;
}

.agent-capsule-plus-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.agent-capsule-plus-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.05);
}

.agent-capsule-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary, #ffffff);
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
  padding: 8px 4px;
}

.agent-capsule-input::placeholder {
  color: var(--text-muted, #94a3b8);
  font-weight: 400;
}

.agent-capsule-mic-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.agent-capsule-mic-btn:hover {
  color: var(--accent, #38bdf8);
  background: rgba(56, 189, 248, 0.12);
}

.agent-capsule-mic-btn.listening {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.agent-capsule-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent, #2563eb);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.agent-capsule-send-btn:hover {
  background: #1d4ed8;
  transform: scale(1.06);
}

.agent-capsule-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 0 8px;
}

.agent-capsule-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 20px;
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.2s ease;
}

.agent-capsule-tag-name {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-capsule-tag-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 0.9rem;
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.15s ease;
}

.agent-capsule-tag-del:hover {
  background: rgba(239, 68, 68, 0.85);
  transform: scale(1.15);
}

.agent-capsule-plus-btn.has-files {
  background: rgba(34, 197, 94, 0.25);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

/* Quick Preset Tags Bar */
.agent-quick-tags-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.agent-quick-tag {
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  transition: all 0.2s ease;
}

.agent-quick-tag:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  transform: translateY(-1px);
}

/* Sections */
.agent-hub-section {
  margin-bottom: 36px;
}

.agent-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.agent-section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  letter-spacing: -0.2px;
}

.agent-section-count {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #94a3b8);
}

/* Empty Tasks */
.agent-empty-tasks {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.agent-empty-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.agent-empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  margin-bottom: 6px;
}

.agent-empty-sub {
  font-size: 0.88rem;
  color: var(--text-muted, #94a3b8);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Recent Tasks List */
.agent-recent-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-recent-task-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: #131b2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.agent-recent-task-card:hover {
  background: #1c263c;
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.agent-recent-task-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.agent-recent-task-info {
  flex: 1;
  min-width: 0;
}

.agent-recent-task-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.agent-recent-task-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}

.agent-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.agent-status-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.agent-status-badge.completed {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.agent-status-badge.running {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.agent-status-badge.pending {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.agent-status-badge.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.agent-status-badge.cancelled {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.agent-card-file-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
}

.agent-recent-task-desc {
  font-size: 0.84rem;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.agent-recent-task-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.agent-recent-task-time {
  font-size: 0.76rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 500;
  white-space: nowrap;
}

.agent-card-open-arrow {
  color: var(--text-muted, #64748b);
  transition: all 0.2s ease;
}

.agent-recent-task-card:hover .agent-card-open-arrow {
  color: #38bdf8;
  transform: translateX(3px);
}

.agent-all-tasks-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent, #38bdf8);
  cursor: pointer;
  transition: all 0.2s ease;
}

.agent-all-tasks-link:hover {
  color: #60a5fa;
  transform: translateX(2px);
}

/* Recommended Tasks List */
.agent-recommend-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-recommend-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #131b2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--accent, #3b82f6);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.agent-recommend-card:hover {
  background: #1c263c;
  border-left-color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateX(4px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.agent-recommend-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.agent-recommend-content {
  flex: 1;
  min-width: 0;
}

.agent-recommend-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  margin-bottom: 4px;
}

.agent-recommend-desc {
  font-size: 0.84rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.45;
}

.agent-recommend-arrow {
  color: var(--text-muted, #64748b);
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.agent-recommend-card:hover .agent-recommend-arrow {
  color: #38bdf8;
  transform: translateX(4px);
}

/* ========================================================
   AGENT CHAT WORKSPACE (MINIMALIST CONVERSATIONAL UI)
   ======================================================== */
.agent-live-execution-wrap {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 140px 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 75px);
}

.agent-chat-top-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 28px;
}

.agent-chat-back-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.agent-chat-back-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-primary, #ffffff);
  transform: translateX(-2px);
}

.agent-chat-top-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  letter-spacing: -0.3px;
}

.agent-chat-thread {
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex: 1;
}

/* User Message Group (Right Aligned) */
.agent-chat-user-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  max-width: 82%;
  margin-left: auto;
}

.agent-chat-user-file-pill {
  display: inline-flex;
  flex-direction: column;
  padding: 12px 18px;
  background: #182030;
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 14px;
  color: #cbd5e1;
  font-size: 0.92rem;
  min-width: 170px;
  max-width: 340px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.agent-chat-user-file-pill .pill-ext {
  font-size: 0.75rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.agent-chat-user-file-pill .pill-name {
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-chat-user-bubble {
  background: #1e2638;
  color: #f8fafc;
  padding: 14px 22px;
  border-radius: 22px 22px 4px 22px;
  font-size: 1.02rem;
  line-height: 1.6;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  word-break: break-word;
}

/* Subtle Progress Status Row (No Percentages, Clean Glowing Text) */
.agent-chat-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 24px;
  color: #93c5fd;
  font-size: 0.92rem;
  font-weight: 500;
  margin: 10px 0;
  width: fit-content;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.15);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.25s ease;
}

.agent-chat-status-pill .loading-spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
  border-color: #38bdf8;
  border-top-color: transparent;
}

.agent-chat-cancel-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  margin-left: 8px;
  transition: all 0.2s ease;
}

.agent-chat-cancel-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

/* Assistant Message Group (Left Aligned) */
.agent-chat-assistant-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 100%;
  animation: fadeIn 0.3s ease;
}

.agent-chat-assistant-bubble {
  color: #e2e8f0;
  font-size: 1.02rem;
  line-height: 1.75;
  padding: 6px 0;
  word-break: break-word;
}

.agent-chat-assistant-bubble p {
  margin: 0 0 14px 0;
}

.agent-chat-assistant-bubble p:last-child {
  margin-bottom: 0;
}

.agent-deliverable-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0;
  font-size: 1.02rem;
  line-height: 1.65;
}

.agent-deliverable-bullet {
  color: var(--text-muted, #94a3b8);
  font-size: 1rem;
}

.agent-chat-file-link,
.agent-chat-assistant-bubble a {
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.agent-chat-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.38);
  color: #4ade80 !important;
  text-decoration: none !important;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  margin: 8px 0;
  transition: all 0.2s ease;
}

.agent-chat-download-btn:hover {
  background: rgba(34, 197, 94, 0.28);
  border-color: #4ade80;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.25);
}

.agent-deliverable-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #111a2e;
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 14px;
  margin: 12px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.25s ease;
}

.agent-deliverable-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.agent-deliverable-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.agent-deliverable-sub {
  font-size: 0.8rem;
  color: #94a3b8;
}

.agent-deliverable-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #22c55e;
  color: #ffffff !important;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.agent-deliverable-download-btn:hover {
  background: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

/* Action Icons Row (👍 👎 📋 ⋯) */
.agent-chat-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 6px;
}

.agent-action-icon-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.agent-action-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary, #ffffff);
  transform: translateY(-1px);
}

.agent-action-icon-btn:active {
  transform: translateY(0);
}

/* Fixed Bottom Floating Capsule Bar */
.agent-chat-bottom-bar {
  position: sticky;
  bottom: 20px;
  width: 100%;
  margin-top: auto;
  padding-top: 24px;
  z-index: 100;
}

.agent-chat-bottom-bar .agent-task-capsule {
  background: #141a26;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  height: 56px;
  padding: 8px 16px 8px 10px;
}