.ai-chat-widget,
.ai-chat-widget *,
.ai-chat-widget *::before,
.ai-chat-widget *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  background: transparent;
  color: inherit;
  flex-direction: column;
  flex-basis: auto;
  flex-grow: 0;
  flex-shrink: 1;
  align-items: stretch;
  justify-content: flex-start;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
}
.ai-chat-widget,
.ai-chat-widget .chat-header,
.ai-chat-widget .chat-title,
.ai-chat-widget .chat-actions,
.ai-chat-widget .chat-body,
.ai-chat-widget .chat-messages,
.ai-chat-widget .chat-message,
.ai-chat-widget .welcome-message,
.ai-chat-widget .typing-indicator,
.ai-chat-widget .chat-input-container,
.ai-chat-widget .ai-avatar,
.ai-chat-widget .ai-avatar-small,
.ai-chat-widget .user-avatar {
  display: flex;
}
.ai-chat-widget .chat-header,
.ai-chat-widget .chat-title,
.ai-chat-widget .chat-actions,
.ai-chat-widget .welcome-message,
.ai-chat-widget .typing-indicator {
  flex-direction: row;
  flex-shrink: 0;
  z-index: 10;
}
.ai-chat-widget .chat-input-container {
  display: block !important;
  position: relative !important;
  padding: 12px 14px;
  border-top: 1px solid var(--border-color, #e1e5e9);
  background: var(--surface-color, #ffffff);
  flex-shrink: 0;
  z-index: 10;
  min-height: 60px;
  box-sizing: border-box;
  width: 100%;
}
.ai-chat-widget #chat-input {
  display: block;
  width: 100% !important;
  min-width: 0;
  padding: 14px 50px 14px 14px !important;
  border: 1px solid var(--border-color, #e1e5e9);
  border-radius: 24px;
  background: var(--input-bg, #ffffff);
  color: var(--text-color, #333333);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  min-height: 52px;
  max-height: 140px;
  overflow-y: auto;
  box-sizing: border-box;
}
.ai-chat-widget #chat-input:focus {
  border-color: var(--primary-color, #007bff);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}
.dark-theme .ai-chat-widget .chat-input-container {
  background: var(--surface-color, #1e1e1e);
  border-top-color: var(--border-color, #333333);
}
.dark-theme .ai-chat-widget #chat-input {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color, #333333);
  color: var(--text-color, #ffffff);
}
.ai-chat-widget .chat-message {
  flex-direction: row;
  align-items: flex-end;
}
.ai-chat-widget .chat-message.user-message {
  flex-direction: row-reverse;
}
.ai-chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 500px;
  max-height: calc(100vh - 40px);
  background: var(--surface-color, #ffffff);
  border: 1px solid var(--border-color, #e1e5e9);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  z-index: 10000;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Roboto",
    sans-serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.dark-theme .ai-chat-widget {
  background: var(--surface-color, #1e1e1e);
  border-color: var(--border-color, #333333);
  color: var(--text-color, #ffffff);
}
.ai-chat-widget.minimized {
  height: 60px;
  overflow: hidden;
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 20px;
  border-bottom: 1px solid var(--border-color, #e1e5e9);
  background:
    linear-gradient(
      135deg,
      var(--primary-color, #007bff) 0%,
      var(--secondary-color, #6610f2) 100%);
  color: white;
  border-radius: 0;
}
.ai-chat-widget .chat-header {
  border-radius: 16px 16px 0 0;
}
.dark-theme .chat-header {
  border-bottom-color: var(--border-color, #333333);
}
.chat-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.ai-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.ai-avatar svg {
  width: 20px;
  height: 20px;
  color: white;
}
.chat-info h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: white;
}
.chat-status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 2px;
}
.chat-actions {
  display: flex;
  gap: 8px;
}
.minimize-btn,
.close-btn {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.minimize-btn:hover,
.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}
.minimize-btn svg,
.close-btn svg {
  width: 16px;
  height: 16px;
  color: white;
}
.chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}
.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  contain: layout style;
  -webkit-overflow-scrolling: touch;
  align-items: stretch;
  text-align: left;
  background-color: var(--background-color, #fafbfc);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}
.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
  background: var(--background-color, #f8f9fa);
  border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-color, #dee2e6);
  border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted, #6c757d);
}
.dark-theme .chat-messages::-webkit-scrollbar-track {
  background: var(--surface-secondary, #2a2d3a);
}
.dark-theme .chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-color, #404866);
}
.dark-theme .chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted, #8892b0);
}
.dark-theme .chat-messages {
  background-color: var(--surface-secondary, #1a1d2e);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}
.ai-chat-widget textarea,
.chat-panel textarea {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ai-chat-widget textarea::-webkit-scrollbar,
.chat-panel textarea::-webkit-scrollbar {
  display: none;
}
.pagination-loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  color: var(--text-muted, #6c757d);
  font-size: 13px;
  animation: fadeIn 0.2s ease;
}
.pagination-loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color, #dee2e6);
  border-top-color: var(--primary-color, #007bff);
  border-radius: 50%;
  animation: paginationSpin 0.8s linear infinite;
}
@keyframes paginationSpin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.dark-theme .pagination-loading-indicator {
  color: var(--text-muted, #8892b0);
}
.dark-theme .pagination-loading-spinner {
  border-color: var(--border-color, #404866);
  border-top-color: var(--primary-color, #0d6efd);
}
.welcome-message {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 24px;
}
.welcome-message .message-container {
  display: flex;
  max-width: 85%;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  background:
    linear-gradient(
      135deg,
      rgba(0, 123, 255, 0.08) 0%,
      rgba(102, 16, 242, 0.08) 100%);
  border-radius: 20px;
  border-bottom-left-radius: 8px;
  border: 1px solid rgba(0, 123, 255, 0.15);
  box-shadow: 0 3px 12px rgba(0, 123, 255, 0.12);
}
.dark-theme .welcome-message .message-container {
  background:
    linear-gradient(
      135deg,
      rgba(13, 110, 253, 0.12) 0%,
      rgba(102, 16, 242, 0.12) 100%);
  border-color: rgba(13, 110, 253, 0.2);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
}
.welcome-message .message-content {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  cursor: default;
}
.welcome-message .message-content:hover {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}
.ai-avatar-small {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  background:
    linear-gradient(
      135deg,
      var(--primary-color, #007bff) 0%,
      #0056b3 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(0, 123, 255, 0.25);
  border: 3px solid rgba(255, 255, 255, 0.9);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}
.ai-avatar-small:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(0, 123, 255, 0.4);
}
.ai-avatar-small svg {
  width: 18px;
  height: 18px;
  color: white;
}
.user-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  background:
    linear-gradient(
      135deg,
      #28a745 0%,
      #20c997 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(40, 167, 69, 0.25);
  border: 3px solid rgba(255, 255, 255, 0.9);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}
.user-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(40, 167, 69, 0.4);
}
.user-avatar svg {
  width: 18px;
  height: 18px;
  color: white;
}
.ai-chat-widget .chat-message .ai-avatar-small,
.ai-chat-widget .welcome-message .ai-avatar-small,
.ai-chat-widget .typing-indicator .ai-avatar-small {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  flex-basis: 36px !important;
}
.ai-chat-widget .chat-message .user-avatar {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  flex-basis: 36px !important;
}
.chat-message {
  display: flex;
  width: 100%;
  margin-bottom: 24px;
  animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  justify-content: flex-start;
}
.chat-message.user-message {
  justify-content: flex-end;
}
.chat-message.ai-message {
  justify-content: flex-start;
}
.message-container {
  display: flex;
  max-width: 75%;
  align-items: flex-start;
  gap: 12px;
}
.user-message .message-container {
  flex-direction: row-reverse;
}
.ai-message .message-container {
  flex-direction: row;
}
.chat-message .ai-avatar-small,
.chat-message .user-avatar {
  flex: 0 0 auto;
  margin-top: 4px;
}
.message-content {
  position: relative;
  padding: 16px 20px;
  border-radius: 20px;
  max-width: 100%;
  word-wrap: break-word;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
}
.user-message .message-content {
  background:
    linear-gradient(
      135deg,
      var(--primary-color, #007bff) 0%,
      #0056b3 100%);
  color: white;
  border-bottom-right-radius: 8px;
  box-shadow: 0 3px 12px rgba(0, 123, 255, 0.25);
}
.user-message .message-content:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 123, 255, 0.35);
}
.ai-message .message-content {
  background: var(--surface-color, #ffffff);
  border: 1px solid var(--border-color, #e8ecef);
  color: var(--text-color, #2c3e50);
  border-bottom-left-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.ai-message .message-content:hover {
  border-color: var(--primary-color, #007bff);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}
.dark-theme .ai-message .message-content {
  background: var(--surface-secondary, #2a2d3a);
  border-color: var(--border-color, #404866);
  color: var(--text-color, #e2e8f0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.dark-theme .ai-message .message-content:hover {
  border-color: var(--primary-color, #0d6efd);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.message-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-weight: 400;
  text-align: left;
}
.user-message .message-content p {
  font-weight: 500;
  text-align: left;
}
.message-actions {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.message-content:hover .message-actions {
  opacity: 1;
}
.message-action-btn {
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.user-message .message-action-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}
.ai-message .message-action-btn {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-color, #666);
}
.message-action-btn:hover {
  background: rgba(0, 0, 0, 0.15);
  transform: scale(1.05);
}
.user-message .message-action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}
.ai-message .message-action-btn:hover {
  background: var(--primary-color, #007bff);
  color: white;
}
.message-action-btn svg {
  width: 12px;
  height: 12px;
}
.user-message .message-content {
  padding-bottom: 34px;
}
.reexecute-prompt-btn.loading {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}
.reexecute-prompt-btn.loading svg {
  animation: reexecutePromptSpin 0.9s linear infinite;
}
@keyframes reexecutePromptSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.message-content.editing {
  background: var(--warning-bg, #fff3cd);
  border-color: var(--warning-color, #ffc107);
}
.dark-theme .message-content.editing {
  background: rgba(255, 193, 7, 0.1);
  border-color: var(--warning-color, #ffc107);
}
.markdown-content.editing {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.prompt-edit-textarea {
  width: 100%;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
  color: inherit;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
}
.prompt-edit-textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.45);
}
.prompt-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.prompt-edit-save-btn,
.prompt-edit-cancel-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}
.prompt-edit-save-btn {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}
.prompt-edit-save-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}
.prompt-edit-cancel-btn {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
}
.prompt-edit-cancel-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}
.message-content[data-timestamp] {
  position: relative;
}
.message-content[data-timestamp]:hover::after {
  content: attr(data-timestamp);
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  animation: tooltipFadeIn 0.2s ease forwards;
  z-index: 1000;
  pointer-events: none;
}
.dark-theme .message-content[data-timestamp]:hover::after {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
}
@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
.chat-message.tool-activity-message {
  margin-bottom: 12px;
}
.chat-message.tool-activity-message .tool-avatar {
  background:
    linear-gradient(
      135deg,
      #06b6d4 0%,
      #0891b2 100%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-message.tool-activity-message .tool-avatar svg {
  width: 14px;
  height: 14px;
  color: white;
}
.tool-activity-content {
  max-width: 85%;
}
.tool-activity-box {
  background:
    linear-gradient(
      135deg,
      rgba(6, 182, 212, 0.08) 0%,
      rgba(8, 145, 178, 0.08) 100%);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 200px;
}
.dark-theme .tool-activity-box {
  background:
    linear-gradient(
      135deg,
      rgba(6, 182, 212, 0.12) 0%,
      rgba(8, 145, 178, 0.12) 100%);
  border-color: rgba(34, 211, 238, 0.3);
}
.tool-activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(6, 182, 212, 0.15);
}
.tool-activity-label {
  font-size: 11px;
  font-weight: 600;
  color: #0891b2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dark-theme .tool-activity-label {
  color: #22d3ee;
}
.tool-activity-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(6, 182, 212, 0.2);
  border-top-color: #0891b2;
  border-radius: 50%;
  animation: toolSpinner 0.8s linear infinite;
}
.dark-theme .tool-activity-spinner {
  border-color: rgba(34, 211, 238, 0.2);
  border-top-color: #22d3ee;
}
@keyframes toolSpinner {
  to {
    transform: rotate(360deg);
  }
}
.tool-actions-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tool-action-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  color: #57534e;
}
.dark-theme .tool-action-item {
  color: #a8a29e;
}
.tool-action-icon {
  flex-shrink: 0;
  color: #0891b2;
}
.dark-theme .tool-action-icon {
  color: #22d3ee;
}
.tool-action-item span {
  text-align: left;
}
.chat-message.context-compression-message {
  margin-bottom: 12px;
}
.chat-message.context-compression-message .compress-avatar {
  background:
    linear-gradient(
      135deg,
      #8b5cf6 0%,
      #7c3aed 100%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-message.context-compression-message .compress-avatar svg {
  width: 14px;
  height: 14px;
  color: white;
}
.context-compression-content {
  max-width: 85%;
}
.context-compression-box {
  background:
    linear-gradient(
      135deg,
      rgba(139, 92, 246, 0.08) 0%,
      rgba(124, 58, 237, 0.08) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dark-theme .context-compression-box {
  background:
    linear-gradient(
      135deg,
      rgba(139, 92, 246, 0.12) 0%,
      rgba(124, 58, 237, 0.12) 100%);
  border-color: rgba(167, 139, 250, 0.3);
}
.compression-icon {
  font-size: 14px;
  flex-shrink: 0;
}
.compression-text {
  font-size: 13px;
  color: #6d28d9;
  font-weight: 500;
}
.dark-theme .compression-text {
  color: #a78bfa;
}
.message-content p,
.thought-text-truncated,
.thought-text-full,
.status-text {
  text-align: left;
}
.chat-message.user-message .message-content p {
  text-align: right;
}
.message-time {
  display: none;
}
.typing-indicator {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 24px;
  animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.typing-indicator .message-container {
  display: flex;
  max-width: 75%;
  align-items: flex-start;
  gap: 12px;
}
.typing-indicator .typing-content {
  background: var(--surface-color, #ffffff);
  border: 1px solid var(--border-color, #e8ecef);
  border-radius: 20px;
  border-bottom-left-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-top: 4px;
}
.dark-theme .typing-indicator .typing-content {
  background: var(--surface-secondary, #2a2d3a);
  border-color: var(--border-color, #404866);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}
.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--primary-color, #007bff);
  border-radius: 50%;
  animation: typingDots 1.4s infinite;
  opacity: 0.6;
}
.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}
.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes typingDots {
  0%, 60%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  30% {
    transform: scale(1.3);
    opacity: 1;
  }
}
.chat-panel {
  display: flex;
  flex-direction: column;
  background: var(--surface-color, #ffffff);
  border: 1px solid var(--border-color, #e1e5e9);
  overflow: hidden;
}
.chat-panel .chat-header {
  padding: 6px 12px;
  border-bottom: none;
  background:
    linear-gradient(
      135deg,
      var(--primary-color, #007bff) 0%,
      var(--secondary-color, #6610f2) 100%);
  border-radius: 0;
}
.chat-panel .chat-title {
  color: white;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.chat-panel .thread-selector-container {
  flex: 1;
  min-width: 0;
  max-width: 180px;
}
.chat-panel .thread-selector {
  width: 100%;
  padding: 6px 28px 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: white;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.chat-panel .thread-selector:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
}
.chat-panel .thread-selector:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}
.chat-panel .thread-selector option {
  background: white;
  color: #333;
}
.chat-panel .thread-selector-container::after {
  display: none;
}
.chat-panel .header-action-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-panel .header-action-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}
.chat-panel .header-action-btn svg {
  width: 14px;
  height: 14px;
  stroke: white;
}
.chat-panel .model-selector {
  padding: 5px 24px 5px 8px;
  font-size: 11px;
  font-weight: 500;
  color: white;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  transition: all 0.2s ease;
}
.chat-panel .model-selector:hover {
  background-color: rgba(255, 255, 255, 0.2);
}
.chat-panel .model-selector:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
}
.chat-panel .model-selector option {
  background: white;
  color: #333;
}
.chat-panel .token-stats {
  color: rgba(255, 255, 255, 0.85);
  font-size: 10px;
}
.chat-panel .token-stats svg {
  stroke: rgba(255, 255, 255, 0.7);
}
.chat-panel .minimize-btn,
.chat-panel .close-btn {
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chat-panel .minimize-btn:hover,
.chat-panel .close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.chat-panel .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  min-height: 0;
}
.chat-panel .chat-message {
  display: flex;
  width: 100%;
  margin-bottom: 16px;
  animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-panel .chat-message.user-message {
  justify-content: flex-end;
}
.chat-panel .chat-message.ai-message {
  justify-content: flex-start;
}
.chat-panel .message-container {
  display: flex;
  max-width: 75%;
  align-items: flex-start;
  gap: 12px;
}
.chat-panel .user-message .message-container {
  flex-direction: row-reverse;
}
.chat-panel .ai-message .message-container {
  flex-direction: row;
}
.chat-panel .ai-avatar-small,
.chat-panel .user-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(0, 123, 255, 0.25);
  border: 3px solid rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
  margin-top: 4px;
}
.chat-panel .ai-avatar-small {
  background:
    linear-gradient(
      135deg,
      var(--primary-color, #007bff) 0%,
      #0056b3 100%);
}
.chat-panel .user-avatar {
  background:
    linear-gradient(
      135deg,
      #28a745 0%,
      #20c997 100%);
}
.chat-panel .ai-avatar-small svg,
.chat-panel .user-avatar svg {
  width: 18px;
  height: 18px;
  color: white;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}
.chat-panel .message-content {
  position: relative;
  padding: 16px 20px;
  border-radius: 20px;
  max-width: 100%;
  word-wrap: break-word;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}
.chat-panel .user-message .message-content {
  background:
    linear-gradient(
      135deg,
      var(--primary-color, #007bff) 0%,
      #0056b3 100%);
  color: white;
  border-bottom-right-radius: 8px;
  box-shadow: 0 3px 12px rgba(0, 123, 255, 0.25);
}
.chat-panel .user-message .message-content:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 123, 255, 0.35);
}
.chat-panel .ai-message .message-content {
  background: var(--surface-color, #ffffff);
  border: 1px solid var(--border-color, #e8ecef);
  color: var(--text-color, #2c3e50);
  border-bottom-left-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.chat-panel .ai-message .message-content:hover {
  border-color: var(--primary-color, #007bff);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}
.chat-panel .message-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-weight: 400;
}
.chat-panel .user-message .message-content p {
  font-weight: 500;
  text-align: left;
}
.chat-panel .message-actions {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.chat-panel .message-content:hover .message-actions {
  opacity: 1;
}
.chat-panel .message-action-btn {
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.chat-panel .user-message .message-action-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}
.chat-panel .ai-message .message-action-btn {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-color, #666);
}
.chat-panel .message-action-btn:hover {
  background: rgba(0, 0, 0, 0.15);
  transform: scale(1.05);
}
.chat-panel .user-message .message-action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}
.chat-panel .ai-message .message-action-btn:hover {
  background: var(--primary-color, #007bff);
  color: white;
}
.chat-panel .message-action-btn svg {
  width: 12px;
  height: 12px;
}
.chat-panel .user-message .message-content {
  padding-bottom: 34px;
}
@media (hover: none), (pointer: coarse) {
  .message-actions,
  .chat-panel .message-actions {
    opacity: 1;
  }
}
.chat-panel .welcome-message {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 20px;
}
.chat-panel .welcome-message .message-container {
  display: flex;
  max-width: 85%;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  background:
    linear-gradient(
      135deg,
      rgba(0, 123, 255, 0.08) 0%,
      rgba(102, 16, 242, 0.08) 100%);
  border-radius: 20px;
  border-bottom-left-radius: 8px;
  border: 1px solid rgba(0, 123, 255, 0.15);
  box-shadow: 0 3px 12px rgba(0, 123, 255, 0.12);
}
.chat-panel .welcome-message .message-content {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  cursor: default;
}
.chat-panel .welcome-message .message-content:hover {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}
.chat-panel .typing-indicator {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 20px;
  animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-panel .typing-indicator .message-container {
  display: flex;
  max-width: 75%;
  align-items: flex-start;
  gap: 12px;
}
.chat-panel .typing-indicator .typing-content {
  background: var(--surface-color, #ffffff);
  border: 1px solid var(--border-color, #e8ecef);
  border-radius: 20px;
  border-bottom-left-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-top: 4px;
}
.chat-panel .chat-input-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 0 16px 0;
  border-top: 1px solid var(--border-color, #e1e5e9);
  background: var(--surface-color, #ffffff);
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}
.chat-panel .chat-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px 0;
  width: 100%;
  box-sizing: border-box;
}
.chat-credit-input-notice {
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 20px 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.35;
}
.chat-credit-input-notice.is-visible {
  display: flex;
}
.chat-credit-input-notice.credit-low {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: #b45309;
}
.chat-credit-input-notice.credit-exhausted {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #dc2626;
}
.chat-credit-input-notice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
}
.chat-credit-input-notice-copy {
  min-width: 0;
  flex: 1;
}
.chat-credit-input-notice-title {
  font-weight: 600;
  color: currentColor;
}
.chat-credit-input-notice-text {
  color: var(--text-secondary, #64748b);
}
.chat-credit-input-notice-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid currentColor;
  background: transparent;
  color: currentColor;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.chat-credit-input-notice-action:hover {
  background: rgba(255, 255, 255, 0.45);
}
.dark-theme .chat-credit-input-notice.credit-low {
  color: #fbbf24;
}
.dark-theme .chat-credit-input-notice.credit-exhausted {
  color: #f87171;
}
@media (max-width: 480px) {
  .chat-credit-input-notice-action {
    width: 100%;
    justify-content: center;
    margin-left: 28px;
  }
}
.chat-panel .attachment-preview-strip {
  padding: 8px 20px 4px;
}
.chat-panel .chat-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  min-height: 20px;
  max-height: 120px;
  padding: 12px 16px;
  border: 1px solid var(--border-color, #e1e5e9);
  border-radius: 20px;
  background: var(--input-bg, #ffffff);
  color: var(--text-color, #333333);
  font-size: 14px;
  line-height: 1.4;
  resize: none;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  overflow-wrap: break-word;
  word-wrap: break-word;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chat-panel .chat-input::-webkit-scrollbar {
  display: none;
}
.chat-panel .chat-input:focus {
  border-color: var(--primary-color, #007bff);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}
.chat-panel .chat-input:disabled,
.ai-chat-widget #chat-input:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  background: var(--disabled-bg, rgba(148, 163, 184, 0.08));
}
.attach-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.send-btn,
.chat-send-btn {
  width: 48px;
  height: 48px;
  background: var(--primary-color, #007bff);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.resume-chat-btn {
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-color, #d1d9e0);
  border-radius: 999px;
  background: var(--surface-color, #ffffff);
  color: var(--text-color, #1f2937);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.2s ease;
  margin-bottom: 6px;
}
.resume-chat-btn svg {
  width: 13px;
  height: 13px;
}
.resume-chat-btn:hover:not(:disabled) {
  border-color: var(--primary-color, #007bff);
  color: var(--primary-color, #007bff);
  background: var(--hover-bg, rgba(0, 123, 255, 0.08));
}
.resume-chat-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.chat-panel .resume-chat-btn {
  margin-bottom: 0;
}
.dark-theme .resume-chat-btn {
  border-color: var(--border-color, #333);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-color, #e5e7eb);
}
.dark-theme .resume-chat-btn:hover:not(:disabled) {
  color: var(--primary-color, #60a5fa);
  border-color: var(--primary-color, #60a5fa);
  background: rgba(96, 165, 250, 0.14);
}
.ai-chat-widget .send-btn,
.ai-chat-widget .chat-send-btn {
  position: absolute !important;
  right: 14px;
  bottom: 12px;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}
.ai-chat-widget .resume-chat-btn {
  position: absolute !important;
  right: 66px;
  bottom: 12px;
  z-index: 20;
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
  margin: 0;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 23, 42, 0.16);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
  font-size: 11px;
}
@media (min-width: 769px) {
  .send-btn:not(.stop-btn),
  .chat-send-btn:not(.stop-btn),
  .chat-panel .send-btn:not(.stop-btn),
  .chat-panel .chat-send-btn:not(.stop-btn) {
    display: none !important;
  }
  .send-btn.stop-btn,
  .chat-send-btn.stop-btn,
  .chat-panel .send-btn.stop-btn,
  .chat-panel .chat-send-btn.stop-btn {
    display: flex !important;
  }
}
@media (max-width: 768px) {
  .send-btn,
  .chat-send-btn {
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.25);
  }
  .send-btn:active:not(:disabled),
  .chat-send-btn:active:not(:disabled) {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(0, 123, 255, 0.4);
  }
}
.send-btn:hover:not(:disabled),
.chat-send-btn:hover:not(:disabled) {
  background: var(--primary-dark, #0056b3);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 123, 255, 0.3);
}
.send-btn:disabled,
.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.send-btn svg,
.chat-send-btn svg {
  width: 20px;
  height: 20px;
  color: white;
  transition: all 0.3s ease;
}
.send-btn.stop-btn {
  background: #dc3545 !important;
  animation: pulseStop 2s ease-in-out infinite;
}
.send-btn.stop-btn:hover {
  background: #c82333 !important;
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(220, 53, 69, 0.4);
}
.send-btn.stop-btn svg {
  width: 16px;
  height: 16px;
}
@keyframes pulseStop {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
  }
}
.send-btn.processing {
  background: #6c757d !important;
  cursor: not-allowed;
}
.send-btn.processing::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.dark-theme .chat-panel {
  background: var(--surface-color, #1e1e1e);
  border-color: var(--border-color, #333333);
  color: var(--text-color, #ffffff);
}
.dark-theme .chat-panel .chat-header {
  border-bottom-color: var(--border-color, #333333);
}
.dark-theme .chat-panel .ai-message .message-content {
  background: var(--surface-secondary, #2a2d3a);
  border-color: var(--border-color, #404866);
  color: var(--text-color, #e2e8f0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.dark-theme .chat-panel .chat-input-container {
  border-top-color: var(--border-color, #333333);
  background: var(--surface-color, #1e1e1e);
}
.dark-theme .chat-panel .chat-input {
  background: var(--input-bg, #2d2d2d);
  border-color: var(--border-color, #444444);
  color: var(--text-color, #ffffff);
}
@media (max-width: 480px) {
  .chat-panel .message-container {
    max-width: 85%;
  }
  .chat-panel .message-content {
    padding: 14px 18px;
    font-size: 13px;
  }
  .chat-panel .ai-avatar-small,
  .chat-panel .user-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
  }
  .chat-panel .ai-avatar-small svg,
  .chat-panel .user-avatar svg {
    width: 16px;
    height: 16px;
  }
}
.sticky-todo-list {
  background:
    linear-gradient(
      135deg,
      #f8f9ff 0%,
      #f0f4ff 100%);
  border: 1px solid rgba(0, 123, 255, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin: 8px 16px;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
  animation: slideInUp 0.3s ease;
}
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.sticky-todo-list.all-done {
  background:
    linear-gradient(
      135deg,
      #f0fff4 0%,
      #e6ffed 100%);
  border-color: rgba(40, 167, 69, 0.3);
  animation: fadeOutSuccess 3s ease forwards;
}
@keyframes fadeOutSuccess {
  0%, 70% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.95);
  }
}
.sticky-todo-list .todo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 123, 255, 0.1);
}
.sticky-todo-list .todo-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sticky-todo-list .todo-summary {
  font-size: 11px;
  color: #666;
  background: rgba(0, 123, 255, 0.1);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}
.sticky-todo-list .todo-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sticky-todo-list .todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #555;
  padding: 6px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.sticky-todo-list .todo-item.completed {
  color: #28a745;
  background: rgba(40, 167, 69, 0.08);
}
.sticky-todo-list .todo-item.completed .todo-text {
  text-decoration: line-through;
  opacity: 0.8;
}
.sticky-todo-list .todo-item.completed .todo-icon {
  background: #28a745;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.sticky-todo-list .todo-item.in-progress {
  color: #007bff;
  background: rgba(0, 123, 255, 0.08);
  font-weight: 500;
}
.sticky-todo-list .todo-item.in-progress .todo-icon {
  color: #007bff;
  animation: pulse 1.5s ease-in-out infinite;
  font-size: 14px;
}
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
.sticky-todo-list .todo-item.skipped {
  color: #999;
  opacity: 0.7;
}
.sticky-todo-list .todo-item.skipped .todo-text {
  text-decoration: line-through;
}
.sticky-todo-list .todo-item.pending {
  color: #666;
}
.sticky-todo-list .todo-item.pending .todo-icon {
  color: #ccc;
  font-size: 12px;
}
.sticky-todo-list .todo-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sticky-todo-list .todo-text {
  flex: 1;
  line-height: 1.4;
}
.dark-theme .sticky-todo-list {
  background:
    linear-gradient(
      135deg,
      #1a1f2e 0%,
      #1e2333 100%);
  border-color: rgba(99, 179, 237, 0.3);
}
.dark-theme .sticky-todo-list .todo-title {
  color: #e2e8f0;
}
.dark-theme .sticky-todo-list .todo-summary {
  background: rgba(99, 179, 237, 0.15);
  color: #a0aec0;
}
.dark-theme .sticky-todo-list .todo-header {
  border-bottom-color: rgba(99, 179, 237, 0.15);
}
.dark-theme .sticky-todo-list .todo-item {
  color: #cbd5e0;
}
.dark-theme .sticky-todo-list .todo-item.completed {
  background: rgba(72, 187, 120, 0.15);
  color: #68d391;
}
.dark-theme .sticky-todo-list .todo-item.in-progress {
  background: rgba(99, 179, 237, 0.15);
  color: #63b3ed;
}
.dark-theme .sticky-todo-list .todo-item.pending {
  color: #718096;
}
.system-message {
  display: flex;
  width: 100%;
  justify-content: center;
  margin-bottom: 20px;
  opacity: 0.8;
}
.system-message .system-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 8px;
}
.system-message .system-icon svg {
  width: 12px;
  height: 12px;
  color: white;
}
.system-message .system-content {
  background: #f8f9fa !important;
  border: 1px solid #dee2e6 !important;
  color: #6c757d !important;
  font-size: 13px;
  padding: 12px 16px !important;
  border-radius: 16px !important;
  max-width: 300px;
  text-align: center;
}
.dark-theme .system-message .system-content {
  background: #2a2d3a !important;
  border-color: #404866 !important;
  color: #8892b0 !important;
}
.ai-chat-widget .chat-toolbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--surface-secondary, #f8f9fa);
  border-bottom: 1px solid var(--border-color, #e1e5e9);
  min-height: 36px;
  gap: 8px;
}
.dark-theme .ai-chat-widget .chat-toolbar {
  background: var(--surface-secondary, #252836);
  border-bottom-color: var(--border-color, #333333);
}
.ai-chat-widget .toolbar-left,
.ai-chat-widget .toolbar-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.ai-chat-widget .toolbar-right {
  gap: 6px;
  flex-wrap: nowrap;
}
@media (max-width: 480px) {
  .ai-chat-widget .toolbar-right {
    gap: 4px;
  }
}
.ai-chat-widget .toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary, #64748b);
  transition: all 0.15s ease;
}
.ai-chat-widget .toolbar-btn:hover:not(:disabled) {
  background: var(--hover-bg, rgba(0, 0, 0, 0.05));
  color: var(--text-primary, #1e293b);
}
.ai-chat-widget .toolbar-btn:active:not(:disabled) {
  background: var(--active-bg, rgba(0, 0, 0, 0.1));
  transform: scale(0.95);
}
.ai-chat-widget .toolbar-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ai-chat-widget .toolbar-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}
.ai-chat-widget .toolbar-btn.loading svg {
  animation: spin 1s linear infinite;
}
.dark-theme .ai-chat-widget .toolbar-btn {
  color: var(--text-secondary, #8892b0);
}
.dark-theme .ai-chat-widget .toolbar-btn:hover:not(:disabled) {
  background: var(--hover-bg, rgba(255, 255, 255, 0.1));
  color: var(--text-primary, #e2e8f0);
}
.ai-chat-widget .toolbar-divider {
  width: 1px;
  height: 18px;
  background: var(--border-color, #e1e5e9);
  margin: 0 4px;
}
.dark-theme .ai-chat-widget .toolbar-divider {
  background: var(--border-color, #404866);
}
.ai-chat-widget .version-indicator {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary, #94a3b8);
  padding: 2px 8px;
  background: var(--surface-tertiary, rgba(0, 0, 0, 0.03));
  border-radius: 10px;
  cursor: default;
}
.dark-theme .ai-chat-widget .version-indicator {
  color: var(--text-tertiary, #64748b);
  background: var(--surface-tertiary, rgba(255, 255, 255, 0.05));
}
.ai-chat-widget .snapshot-timestamp {
  font-size: 10px;
  color: var(--text-tertiary, #94a3b8);
  margin-right: 8px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.ai-chat-widget .snapshot-timestamp:hover {
  opacity: 1;
  text-decoration: underline;
}
.dark-theme .ai-chat-widget .snapshot-timestamp {
  color: var(--text-tertiary, #64748b);
}
.ai-chat-widget .model-selector {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary, #475569);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 6px center,
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(248, 250, 252, 0.98) 100%);
  background-size: 10px 10px, 100% 100%;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 4px 22px 4px 8px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 100px;
  min-width: 70px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.ai-chat-widget .model-selector:hover {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 6px center, rgba(59, 130, 246, 0.08);
  background-size: 10px 10px, 100% 100%;
  border-color: var(--primary-color, #3b82f6);
  color: var(--primary-color, #3b82f6);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}
.ai-chat-widget .model-selector:focus {
  border-color: var(--primary-color, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.dark-theme .ai-chat-widget .model-selector {
  color: var(--text-secondary, #94a3b8);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 6px center,
    linear-gradient(
      135deg,
      rgba(30, 41, 59, 0.9) 0%,
      rgba(15, 23, 42, 0.95) 100%);
  background-size: 10px 10px, 100% 100%;
  border-color: var(--border-color, #334155);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.dark-theme .ai-chat-widget .model-selector:hover {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2360a5fa' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 6px center,
    linear-gradient(
      135deg,
      rgba(59, 130, 246, 0.15) 0%,
      rgba(59, 130, 246, 0.1) 100%);
  background-size: 10px 10px, 100% 100%;
  border-color: var(--primary-color, #60a5fa);
  color: var(--primary-color, #60a5fa);
}
.ai-chat-widget .token-stats {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-tertiary, #64748b);
  padding: 3px 7px;
  background:
    linear-gradient(
      135deg,
      rgba(0, 0, 0, 0.02) 0%,
      rgba(0, 0, 0, 0.04) 100%);
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: none;
  opacity: 0.9;
}
.ai-chat-widget .token-stats:hover {
  background:
    linear-gradient(
      135deg,
      rgba(16, 185, 129, 0.08) 0%,
      rgba(16, 185, 129, 0.12) 100%);
  border-color: rgba(16, 185, 129, 0.3);
  color: #059669;
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}
.ai-chat-widget .token-stats svg {
  width: 10px;
  height: 10px;
  opacity: 0.6;
  flex-shrink: 0;
}
.ai-chat-widget .token-stats .token-count {
  font-variant-numeric: tabular-nums;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.dark-theme .ai-chat-widget .token-stats {
  color: var(--text-tertiary, #64748b);
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.03) 0%,
      rgba(255, 255, 255, 0.06) 100%);
  border-color: rgba(255, 255, 255, 0.08);
}
.dark-theme .ai-chat-widget .token-stats:hover {
  background:
    linear-gradient(
      135deg,
      rgba(16, 185, 129, 0.15) 0%,
      rgba(16, 185, 129, 0.2) 100%);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.chat-toolbar .token-stats,
#token-stats.token-stats {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-tertiary, #64748b);
  padding: 3px 7px;
  background:
    linear-gradient(
      135deg,
      rgba(0, 0, 0, 0.02) 0%,
      rgba(0, 0, 0, 0.04) 100%);
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.9;
}
.chat-toolbar .token-stats:hover,
#token-stats.token-stats:hover {
  background:
    linear-gradient(
      135deg,
      rgba(16, 185, 129, 0.08) 0%,
      rgba(16, 185, 129, 0.12) 100%);
  border-color: rgba(16, 185, 129, 0.3);
  color: #059669;
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}
.chat-toolbar .token-stats svg,
#token-stats.token-stats svg {
  width: 10px;
  height: 10px;
  opacity: 0.6;
  flex-shrink: 0;
}
.chat-toolbar .token-stats .token-count,
#token-stats .token-count {
  font-variant-numeric: tabular-nums;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.dark-theme .chat-toolbar .token-stats,
.dark-theme #token-stats.token-stats {
  color: var(--text-tertiary, #64748b);
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.03) 0%,
      rgba(255, 255, 255, 0.06) 100%);
  border-color: rgba(255, 255, 255, 0.08);
}
.dark-theme .chat-toolbar .token-stats:hover,
.dark-theme #token-stats.token-stats:hover {
  background:
    linear-gradient(
      135deg,
      rgba(16, 185, 129, 0.15) 0%,
      rgba(16, 185, 129, 0.2) 100%);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}
body.project-view-mode:not(.dark-theme) .chat-panel #token-stats.token-stats,
body.project-view-mode:not(.dark-theme) .chat-panel .chat-toolbar .token-stats {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  opacity: 1;
}
body.project-view-mode:not(.dark-theme) .chat-panel #token-stats.token-stats:hover,
body.project-view-mode:not(.dark-theme) .chat-panel .chat-toolbar .token-stats:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
}
body.project-view-mode:not(.dark-theme) .chat-panel #token-stats.token-stats svg,
body.project-view-mode:not(.dark-theme) .chat-panel .chat-toolbar .token-stats svg {
  stroke: rgba(255, 255, 255, 0.9);
  opacity: 0.95;
}
body.project-view-mode:not(.dark-theme) .chat-panel #token-stats .token-count,
body.project-view-mode:not(.dark-theme) .chat-panel .chat-toolbar .token-stats .token-count {
  color: inherit;
}
.chat-toolbar .model-selector,
#model-selector.model-selector {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary, #475569);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 6px center,
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(248, 250, 252, 0.98) 100%);
  background-size: 10px 10px, 100% 100%;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 4px 22px 4px 8px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 100px;
  min-width: 70px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.chat-toolbar .model-selector:hover,
#model-selector.model-selector:hover {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 6px center, rgba(59, 130, 246, 0.08);
  background-size: 10px 10px, 100% 100%;
  border-color: var(--primary-color, #3b82f6);
  color: var(--primary-color, #3b82f6);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}
.chat-toolbar .model-selector:focus,
#model-selector.model-selector:focus {
  border-color: var(--primary-color, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.dark-theme .chat-toolbar .model-selector,
.dark-theme #model-selector.model-selector {
  color: var(--text-secondary, #94a3b8);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 6px center,
    linear-gradient(
      135deg,
      rgba(30, 41, 59, 0.9) 0%,
      rgba(15, 23, 42, 0.95) 100%);
  background-size: 10px 10px, 100% 100%;
  border-color: var(--border-color, #334155);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.dark-theme .chat-toolbar .model-selector:hover,
.dark-theme #model-selector.model-selector:hover {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2360a5fa' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 6px center,
    linear-gradient(
      135deg,
      rgba(59, 130, 246, 0.15) 0%,
      rgba(59, 130, 246, 0.1) 100%);
  background-size: 10px 10px, 100% 100%;
  border-color: var(--primary-color, #60a5fa);
  color: var(--primary-color, #60a5fa);
}
@media (max-width: 400px) {
  .ai-chat-widget .token-stats svg,
  .chat-toolbar .token-stats svg,
  #token-stats svg {
    display: none;
  }
  .ai-chat-widget .token-stats,
  .chat-toolbar .token-stats,
  #token-stats.token-stats {
    padding: 2px 6px;
    font-size: 8px;
  }
  .ai-chat-widget .token-stats .token-count,
  .chat-toolbar .token-stats .token-count,
  #token-stats .token-count {
    font-size: 8px;
  }
}
.credit-warning-banner {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  margin: 12px 16px;
  animation: creditBannerSlide 0.3s ease;
}
@keyframes creditBannerSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.credit-warning-banner.credit-low {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 7px 12px;
  border-radius: 8px;
  margin: 6px 12px;
  gap: 8px;
  align-items: center;
}
.credit-warning-banner.credit-low .credit-warning-icon {
  font-size: 14px;
  margin-top: 0;
}
.credit-warning-banner.credit-low .credit-warning-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.credit-warning-banner.credit-low .credit-warning-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 0;
}
.credit-warning-banner.credit-low .credit-warning-text {
  font-size: 12px;
  margin-bottom: 0;
  color: var(--text-secondary, #94a3b8);
}
.credit-warning-banner.credit-low .credit-warning-action {
  padding: 3px 10px;
  font-size: 11px;
  flex-shrink: 0;
}
.credit-warning-banner.credit-exhausted {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.credit-warning-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.credit-warning-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.credit-low .credit-warning-title {
  color: #f59e0b;
}
.credit-exhausted .credit-warning-title {
  color: #ef4444;
}
.credit-warning-text {
  font-size: 13px;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.4;
  margin-bottom: 10px;
}
.credit-warning-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.credit-low .credit-warning-action {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}
.credit-low .credit-warning-action:hover {
  background: rgba(245, 158, 11, 0.3);
}
.credit-exhausted .credit-warning-action {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}
.credit-exhausted .credit-warning-action:hover {
  background: rgba(239, 68, 68, 0.3);
}
.token-stats-modal .chat-modal-content {
  width: 600px;
  max-width: 95vw;
  max-height: 90vh;
}
.token-stats-modal .chat-modal-body {
  overflow-y: auto;
  padding: 16px 20px;
}
.token-stats-modal .token-stats-section {
  margin-bottom: 14px;
}
.token-stats-modal .token-stats-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.token-stats-modal .token-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.token-stats-modal .token-stat-item {
  background: var(--surface-secondary, #f8fafc);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.token-stats-modal .token-stat-item.token-stat-total {
  background: var(--primary-bg-light, rgba(59, 130, 246, 0.1));
  border: 1px solid var(--primary-color, #3b82f6);
}
.token-stats-modal .token-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.token-stats-modal .token-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  font-variant-numeric: tabular-nums;
}
.token-stats-modal .token-stat-total .token-stat-value {
  color: var(--primary-color, #3b82f6);
}
.token-stats-modal .token-stat-desc {
  font-size: 11px;
  color: var(--text-tertiary, #94a3b8);
  margin-top: 4px;
}
.token-stats-modal .token-stat-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--primary-bg-light, rgba(59, 130, 246, 0.1));
  border: 1px solid var(--primary-color, #3b82f6);
  border-radius: 8px;
  margin-top: 12px;
}
.token-stats-modal .token-stat-total-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}
.token-stats-modal .token-stat-total-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color, #3b82f6);
  font-variant-numeric: tabular-nums;
}
.token-stats-modal .token-stats-info {
  padding: 12px;
  background: var(--surface-secondary, #f8fafc);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}
.token-stats-modal .token-stats-info p {
  margin-bottom: 8px;
}
.token-stats-modal .token-stats-info p:last-child {
  margin-bottom: 0;
}
.token-stats-modal .token-info-note {
  font-size: 11px;
  color: var(--text-tertiary, #94a3b8);
  font-style: italic;
}
.dark-theme .token-stats-modal .token-stats-section h4 {
  color: var(--text-secondary, #94a3b8);
}
.dark-theme .token-stats-modal .token-stat-item {
  background: var(--surface-secondary, #252836);
}
.dark-theme .token-stats-modal .token-stat-item.token-stat-total {
  background: rgba(59, 130, 246, 0.15);
}
.dark-theme .token-stats-modal .token-stat-value {
  color: var(--text-primary, #e2e8f0);
}
.dark-theme .token-stats-modal .token-stat-total-row {
  background: rgba(59, 130, 246, 0.15);
}
.dark-theme .token-stats-modal .token-stat-total-label {
  color: var(--text-primary, #e2e8f0);
}
.dark-theme .token-stats-modal .token-stats-info {
  background: var(--surface-secondary, #252836);
}
.sb-icon {
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}
.undo-redo-feedback {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background:
    linear-gradient(
      135deg,
      var(--primary-color, #007bff) 0%,
      var(--secondary-color, #6610f2) 100%);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10002;
  white-space: nowrap;
  box-shadow:
    0 8px 32px rgba(0, 123, 255, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
  letter-spacing: 0.3px;
}
.undo-redo-feedback::before {
  content: "";
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 4 1 10 7 10'%3E%3C/polyline%3E%3Cpath d='M3.51 15a9 9 0 1 0 2.13-9.36L1 10'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
  animation: undoIconSpin 0.5s ease-out;
}
.undo-redo-feedback.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.undo-redo-feedback.show::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 50px;
  background: inherit;
  z-index: -1;
  animation: toastPulse 0.6s ease-out;
}
@keyframes undoIconSpin {
  from {
    transform: rotate(-45deg);
    opacity: 0;
  }
  to {
    transform: rotate(0deg);
    opacity: 1;
  }
}
@keyframes toastPulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.15);
    opacity: 0;
  }
}
.dark-theme .undo-redo-feedback {
  background:
    linear-gradient(
      135deg,
      #0d6efd 0%,
      #8b5cf6 100%);
  box-shadow:
    0 8px 32px rgba(13, 110, 253, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.15);
}
.version-history-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.version-history-modal.show {
  opacity: 1;
}
.version-history-content {
  background: var(--surface-color, #ffffff);
  border-radius: 12px;
  width: 400px;
  max-width: 90vw;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}
.version-history-modal.show .version-history-content {
  transform: scale(1);
}
.dark-theme .version-history-content {
  background: var(--surface-color, #1e1e1e);
}
.version-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e1e5e9);
}
.version-history-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  margin: 0;
}
.dark-theme .version-history-header h3 {
  color: var(--text-primary, #e2e8f0);
}
.close-history-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 20px;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}
.close-history-btn:hover {
  background: var(--hover-bg, rgba(0, 0, 0, 0.05));
  color: var(--text-primary, #1e293b);
}
.version-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.version-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  gap: 12px;
  transition: background 0.15s ease;
}
.version-item:hover {
  background: var(--hover-bg, rgba(0, 0, 0, 0.03));
}
.version-item.current {
  background: var(--highlight-bg, rgba(59, 130, 246, 0.08));
}
.version-number {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-color, #3b82f6);
  padding: 4px 8px;
  background: var(--primary-light, rgba(59, 130, 246, 0.1));
  border-radius: 6px;
  min-width: 40px;
  text-align: center;
}
.version-info {
  flex: 1;
  min-width: 0;
}
.version-description {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dark-theme .version-description {
  color: var(--text-primary, #e2e8f0);
}
.version-meta {
  font-size: 11px;
  color: var(--text-tertiary, #94a3b8);
  margin-top: 2px;
}
.jump-to-version-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--primary-color, #3b82f6);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.jump-to-version-btn:hover:not(:disabled) {
  background: var(--primary-hover, #2563eb);
}
.jump-to-version-btn:disabled {
  background: var(--surface-secondary, #e2e8f0);
  color: var(--text-tertiary, #94a3b8);
  cursor: default;
}
.dark-theme .jump-to-version-btn:disabled {
  background: var(--surface-secondary, #374151);
  color: var(--text-tertiary, #6b7280);
}
.diff-version-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-secondary, #e2e8f0);
  color: var(--text-primary, #1e293b);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.diff-version-btn:hover {
  background: var(--surface-tertiary, #cbd5e1);
  border-color: var(--text-secondary, #64748b);
}
.dark-theme .diff-version-btn {
  background: var(--surface-secondary, #374151);
  color: var(--text-primary, #e2e8f0);
  border-color: var(--border-color, #4b5563);
}
.dark-theme .diff-version-btn:hover {
  background: var(--surface-tertiary, #4b5563);
  border-color: var(--text-secondary, #9ca3af);
}
.version-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.version-history-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-tertiary, #64748b);
}
.version-history-empty p {
  margin: 0;
  font-size: 14px;
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.ai-chat-widget .thread-selector-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ai-chat-widget .thread-selector {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  padding: 4px 28px 4px 10px;
  cursor: pointer;
  -moz-appearance: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  max-width: 180px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  transition: all 0.2s ease;
}
.dark-theme .ai-chat-widget .version-indicator {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.1);
}
.chat-status-bar {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface-color, #ffffff);
  border-top: 1px solid var(--border-color, #e1e5e9);
  align-items: center;
  flex-shrink: 0;
  z-index: 20;
  overflow-x: auto;
  white-space: nowrap;
  min-height: 48px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chat-status-bar::-webkit-scrollbar {
  display: none;
}
.dark-theme .chat-status-bar {
  background: var(--surface-secondary, #1e1e1e);
  border-top-color: var(--border-color, #333333);
}
.status-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--background-color, #f8f9fa);
  border: 1px solid var(--border-color, #e1e5e9);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #6c757d);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-user-select: none;
  user-select: none;
}
.dark-theme .status-chip {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}
.status-chip:hover {
  background: var(--hover-color, #e9ecef);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.dark-theme .status-chip:hover {
  background: rgba(255, 255, 255, 0.1);
}
.status-chip.active {
  background: rgba(0, 123, 255, 0.1);
  border-color: var(--primary-color, #007bff);
  color: var(--primary-color, #007bff);
}
.dark-theme .status-chip.active {
  background: rgba(13, 110, 253, 0.2);
  border-color: var(--primary-color, #0d6efd);
  color: var(--primary-color, #6ea8fe);
}
.chip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.chip-icon svg {
  width: 14px;
  height: 14px;
}
.chip-count {
  background: var(--primary-color, #007bff);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 0 6px;
  border-radius: 10px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
}
.status-chip.tasks .chip-count {
  background: #6f42c1;
}
.status-chip.changes .chip-count {
  background: #28a745;
}
.status-popover {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 300px;
  max-height: 400px;
  background: var(--surface-color, #ffffff);
  border: 1px solid var(--border-color, #e1e5e9);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 10010;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.status-popover.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.dark-theme .status-popover {
  background: var(--surface-secondary, #1e1e1e);
  border-color: var(--border-color, #333333);
}
.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #e1e5e9);
  background: var(--background-color, #f8f9fa);
  font-weight: 600;
  font-size: 13px;
}
.dark-theme .popover-header {
  background: rgba(255, 255, 255, 0.03);
  border-bottom-color: var(--border-color, #333333);
}
.popover-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #6c757d);
  padding: 4px;
  border-radius: 4px;
  display: flex;
}
.popover-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-color, #212529);
}
.dark-theme .popover-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}
.popover-content {
  overflow-y: auto;
  padding: 8px 0;
  max-height: 350px;
}
.popover-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
  font-size: 13px;
  justify-content: space-between;
}
.popover-item.file {
  padding: 0;
  cursor: default;
  display: flex;
  align-items: stretch;
}
.file-action-primary {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.2s;
  overflow: hidden;
}
.file-action-primary:hover {
  background: var(--hover-color);
}
.file-action-diff {
  display: flex;
  align-items: center;
  padding: 0 10px;
  cursor: pointer;
  border-left: 1px solid var(--border-color);
  color: var(--secondary-text-color);
  transition: all 0.2s;
}
.file-action-diff:hover {
  background: var(--hover-color);
  color: var(--primary-color);
}
.popover-item:last-child {
  border-bottom: none;
}
.popover-item:hover {
  background: var(--hover-color, #f8f9fa);
}
.popover-item.file:hover {
  background: transparent;
}
.dark-theme .popover-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.popover-item .item-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
  font-weight: bold;
  font-size: 14px;
}
.popover-item.file .item-icon {
  background: rgba(0, 123, 255, 0.1);
  color: #007bff;
}
.popover-item.task .item-icon {
  background: rgba(111, 66, 193, 0.1);
  color: #6f42c1;
  border-radius: 50%;
}
.popover-item .item-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.popover-item .item-meta {
  font-size: 11px;
  color: var(--text-muted, #999);
}
.ai-chat-widget .thread-selector:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}
.ai-chat-widget .thread-selector:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}
.ai-chat-widget .thread-selector option {
  background: var(--surface-color, #ffffff);
  color: var(--text-primary, #1e293b);
  padding: 8px;
}
.ai-chat-widget .thread-selector option.archived-thread {
  color: var(--text-tertiary, #94a3b8);
  font-style: italic;
}
.ai-chat-widget .toolbar-center {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
}
.ai-chat-widget .toolbar-btn-text {
  width: auto;
  padding: 4px 8px;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
}
.ai-chat-widget .toolbar-btn-text svg {
  width: 14px;
  height: 14px;
}
.chat-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.chat-modal.show {
  opacity: 1;
}
.chat-modal-content {
  background: var(--surface-color, #ffffff);
  border-radius: 12px;
  width: 380px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}
.chat-modal.show .chat-modal-content {
  transform: scale(1);
}
.dark-theme .chat-modal-content {
  background: var(--surface-color, #1e1e1e);
}
.chat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e1e5e9);
}
.chat-modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  margin: 0;
}
.dark-theme .chat-modal-header h3 {
  color: var(--text-primary, #e2e8f0);
}
.chat-modal-header .close-modal-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 20px;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}
.chat-modal-header .close-modal-btn:hover {
  background: var(--hover-bg, rgba(0, 0, 0, 0.05));
  color: var(--text-primary, #1e293b);
}
.chat-modal-body {
  padding: 20px;
}
.chat-confirm-message {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary, #1e293b);
}
.dark-theme .chat-confirm-message {
  color: var(--text-primary, #e2e8f0);
}
.chat-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-color, #e1e5e9);
}
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-form label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #1e293b);
}
.dark-theme .modal-form label {
  color: var(--text-primary, #e2e8f0);
}
.modal-form input[type=text] {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #e1e5e9);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface-color, #ffffff);
  color: var(--text-primary, #1e293b);
  transition: all 0.15s ease;
}
.modal-form input[type=text]:focus {
  outline: none;
  border-color: var(--primary-color, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.dark-theme .modal-form input[type=text] {
  background: var(--surface-secondary, #252836);
  border-color: var(--border-color, #404866);
  color: var(--text-primary, #e2e8f0);
}
.modal-hint {
  font-size: 12px;
  color: var(--text-tertiary, #94a3b8);
  margin-top: 4px;
}
.modal-info {
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  margin-bottom: 8px;
}
.dark-theme .modal-info {
  color: var(--text-secondary, #8892b0);
}
.modal-info strong {
  color: var(--text-primary, #1e293b);
}
.dark-theme .modal-info strong {
  color: var(--text-primary, #e2e8f0);
}
.modal-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.modal-btn-primary {
  background: var(--primary-color, #3b82f6);
  color: white;
}
.modal-btn-primary:hover {
  background: var(--primary-hover, #2563eb);
}
.modal-btn-secondary {
  background: var(--surface-secondary, #e2e8f0);
  color: var(--text-primary, #1e293b);
}
.modal-btn-secondary:hover {
  background: var(--hover-bg, #d1d5db);
}
.dark-theme .modal-btn-secondary {
  background: var(--surface-secondary, #374151);
  color: var(--text-primary, #e2e8f0);
}
.dark-theme .modal-btn-secondary:hover {
  background: var(--hover-bg, #4b5563);
}
.snapshot-browser-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.snapshot-browser-modal.show {
  opacity: 1;
}
.snapshot-browser-content {
  background: var(--surface-color, #ffffff);
  border-radius: 12px;
  width: 500px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}
.snapshot-browser-modal.show .snapshot-browser-content {
  transform: scale(1);
}
.dark-theme .snapshot-browser-content {
  background: var(--surface-color, #1e1e1e);
}
.snapshot-browser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e1e5e9);
}
.snapshot-browser-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  margin: 0;
}
.dark-theme .snapshot-browser-header h3 {
  color: var(--text-primary, #e2e8f0);
}
.snapshot-browser-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.snapshot-item {
  display: flex;
  flex-direction: column;
  padding: 12px 20px;
  gap: 8px;
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--border-color, #e1e5e9);
}
.snapshot-item:last-child {
  border-bottom: none;
}
.snapshot-item:hover {
  background: var(--hover-bg, rgba(0, 0, 0, 0.03));
}
.dark-theme .snapshot-item {
  border-bottom-color: var(--border-color, #333333);
}
.snapshot-thread-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-color, #3b82f6);
  background: var(--primary-light, rgba(59, 130, 246, 0.1));
  padding: 3px 8px;
  border-radius: 10px;
  max-width: fit-content;
}
.snapshot-info {
  flex: 1;
  min-width: 0;
}
.snapshot-description {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-primary, #1e293b);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.dark-theme .snapshot-description {
  color: var(--text-primary, #e2e8f0);
}
.snapshot-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-tertiary, #94a3b8);
  margin-top: 4px;
}
.snapshot-files {
  display: flex;
  align-items: center;
  gap: 4px;
}
.snapshot-files::before {
  content: "📄";
  font-size: 10px;
}
.snapshot-date {
  display: flex;
  align-items: center;
  gap: 4px;
}
.snapshot-date::before {
  content: "🕐";
  font-size: 10px;
}
.restore-snapshot-btn {
  align-self: flex-end;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--primary-color, #3b82f6);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.restore-snapshot-btn:hover {
  background: var(--primary-hover, #2563eb);
}
.toast-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-inverse, #1e293b);
  color: var(--text-inverse, #ffffff);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10002;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.dark-theme .toast-notification {
  background: var(--surface-inverse, #e2e8f0);
  color: var(--text-inverse, #1e293b);
}
.file-changes-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 70%;
  background: var(--surface-primary, #ffffff);
  border-top: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  flex-direction: column;
  z-index: 100;
  animation: slideUpPanel 0.3s ease;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}
@keyframes slideUpPanel {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.file-changes-panel.closing {
  animation: slideDownPanel 0.3s ease forwards;
}
@keyframes slideDownPanel {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}
.file-changes-panel.minimized {
  max-height: 40px;
  cursor: pointer;
  overflow: hidden;
}
.file-changes-panel.minimized .file-changes-list,
.file-changes-panel.minimized .file-changes-diff {
  display: none;
}
.file-changes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: var(--surface-secondary, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  flex-shrink: 0;
}
.file-changes-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}
.file-changes-title svg {
  color: var(--primary-color, #3b82f6);
}
.file-count-badge {
  background: var(--primary-color, #3b82f6);
  color: white;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
}
.file-changes-close {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-tertiary, #64748b);
  border-radius: 4px;
  transition: all 0.15s ease;
}
.file-changes-close:hover {
  background: var(--surface-tertiary, #f1f5f9);
  color: var(--text-primary, #1e293b);
}
.file-changes-list {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  max-height: 80px;
  overflow-y: auto;
  flex-shrink: 0;
}
.file-change-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.file-change-item:hover {
  background: var(--surface-secondary, #f8fafc);
}
.file-change-item.active {
  background: var(--surface-tertiary, #f1f5f9);
  border-left: 2px solid var(--primary-color, #3b82f6);
}
.file-change-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  border-radius: 4px;
}
.file-change-icon.created {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}
.file-change-icon.modified {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}
.file-change-icon.deleted {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}
.file-change-name {
  flex: 1;
  font-size: 12px;
  font-family:
    "Fira Code",
    "Monaco",
    "Consolas",
    monospace;
  color: var(--text-primary, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-change-size {
  font-size: 11px;
  color: var(--text-tertiary, #64748b);
}
.file-changes-diff {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.diff-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 12px;
  background: var(--surface-secondary, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.diff-filename {
  font-size: 11px;
  font-weight: 500;
  font-family:
    "Fira Code",
    "Monaco",
    "Consolas",
    monospace;
  color: var(--text-secondary, #475569);
}
.diff-view-toggle {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-tertiary, #64748b);
  border-radius: 4px;
}
.diff-view-toggle:hover {
  background: var(--surface-tertiary, #f1f5f9);
}
.diff-content {
  flex: 1;
  overflow: auto;
  background: var(--code-bg, #1e1e1e);
}
.diff-view {
  font-family:
    "Fira Code",
    "Monaco",
    "Consolas",
    monospace;
  font-size: 12px;
  line-height: 1.5;
}
.diff-view.diff-modified {
  display: flex;
}
.diff-side {
  flex: 1;
  overflow: auto;
}
.diff-side-header {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--surface-tertiary, #f1f5f9);
  color: var(--text-secondary, #475569);
  position: sticky;
  top: 0;
}
.diff-old .diff-side-header {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}
.diff-new .diff-side-header {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}
.diff-line {
  display: flex;
  min-height: 20px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.05));
}
.diff-line.added {
  background: #e6ffed;
  border-left: 4px solid #28a745;
  position: relative;
}
.diff-line.removed {
  background: #ffeaea;
  border-left: 4px solid #dc3545;
  text-decoration: line-through;
  opacity: 0.85;
}
.dark-theme .diff-line.added {
  background: rgba(40, 167, 69, 0.35);
  border-left: 4px solid #28a745;
}
.dark-theme .diff-line.removed {
  background: rgba(220, 53, 69, 0.35);
  border-left: 4px solid #dc3545;
}
.diff-line-num {
  width: 40px;
  padding: 2px 8px;
  text-align: right;
  color: var(--text-tertiary, #64748b);
  background: rgba(0, 0, 0, 0.1);
  -webkit-user-select: none;
  user-select: none;
  flex-shrink: 0;
}
.diff-line-marker {
  width: 20px;
  text-align: center;
  font-weight: bold;
  flex-shrink: 0;
}
.diff-line.added .diff-line-marker {
  color: #22c55e;
}
.diff-line.removed .diff-line-marker {
  color: #ef4444;
}
.diff-line-content {
  flex: 1;
  padding: 2px 8px;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--code-text, #d4d4d4);
}
.diff-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-tertiary, #64748b);
}
.dark-theme .file-changes-panel {
  background: var(--surface-primary, #0f172a);
  border-color: var(--border-color, #1e293b);
}
.dark-theme .file-changes-header {
  background: var(--surface-secondary, #1e293b);
}
.dark-theme .file-change-item:hover {
  background: var(--surface-secondary, #1e293b);
}
.dark-theme .file-change-item.active {
  background: var(--surface-tertiary, #334155);
}
.dark-theme .diff-header {
  background: var(--surface-secondary, #1e293b);
}
.threads-management-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.threads-management-panel.show {
  opacity: 1;
}
.threads-panel-content {
  background: var(--surface-color, #ffffff);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.threads-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e1e5e9);
}
.threads-panel-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-text-color, #1a1a1a);
}
.close-panel-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--secondary-text-color, #666);
  cursor: pointer;
  transition: all 0.15s ease;
}
.close-panel-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--primary-text-color, #1a1a1a);
}
.threads-panel-actions {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color, #e1e5e9);
}
.create-thread-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: var(--primary-color, #4f46e5);
  color: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.create-thread-btn:hover {
  background: var(--primary-color-hover, #4338ca);
}
.create-thread-btn svg {
  width: 14px;
  height: 14px;
}
.threads-panel-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.thread-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background 0.15s ease;
}
.thread-item:hover {
  background: rgba(0, 0, 0, 0.04);
}
.thread-item.active {
  background: rgba(79, 70, 229, 0.08);
}
.thread-item.archived {
  opacity: 0.6;
}
.thread-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.thread-item-info {
  flex: 1;
  min-width: 0;
}
.thread-item-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary-text-color, #1a1a1a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-item-meta {
  display: block;
  font-size: 12px;
  color: var(--secondary-text-color, #666);
  margin-top: 2px;
}
.thread-item-status {
  display: flex;
  gap: 6px;
}
.archived-badge,
.active-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.archived-badge {
  background: rgba(0, 0, 0, 0.08);
  color: var(--secondary-text-color, #666);
}
.active-badge {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}
.thread-item-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.thread-item:hover .thread-item-actions {
  opacity: 1;
}
.thread-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--secondary-text-color, #666);
  cursor: pointer;
  transition: all 0.15s ease;
}
.thread-action-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--primary-text-color, #1a1a1a);
}
.thread-action-btn.delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}
.thread-action-btn svg {
  width: 14px;
  height: 14px;
}
.dark-theme .threads-panel-content {
  background: var(--surface-color, #1e1e1e);
}
.dark-theme .threads-panel-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.dark-theme .threads-panel-header h3 {
  color: var(--primary-text-color, #ffffff);
}
.dark-theme .close-panel-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}
.dark-theme .threads-panel-actions {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.dark-theme .thread-item:hover {
  background: rgba(255, 255, 255, 0.04);
}
.dark-theme .thread-item.active {
  background: rgba(79, 70, 229, 0.15);
}
.dark-theme .thread-item-name {
  color: var(--primary-text-color, #ffffff);
}
.dark-theme .archived-badge {
  background: rgba(255, 255, 255, 0.08);
}
.dark-theme .active-badge {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}
.dark-theme .thread-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary-text-color, #ffffff);
}
.dark-theme .thread-action-btn.delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.chat-loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 12px;
  width: 100%;
  color: var(--text-secondary, #64748b);
}
.chat-loading-indicator .loading-spinner {
  color: var(--primary-color, #3b82f6);
}
.chat-loading-indicator .loading-spinner svg {
  width: 28px;
  height: 28px;
}
.chat-loading-indicator .loading-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary, #94a3b8);
}
.dark-theme .chat-loading-indicator {
  color: var(--text-secondary, #8892b0);
}
.dark-theme .chat-loading-indicator .loading-spinner {
  color: var(--primary-color, #6366f1);
}
.dark-theme .chat-loading-indicator .loading-text {
  color: var(--text-tertiary, #64748b);
}
.file-operation-message {
  display: flex;
  align-items: center;
  gap: 8px;
}
.file-operation-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color, #3b82f6);
}
.file-operation-text {
  font-weight: 500;
}
.file-operation-complete {
  display: inline-block;
  animation: fileOperationPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.file-operation-complete-message {
  display: flex;
  align-items: center;
  gap: 4px;
}
@keyframes fileOperationPop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.dark-theme .file-operation-spinner {
  color: var(--primary-color, #6366f1);
}
.chat-header-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.header-thread-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.header-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--secondary-text-color, #666);
  cursor: pointer;
  transition: all 0.2s ease;
}
.header-action-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--primary-text-color, #333);
}
.header-action-btn svg {
  width: 14px;
  height: 14px;
}
.chat-header-actions .chat-settings-control {
  position: relative;
  display: flex;
  align-items: center;
}
.chat-header-actions .chat-settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.97);
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(2, 6, 23, 0.12);
}
.chat-header-actions .chat-settings-btn:hover {
  border-color: rgba(255, 255, 255, 0.56);
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}
.chat-header-actions .chat-settings-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22), 0 2px 8px rgba(2, 6, 23, 0.16);
}
.chat-header-actions .chat-settings-btn svg {
  width: 14px;
  height: 14px;
  opacity: 0.9;
}
.chat-header-actions .chat-settings-btn.is-open {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.3);
}
.chat-header-actions .chat-settings-btn.is-locked {
  border-color: rgba(250, 204, 21, 0.9);
}
.chat-header-actions .settings-model-group-mobile {
  display: none;
}
.chat-header-actions .chat-settings-modal[hidden] {
  display: none !important;
}
.chat-header-actions .chat-settings-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2600;
}
.chat-header-actions .chat-settings-modal-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(15, 23, 42, 0.52);
}
.chat-header-actions .chat-settings-modal-card {
  position: relative;
  width: min(420px, calc(100vw - 24px));
  margin: 72px auto 0;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.34);
  overflow: hidden;
}
.chat-header-actions .chat-settings-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
}
.chat-header-actions .chat-settings-modal-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}
.chat-header-actions .chat-settings-close-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-header-actions .chat-settings-close-btn:hover {
  background: #eef2ff;
  border-color: #93c5fd;
}
.chat-header-actions .chat-settings-modal-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-header-actions .chat-settings-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-header-actions .chat-settings-field-label {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}
.chat-header-actions .chat-settings-select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  background: #ffffff;
  outline: none;
}
.chat-header-actions .chat-settings-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.chat-header-actions .chat-settings-select:disabled {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}
.chat-header-actions .chat-settings-help {
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
  color: #475569;
}
.chat-header-actions .chat-settings-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 10px 14px 14px;
  border-top: 1px solid #e2e8f0;
}
.chat-header-actions .chat-settings-done-btn {
  border: 1px solid #2563eb;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
}
.chat-header-actions .chat-settings-done-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}
body.project-view-mode.dark-theme .chat-header-actions .chat-settings-modal-card,
.dark-theme .ai-chat-widget .chat-header-actions .chat-settings-modal-card {
  border-color: rgba(148, 163, 184, 0.3);
  background: #0f172a;
  box-shadow: 0 20px 42px rgba(2, 6, 23, 0.7);
}
body.project-view-mode.dark-theme .chat-header-actions .chat-settings-btn,
.dark-theme .ai-chat-widget .chat-header-actions .chat-settings-btn {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.52);
}
body.project-view-mode.dark-theme .chat-header-actions .chat-settings-btn:hover,
.dark-theme .ai-chat-widget .chat-header-actions .chat-settings-btn:hover {
  border-color: rgba(147, 197, 253, 0.85);
  background: rgba(30, 41, 59, 0.82);
}
body.project-view-mode.dark-theme .chat-header-actions .chat-settings-modal-header,
body.project-view-mode.dark-theme .chat-header-actions .chat-settings-modal-footer,
.dark-theme .ai-chat-widget .chat-header-actions .chat-settings-modal-header,
.dark-theme .ai-chat-widget .chat-header-actions .chat-settings-modal-footer {
  border-color: rgba(148, 163, 184, 0.22);
}
body.project-view-mode.dark-theme .chat-header-actions .chat-settings-modal-header h4,
body.project-view-mode.dark-theme .chat-header-actions .chat-settings-field-label,
.dark-theme .ai-chat-widget .chat-header-actions .chat-settings-modal-header h4,
.dark-theme .ai-chat-widget .chat-header-actions .chat-settings-field-label {
  color: #e2e8f0;
}
body.project-view-mode.dark-theme .chat-header-actions .chat-settings-close-btn,
.dark-theme .ai-chat-widget .chat-header-actions .chat-settings-close-btn {
  border-color: #334155;
  background: #1e293b;
  color: #cbd5e1;
}
body.project-view-mode.dark-theme .chat-header-actions .chat-settings-close-btn:hover,
.dark-theme .ai-chat-widget .chat-header-actions .chat-settings-close-btn:hover {
  border-color: #60a5fa;
  background: rgba(37, 99, 235, 0.22);
}
body.project-view-mode.dark-theme .chat-header-actions .chat-settings-select,
.dark-theme .ai-chat-widget .chat-header-actions .chat-settings-select {
  border-color: #334155;
  background: #1e293b;
  color: #e2e8f0;
}
body.project-view-mode.dark-theme .chat-header-actions .chat-settings-select:disabled,
.dark-theme .ai-chat-widget .chat-header-actions .chat-settings-select:disabled {
  background: #111827;
  color: #94a3b8;
}
body.project-view-mode.dark-theme .chat-header-actions .chat-settings-help,
.dark-theme .ai-chat-widget .chat-header-actions .chat-settings-help {
  color: #94a3b8;
}
@media (max-width: 768px) {
  .chat-header-actions .chat-header-model-selector {
    display: none !important;
  }
  .chat-header-actions .settings-model-group-mobile {
    display: flex;
  }
  .chat-header-actions .chat-settings-modal-card {
    width: calc(100vw - 16px);
    margin-top: 42px;
  }
}
.connection-error-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fff5f5;
  color: #e53e3e;
  border-top: 1px solid #feb2b2;
  border-bottom: 1px solid #feb2b2;
  width: 100%;
  z-index: 25;
  font-size: 13px;
  font-weight: 500;
  animation: slideUpFade 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.dark-theme .connection-error-banner {
  background: rgba(229, 62, 62, 0.1);
  color: #fc8181;
  border-color: rgba(229, 62, 62, 0.2);
}
.connection-error-banner svg {
  flex-shrink: 0;
}
.connection-error-banner .reconnect-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(229, 62, 62, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: paginationSpin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.chat-message .status-avatar {
  background:
    linear-gradient(
      135deg,
      #6b7280 0%,
      #4b5563 100%);
  width: 28px;
  height: 28px;
  box-shadow: none;
  border: none;
}
.chat-message .status-content {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 8px 12px;
  display: flex;
  align-items: center;
}
.chat-message .status-content:hover {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transform: none;
}
.status-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}
.status-text {
  font-size: 13px;
  color: #6b7280;
  font-style: italic;
  font-weight: 500;
}
.dark-theme .status-text {
  color: #9ca3af;
}
.status-dots span {
  font-size: 13px;
  color: #6b7280;
  animation: statusDots 1.4s infinite ease-in-out both;
}
.dark-theme .status-dots span {
  color: #9ca3af;
}
.status-dots span:nth-child(1) {
  animation-delay: -0.32s;
}
.status-dots span:nth-child(2) {
  animation-delay: -0.16s;
}
@keyframes statusDots {
  0%, 80%, 100% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
}
.antigravity-box {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  overflow: visible;
  border: none;
  transition: none;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  max-height: none;
  flex-shrink: 1;
  width: 100%;
  box-sizing: border-box;
}
.chat-message.antigravity-message {
  margin-bottom: 2px;
}
.dark-theme .antigravity-box {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
}
.task-section {
  background: transparent;
  border-bottom: none;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 0;
}
.dark-theme .task-section {
  background: transparent;
  border-bottom-color: transparent;
}
.task-header {
  padding: 4px 4px 2px;
  display: none;
  justify-content: space-between;
  align-items: center;
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
  font-weight: 600;
  font-size: 11px;
  color: var(--secondary-text-color, #64748b);
  background: transparent;
  border-bottom: none;
}
.dark-theme .task-header {
  color: #94a3b8;
  background: transparent;
  border-bottom-color: transparent;
}
.task-header:hover {
  background: rgba(0, 0, 0, 0.02);
}
.task-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.task-workflow-id {
  font-size: 11px;
  color: var(--secondary-text-color, #64748b);
}
.dark-theme .task-workflow-id {
  color: #94a3b8;
}
.task-progress-ring {
  width: 20px;
  height: 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.task-progress-ring svg {
  transform: rotate(-90deg);
}
.task-progress-ring circle {
  transition: stroke-dashoffset 0.35s;
  transform-origin: 50% 50%;
}
.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}
.task-list.open {
  max-height: 400px;
  opacity: 1;
  overflow-y: auto;
  border-top: 1px solid var(--border-color, #eaeaea);
}
.task-item {
  padding: 10px 16px 10px 44px;
  border-bottom: 1px solid var(--border-color, #f5f5f5);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  position: relative;
  transition: background 0.2s;
}
.task-item:last-child {
  border-bottom: none;
}
.task-item:hover {
  background: rgba(0, 0, 0, 0.01);
}
.task-status-icon {
  position: absolute;
  left: 16px;
  top: 10px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.task-item.completed {
  color: #10b981;
}
.task-item.in-progress {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}
.task-item.pending {
  color: var(--secondary-text-color, #666);
}
.response-section {
  padding: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-color, #333);
}
.dark-theme .response-section {
  color: #e5e7eb;
}
.response-section p {
  margin-bottom: 10px;
}
.response-section p:last-child {
  margin-bottom: 0;
}
.task-item.failed {
  color: #ef4444;
}
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  margin: 8px 0 6px;
  font-weight: 600;
  color: var(--text-color, #111827);
}
.dark-theme .markdown-content h1,
.dark-theme .markdown-content h2,
.dark-theme .markdown-content h3,
.dark-theme .markdown-content h4,
.dark-theme .markdown-content h5,
.dark-theme .markdown-content h6 {
  color: #e5e7eb;
}
.markdown-content p {
  margin: 6px 0;
  text-align: left;
  font-size: 14px;
}
.dark-theme .markdown-content p,
.dark-theme .markdown-content li {
  color: #e5e7eb;
}
.markdown-content ul {
  margin: 6px 0 6px 18px;
  padding: 0;
}
.markdown-content li {
  margin: 4px 0;
}
.markdown-content code {
  background: rgba(15, 23, 42, 0.4);
  padding: 2px 4px;
  border-radius: 6px;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    "Courier New",
    monospace;
  font-size: 12px;
}
.markdown-content pre {
  background: rgba(15, 23, 42, 0.5);
  padding: 10px 12px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 8px 0;
}
.markdown-content pre code {
  background: transparent;
  padding: 0;
}
.markdown-content a {
  color: #60a5fa;
  text-decoration: none;
}
.markdown-content a:hover {
  text-decoration: underline;
}
.chat-message {
  margin-bottom: 12px;
}
.message-container {
  max-width: 100%;
  min-width: 0;
}
.message-content {
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  cursor: default;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.chat-message .markdown-content {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.chat-message .markdown-content p,
.chat-message .markdown-content li {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.chat-message .markdown-content pre {
  max-width: 100%;
}
.user-message .message-content,
.ai-message .message-content {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--text-color, #1f2937);
}
.dark-theme .user-message .message-content,
.dark-theme .ai-message .message-content {
  color: #cbd5e1;
}
.chat-message .ai-avatar-small,
.chat-message .user-avatar {
  display: none;
}
.task-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 4px;
}
.workflow-events-panel {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}
.dark-theme .workflow-events-panel {
  background: transparent;
  border-color: transparent;
}
.workflow-events-title {
  display: none;
}
.dark-theme .workflow-events-title {
  color: #94a3b8;
}
.workflow-events-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: none;
  overflow-y: visible;
  overscroll-behavior: contain;
  padding-right: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.workflow-events-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.workflow-event-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 3px 6px;
  border: none;
  border-radius: 0;
  background: transparent;
  border-left: 2px solid transparent;
}
.dark-theme .workflow-event-item {
  background: transparent;
  border-color: transparent;
}
.workflow-event-item.tool {
  border-left: 2px solid rgba(59, 130, 246, 0.35);
}
.workflow-event-item.assistant {
  border-left: 2px solid rgba(16, 185, 129, 0.35);
}
.workflow-event-item.muted {
  opacity: 0.5;
}
.workflow-events-list {
  gap: 0;
}
.workflow-event-group-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px 1px;
  font-size: 10px;
  font-weight: 500;
  color: var(--secondary-text-color, #64748b);
  opacity: 0.7;
}
.dark-theme .workflow-event-group-header {
  color: #94a3b8;
}
.workflow-event-item {
  border-left: none;
  padding: 1px 6px 1px 16px;
}
.workflow-event-item.tool,
.workflow-event-item.assistant {
  border-left: none;
}
.workflow-event-item::before {
  content: "·";
  position: absolute;
  left: 8px;
  color: var(--secondary-text-color, #94a3b8);
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
}
.workflow-event-item {
  position: relative;
}
.workflow-events-list.is-active .workflow-event-item:last-child:not(.muted) .workflow-event-text {
  color: #3b82f6;
  animation: textColorPulse 2.4s ease-in-out infinite;
}
.dark-theme .workflow-events-list.is-active .workflow-event-item:last-child:not(.muted) .workflow-event-text {
  color: #60a5fa;
  animation: textColorPulseDark 2.4s ease-in-out infinite;
}
@keyframes textColorPulse {
  0%, 100% {
    color: var(--text-color, #1f2937);
  }
  50% {
    color: #3b82f6;
  }
}
@keyframes textColorPulseDark {
  0%, 100% {
    color: #e2e8f0;
  }
  50% {
    color: #60a5fa;
  }
}
.workflow-event-meta {
  font-size: 10px;
  color: var(--secondary-text-color, #64748b);
  font-weight: 500;
  opacity: 0.7;
}
.tool-call-icon {
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    "Courier New",
    monospace;
  font-size: 10px;
  letter-spacing: -0.02em;
}
.dark-theme .workflow-event-meta {
  color: #94a3b8;
}
.workflow-event-text {
  color: var(--text-color, #1f2937);
  font-size: 11.5px;
  line-height: 1.32;
  word-break: break-word;
}
.workflow-event-text.markdown-content h1,
.workflow-event-text.markdown-content h2,
.workflow-event-text.markdown-content h3,
.workflow-event-text.markdown-content h4,
.workflow-event-text.markdown-content h5,
.workflow-event-text.markdown-content h6,
.task-flow-text.markdown-content h1,
.task-flow-text.markdown-content h2,
.task-flow-text.markdown-content h3,
.task-flow-text.markdown-content h4,
.task-flow-text.markdown-content h5,
.task-flow-text.markdown-content h6 {
  margin: 4px 0 3px;
  line-height: 1.3;
}
.workflow-event-text.markdown-content p,
.task-flow-text.markdown-content p {
  margin: 2px 0;
}
.workflow-event-text.markdown-content ul,
.task-flow-text.markdown-content ul {
  margin: 2px 0 2px 16px;
}
.workflow-event-text.markdown-content li,
.task-flow-text.markdown-content li {
  margin: 1px 0;
}
.workflow-event-text.markdown-content br,
.task-flow-text.markdown-content br {
  line-height: 1.15;
}
.dark-theme .workflow-event-text {
  color: #e2e8f0;
}
.workflow-event-text .stream-cursor {
  display: inline-block;
  margin-left: 2px;
  opacity: 0.7;
  animation: workflowCursorBlink 0.9s steps(1) infinite;
}
@keyframes workflowCursorBlink {
  0%, 49% {
    opacity: 0.7;
  }
  50%, 100% {
    opacity: 0.15;
  }
}
.task-flow-feed {
  max-height: 300px;
}
.task-flow-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.task-flow-item {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 2px 6px;
  border-left: 2px solid transparent;
}
.task-flow-item.tool {
  border-left: 2px solid rgba(59, 130, 246, 0.35);
}
.task-flow-item.assistant {
  border-left: 2px solid rgba(16, 185, 129, 0.35);
}
.task-flow-item.muted {
  color: var(--secondary-text-color, #64748b);
  font-style: italic;
}
.task-flow-meta {
  font-size: 10px;
  font-weight: 500;
  color: var(--secondary-text-color, #64748b);
  margin-bottom: 1px;
  opacity: 0.7;
}
.task-flow-text {
  font-size: 11px;
  line-height: 1.32;
  color: var(--text-color, #1f2937);
}
.dark-theme .task-flow-item {
  border-color: transparent;
  background: transparent;
}
.dark-theme .task-flow-meta {
  color: #94a3b8;
}
.dark-theme .task-flow-text,
.dark-theme .task-flow-item.muted {
  color: #e2e8f0;
}
.task-accordion-list .task-empty {
  margin: 0;
  padding: 2px 6px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 11px;
  opacity: 0.5;
}
.dark-theme .task-accordion-list .task-empty {
  border-color: transparent;
  background: transparent;
}
.change-plan-panel {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 2px 6px;
}
.dark-theme .change-plan-panel {
  background: transparent;
  border-color: transparent;
}
.change-plan-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--secondary-text-color, #64748b);
  margin-bottom: 8px;
}
.dark-theme .change-plan-title {
  color: #94a3b8;
}
.change-plan-body {
  font-size: 12px;
  line-height: 1.45;
}
.task-progress-corner {
  display: none;
}
.dark-theme .task-progress-corner {
  display: none;
}
.task-progress-footer {
  display: none;
}
.dark-theme .task-progress-footer {
  display: none;
}
.task-footer-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-color, #1f2937);
}
.dark-theme .task-footer-left {
  color: #e5e7eb;
}
.completed-task-section {
  border: none;
  border-radius: 0;
  background: transparent;
}
.dark-theme .completed-task-section {
  background: transparent;
  border-color: transparent;
}
.completed-task-toggle,
.other-task-toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--secondary-text-color, #64748b);
  padding: 2px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  opacity: 0.6;
}
.dark-theme .completed-task-toggle,
.dark-theme .other-task-toggle {
  color: #94a3b8;
}
.completed-task-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.completed-task-chevron {
  font-size: 12px;
  line-height: 1;
}
.completed-task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 8px 8px;
}
.task-accordion {
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
}
.dark-theme .task-accordion {
  background: transparent;
  border-color: transparent;
}
.task-accordion-header {
  width: 100%;
  padding: 4px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 12px;
  color: var(--text-color, #1f2937);
}
.task-accordion.non-expandable .task-accordion-header {
  cursor: default;
}
.task-accordion.non-expandable .task-accordion-header:disabled {
  opacity: 1;
}
.dark-theme .task-accordion-header {
  color: #e5e7eb;
}
.task-accordion .task-title-group {
  gap: 10px;
}
.task-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 6px;
}
.task-accordion.open .task-accordion-body {
  max-height: 520px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 4px 6px 6px;
}
.task-accordion.open .task-accordion-body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.task-accordion.open .task-accordion-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.task-status {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  text-transform: capitalize;
  font-weight: 500;
}
.task-status.completed {
  background: transparent;
  color: #10b981;
}
.task-status.in-progress {
  background: transparent;
  color: #3b82f6;
}
.task-status.pending {
  background: transparent;
  color: #94a3b8;
}
.task-status.blocked {
  background: transparent;
  color: #eab308;
}
.task-status.failed {
  background: transparent;
  color: #ef4444;
}
.task-subsection {
  margin-top: 8px;
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.task-subsection::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.task-blocked {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--secondary-text-color, #64748b);
  margin-bottom: 10px;
}
.dark-theme .task-blocked {
  color: #94a3b8;
}
.blocked-task-link {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #2563eb;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.dark-theme .blocked-task-link {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}
.task-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary-text-color, #64748b);
  margin-bottom: 6px;
}
.dark-theme .task-subtitle {
  color: #94a3b8;
}
.task-empty {
  padding: 2px 6px;
  color: var(--secondary-text-color, #64748b);
  font-size: 11px;
  opacity: 0.5;
}
.dark-theme .task-empty {
  color: #94a3b8;
}
.stream-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 4px;
  font-size: 10px;
  color: var(--secondary-text-color, #64748b);
  font-weight: 500;
  opacity: 0.7;
}
.dark-theme .stream-header {
  color: #94a3b8;
}
.workflow-update-gap-label {
  display: none;
  text-align: right;
  padding: 2px 6px 0;
  font-size: 10px;
  color: var(--secondary-text-color, #64748b);
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}
.workflow-update-gap-label.is-visible {
  display: block;
}
.dark-theme .workflow-update-gap-label {
  color: #94a3b8;
  opacity: 0.55;
}
.workflow-event-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 6px 0;
}
.workflow-event-controls .workflow-update-gap-label {
  padding: 0;
  text-align: left;
  flex: 1;
}
.workflow-resume-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color, #d1d9e0);
  background: var(--surface-color, #ffffff);
  color: var(--text-color, #334155);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background-color 0.15s ease,
    opacity 0.15s ease;
}
.workflow-resume-btn:hover:not(:disabled) {
  border-color: var(--primary-color, #3b82f6);
  color: var(--primary-color, #3b82f6);
  background: rgba(59, 130, 246, 0.08);
}
.workflow-resume-btn:disabled,
.workflow-resume-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.dark-theme .workflow-resume-btn {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.45);
  color: #cbd5e1;
}
.dark-theme .workflow-resume-btn:hover:not(:disabled) {
  border-color: #60a5fa;
  color: #93c5fd;
  background: rgba(96, 165, 250, 0.16);
}
.stream-progress {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #3b82f6;
  font-size: 10px;
}
.dark-theme .stream-progress {
  color: #60a5fa;
}
.stream-completed-task {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--secondary-text-color, #94a3b8);
  opacity: 0.55;
  line-height: 1.5;
}
.dark-theme .stream-completed-task {
  color: #64748b;
}
.stream-completed-task .task-check {
  color: #10b981;
  font-size: 11px;
  flex-shrink: 0;
}
.stream-completed-task .task-name {
  text-decoration: line-through;
  text-decoration-color: rgba(148, 163, 184, 0.4);
}
.stream-current-task {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  font-size: 11.5px;
  color: var(--text-color, #1f2937);
  font-weight: 500;
}
.dark-theme .stream-current-task {
  color: #e2e8f0;
}
.stream-current-task .task-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
  flex-shrink: 0;
  animation: taskDotPulse 1.8s ease-in-out infinite;
}
@keyframes taskDotPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}
.stream-current-task .task-cancel {
  font-size: 9px;
  font-weight: 700;
  color: #f59e0b;
  flex-shrink: 0;
  line-height: 1;
}
.stream-current-task.cancelled {
  opacity: 0.6;
}
.stream-current-task .task-fail {
  font-size: 9px;
  font-weight: 700;
  color: #ef4444;
  flex-shrink: 0;
  line-height: 1;
}
.stream-current-task.failed {
  opacity: 0.6;
}
.pending-question-card {
  margin: 6px 0 2px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-left: 2px solid rgba(245, 158, 11, 0.55);
  background: rgba(255, 251, 235, 0.8);
  border-radius: 8px;
  padding: 8px 9px;
  color: #573a08;
  box-shadow: none;
}
.dark-theme .pending-question-card {
  border-color: rgba(251, 191, 36, 0.28);
  border-left-color: rgba(251, 191, 36, 0.55);
  background: rgba(69, 50, 18, 0.45);
  color: #fde68a;
}
.pending-question-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}
.pending-question-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}
.pending-question-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pending-question-text {
  font-size: 12px;
  line-height: 1.52;
  font-weight: 400;
}
.pending-question-context {
  font-size: 11px;
  line-height: 1.45;
  color: #7c5a16;
}
.dark-theme .pending-question-context {
  color: #facc15;
}
.pending-question-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pending-question-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(146, 64, 14, 0.22);
  background: #fff;
  color: #7c2d12;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}
.pending-question-option:hover {
  background: #fffbeb;
  border-color: rgba(146, 64, 14, 0.45);
  transform: translateY(-1px);
}
.pending-question-option.is-selected {
  background: #fef3c7;
  border-color: rgba(146, 64, 14, 0.5);
  color: #7c2d12;
}
.pending-question-option.is-recommended {
  border-style: dashed;
}
.pending-question-option-recommended {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
  background: rgba(245, 158, 11, 0.15);
  border-radius: 999px;
  padding: 1px 6px;
}
.dark-theme .pending-question-option {
  background: rgba(17, 24, 39, 0.74);
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.28);
}
.dark-theme .pending-question-option-recommended {
  color: #fef3c7;
  background: rgba(251, 191, 36, 0.24);
}
.pending-structured-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.pending-structured-counter {
  font-size: 11px;
  font-weight: 700;
  color: #7c2d12;
}
.dark-theme .pending-structured-counter {
  color: #fde68a;
}
.pending-structured-select-all {
  border: 1px solid rgba(146, 64, 14, 0.25);
  border-radius: 999px;
  background: #fff;
  color: #7c2d12;
  font-size: 10px;
  font-weight: 650;
  padding: 4px 10px;
  cursor: pointer;
}
.pending-structured-select-all:hover {
  background: #fffbeb;
  border-color: rgba(146, 64, 14, 0.45);
}
.dark-theme .pending-structured-select-all {
  background: rgba(17, 24, 39, 0.74);
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.28);
}
.dark-theme .pending-question-option.is-selected {
  background: rgba(120, 53, 15, 0.5);
  border-color: rgba(251, 191, 36, 0.55);
}
.pending-structured-questions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pending-structured-question {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(146, 64, 14, 0.15);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.7);
}
.dark-theme .pending-structured-question {
  border-color: rgba(251, 191, 36, 0.22);
  background: rgba(31, 41, 55, 0.42);
}
.pending-structured-question-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 650;
  color: #7c2d12;
}
.dark-theme .pending-structured-question-title {
  color: #fde68a;
}
.pending-structured-question-required {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
}
.dark-theme .pending-structured-question-required {
  color: #fbbf24;
}
.pending-question-structured-input {
  min-height: 56px;
}
.pending-structured-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pending-structured-nav-btn {
  border: 1px solid rgba(146, 64, 14, 0.24);
  background: #fff;
  color: #7c2d12;
  border-radius: 8px;
  width: 34px;
  height: 30px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.pending-structured-nav-btn:hover:not(:disabled) {
  background: #fffbeb;
  border-color: rgba(146, 64, 14, 0.45);
}
.pending-structured-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.dark-theme .pending-structured-nav-btn {
  background: rgba(17, 24, 39, 0.74);
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.28);
}
.pending-question-freeform {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  min-width: 0;
}
.pending-question-input {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid rgba(146, 64, 14, 0.22);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #1f2937;
  background: #fff;
}
.pending-question-submit {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--primary-color, #007bff);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
  position: relative;
  overflow: hidden;
}
.pending-question-submit:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 123, 255, 0.3);
}
.dark-theme .pending-question-submit {
  background: var(--text-muted, #6c757d);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
}
.dark-theme .pending-question-submit:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.45);
}
.pending-question-submit svg {
  width: 16px;
  height: 16px;
}
.pending-question-submit.pending-question-submit-label {
  width: auto;
  height: 34px;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 650;
  align-self: flex-start;
}
.dark-theme .pending-question-input {
  background: rgba(17, 24, 39, 0.82);
  color: #f9fafb;
  border-color: rgba(251, 191, 36, 0.28);
}
@media (max-width: 640px) {
  .pending-question-freeform {
    align-items: stretch;
  }
  .pending-question-submit {
    align-self: flex-end;
  }
}
.workflow-details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 500;
  color: var(--secondary-text-color, #64748b);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease;
  margin-left: auto;
}
.workflow-details-toggle:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.04);
}
.dark-theme .workflow-details-toggle {
  color: #94a3b8;
}
.dark-theme .workflow-details-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}
.workflow-details-toggle .toggle-chevron {
  font-size: 9px;
  transition: transform 0.2s ease;
}
.workflow-details-toggle.expanded .toggle-chevron {
  transform: rotate(90deg);
}
.stream-file-changes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.stream-file-changes-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
}
.stream-file-changes-header svg {
  opacity: 0.5;
  flex-shrink: 0;
}
.stream-file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.stream-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  background: rgba(40, 167, 69, 0.08);
  border-radius: 3px;
  font-size: 10px;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;
  color: var(--text-color, #374151);
  cursor: pointer;
  transition: background 0.15s ease;
}
.stream-file-chip:hover {
  background: rgba(40, 167, 69, 0.16);
}
.dark-theme .stream-file-chip {
  background: rgba(40, 167, 69, 0.1);
  color: #cbd5e1;
}
.dark-theme .stream-file-chip:hover {
  background: rgba(40, 167, 69, 0.2);
}
.stream-file-chip .file-stat {
  font-size: 9px;
  opacity: 0.6;
}
.stream-file-chip .file-stat.added {
  color: #10b981;
}
.stream-file-chip .file-stat.removed {
  color: #ef4444;
}
.workflow-details-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.workflow-details-panel.open {
  max-height: 5000px;
  overflow: visible;
}
.workflow-details-panel.open::-webkit-scrollbar {
  display: none;
}
.workflow-details-panel.open::-webkit-scrollbar-thumb {
  display: none;
}
.details-events-section {
  padding: 4px 0;
}
.details-task-group {
  margin-bottom: 6px;
}
.details-task-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--secondary-text-color, #64748b);
  padding: 3px 6px 1px;
  opacity: 0.7;
}
.dark-theme .details-task-title {
  color: #94a3b8;
}
.details-event-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.details-event-item {
  padding: 2px 6px 2px 16px;
  position: relative;
}
.details-event-item::before {
  content: "·";
  position: absolute;
  left: 8px;
  color: var(--secondary-text-color, #94a3b8);
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
}
.details-event-meta {
  font-size: 9px;
  color: var(--secondary-text-color, #64748b);
  opacity: 0.6;
}
.dark-theme .details-event-meta {
  color: #94a3b8;
}
.details-event-text {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-color, #1f2937);
}
.dark-theme .details-event-text {
  color: #e2e8f0;
}
.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}
.chat-input-row textarea {
  flex: 1;
  min-width: 0;
}
.attach-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: transparent;
  border: 1px solid var(--border-color, #e1e5e9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--secondary-text-color, #6b7280);
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
  margin-bottom: 6px;
}
.attach-btn:hover {
  background: var(--hover-bg, rgba(0, 123, 255, 0.08));
  border-color: var(--primary-color, #007bff);
  color: var(--primary-color, #007bff);
}
.dark-theme .attach-btn {
  border-color: var(--border-color, #333);
  color: var(--secondary-text-color, #9ca3af);
}
.dark-theme .attach-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-color, #007bff);
  color: var(--primary-color, #007bff);
}
.ai-chat-widget .chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0;
  width: 100%;
  position: relative;
}
.ai-chat-widget .attach-btn {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: none;
  margin-bottom: 0;
}
.ai-chat-widget #chat-input {
  padding-left: 48px !important;
}
.attachment-preview-strip {
  display: flex;
  gap: 6px;
  padding: 6px 12px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  background: transparent;
  flex-wrap: wrap;
}
.attachment-preview-strip::-webkit-scrollbar {
  display: none;
}
.dark-theme .attachment-preview-strip {
  background: transparent;
}
.attachment-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 2px 2px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #e1e5e9);
  background: var(--input-bg, #f9fafb);
  font-size: 11px;
  color: var(--text-color, #333);
  max-width: 140px;
  flex-shrink: 0;
  cursor: default;
  line-height: 1.2;
}
.dark-theme .attachment-chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-color, #444);
  color: var(--text-color, #e5e7eb);
}
.attachment-chip.uploading {
  opacity: 0.5;
}
.attachment-chip.error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.06);
}
.attachment-thumb {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}
.attachment-file-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--secondary-text-color, #6b7280);
}
.attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80px;
}
.attachment-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-color, #555);
  color: var(--surface-color, #fff);
  border: none;
  cursor: pointer;
  font-size: 9px;
  line-height: 14px;
  text-align: center;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.attachment-chip:hover .attachment-remove {
  opacity: 1;
}
.dark-theme .attachment-remove {
  background: #e5e7eb;
  color: #1e1e1e;
}
.attachment-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--primary-color, #007bff);
  border-radius: 0 0 8px 8px;
  transition: width 0.3s ease;
}
.chat-input-container.drag-over {
  outline: 2px dashed var(--primary-color, #007bff);
  outline-offset: -2px;
  background: rgba(0, 123, 255, 0.04);
}
.dark-theme .chat-input-container.drag-over {
  background: rgba(0, 123, 255, 0.08);
}
.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.message-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 2px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: inherit;
  max-width: 160px;
  line-height: 1.2;
  text-decoration: none;
}
.message-attachment-chip img {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}
.message-attachment-chip .attachment-file-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.message-attachment-chip .attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100px;
}
.user-message .message-attachment-chip {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.05);
}
.dark-theme .message-attachment-chip {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}
.message-attachment-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-color, #e1e5e9);
  cursor: pointer;
}
.message-attachment-thumb:hover {
  border-color: var(--primary-color, #007bff);
}
.message-attachment-file {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e1e5e9);
  background: var(--input-bg, #f9fafb);
  font-size: 12px;
  color: var(--text-color, #333);
  text-decoration: none;
}
.message-attachment-file:hover {
  border-color: var(--primary-color, #007bff);
}
.dark-theme .message-attachment-file {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color, #333);
  color: var(--text-color, #e5e7eb);
}
