/*
 * Task Page Styles
 * With left sidebar navigation
 */

/* Sidebar dimensions */
:root {
  --workspace-bar-width: 64px;
  --sidebar-collapsed-width: 64px;
  --details-panel-width: 356px;
}

/* Prevent body scroll on task page */
body:has(.task-layout-wrapper) {
  overflow: hidden;
}

/* Full Page Layout Wrapper */
.task-layout-wrapper {
  display: flex;
  height: 100vh;
  padding-left: calc(var(--workspace-bar-width) + var(--sidebar-width));
  overflow: hidden;
  transition: padding-left 0.2s ease;
  position: relative;
}

body.sidebar-collapsed .task-layout-wrapper {
  padding-left: var(--sidebar-collapsed-width);
}


/* Workspace Bar (Slack-style) - hidden when collapsed */
.workspace-bar {
  position: fixed;
  top: 52px;
  left: 0;
  bottom: 0;
  width: var(--workspace-bar-width);
  background-color: var(--bg-tertiary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  z-index: 1002;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Dark mode: swap workspace/content colors */
[data-theme="dark"] .workspace-bar {
  background-color: var(--bg-primary);
}

body.sidebar-collapsed .workspace-bar {
  opacity: 0;
  visibility: hidden;
}

.workspace-bar-teams {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.workspace-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-radius 0.15s ease, background-color 0.15s ease;
}

.workspace-icon:hover {
  border-radius: 10px;
  background-color: var(--accent-primary);
  color: white;
}

.workspace-icon.active {
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 0 0 2px var(--bg-tertiary), 0 0 0 4px var(--accent-primary);
}

.workspace-icon svg {
  flex-shrink: 0;
}

.workspace-icon.workspace-add {
  background-color: transparent;
  border: 2px dashed var(--border-color);
  color: var(--text-secondary);
}

.workspace-icon.workspace-add:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
  background-color: transparent;
}

.workspace-bar-bottom {
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.workspace-bar-bottom .account-dropdown-trigger {
  padding: 4px;
  border-radius: 50%;
}

.workspace-bar-bottom .account-dropdown-trigger:hover {
  background-color: var(--bg-secondary);
}

.workspace-bar-bottom .sidebar-profile-name {
  display: none;
}

.workspace-bar-bottom .dropdown-menu {
  left: calc(100% + 8px);
  bottom: 0;
  top: auto;
  right: auto;
  transform-origin: bottom left;
}

/* Left Sidebar Navigation - Fixed, full height */
.task-sidebar-nav {
  position: fixed;
  top: 52px;
  left: var(--workspace-bar-width);
  bottom: 0;
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 16px 12px 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1001;
  transition: width 0.2s ease, left 0.2s ease, padding 0.2s ease;
}

body.sidebar-collapsed .task-sidebar-nav {
  width: var(--sidebar-collapsed-width);
  left: 0;
  padding: 16px 12px 12px;
  overflow: visible;
  background-color: var(--bg-tertiary);
}

/* Disable transitions while resizing for instant feedback */
body.resizing-sidebar .task-sidebar-nav,
body.resizing-sidebar .task-layout-wrapper,
body.resizing-sidebar .sidebar-edge-toggle {
  transition: none;
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 12px;
  margin: 0 -12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header-icon {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-header-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

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

body.sidebar-collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

/* Sidebar Spacer & Collapsed Profile */
.sidebar-spacer {
  flex: 1;
}

.sidebar-profile-collapsed {
  display: none;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
}

.sidebar-profile-collapsed .account-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
}

.sidebar-profile-collapsed .account-dropdown-trigger:hover {
  background-color: var(--bg-tertiary);
}

.sidebar-profile-collapsed .sidebar-profile-name {
  display: none;
}

.sidebar-profile-collapsed .dropdown-menu {
  position: fixed;
  left: calc(var(--sidebar-collapsed-width) + 8px);
  bottom: 12px;
  top: auto;
  right: auto;
  transform-origin: bottom left;
}

body.sidebar-collapsed .sidebar-profile-collapsed .dropdown-menu {
  left: calc(var(--sidebar-collapsed-width) + 8px);
}

/* Edge Toggle Button */
.sidebar-edge-toggle {
  position: fixed;
  top: 50%;
  left: calc(var(--workspace-bar-width) + var(--sidebar-width) - 10px);
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease, left 0.2s ease;
  z-index: 1003;
}

.sidebar-edge-toggle:hover {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.sidebar-edge-toggle .expand-icon {
  display: none;
}

.sidebar-edge-toggle .collapse-icon {
  display: block;
}

/* Show on hover near sidebar edge */
.task-sidebar-nav:hover .sidebar-edge-toggle,
.sidebar-edge-toggle:hover {
  opacity: 1;
}

/* Collapsed state */
body.sidebar-collapsed .sidebar-edge-toggle {
  left: calc(var(--sidebar-collapsed-width) - 10px);
  opacity: 1;
  pointer-events: auto;
}

body.sidebar-collapsed .sidebar-edge-toggle .collapse-icon {
  display: none;
}

body.sidebar-collapsed .sidebar-edge-toggle .expand-icon {
  display: block;
}

/* Sidebar Resize Handle */
.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: -6px;
  bottom: 0;
  width: 12px;
  cursor: col-resize;
  z-index: 1002;
}

.sidebar-resize-handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 5px;
  width: 2px;
  background-color: transparent;
  transition: background-color 0.15s ease;
}

.sidebar-resize-handle:hover .sidebar-resize-handle-line,
.sidebar-resize-handle.resizing .sidebar-resize-handle-line {
  background-color: var(--accent-primary);
}


.task-sidebar-nav .sidebar-section {
  margin-bottom: 4px;
}

.sidebar-team-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 12px 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-team-icon-collapsed {
  display: none;
}

/* Sidebar Theme Toggle */
.sidebar-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 12px;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
}

.sidebar-theme-toggle .toggle-label {
  color: var(--text-secondary);
  font-size: 12px;
}

.task-sidebar-nav .sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding: 0 12px;
}

/* Collapsible Sidebar Sections */
.sidebar-section-chevron {
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.sidebar-section[data-controller="sidebar-section"].collapsed .sidebar-section-chevron {
  transform: rotate(-90deg);
}

.sidebar-section[data-controller="sidebar-section"] .sidebar-title {
  cursor: pointer;
  border-radius: 6px;
  margin-left: -8px;
  margin-right: -8px;
  padding: 6px 16px;
  min-height: 28px;
  justify-content: flex-start;
  gap: 6px;
}

.sidebar-section[data-controller="sidebar-section"] .sidebar-title:hover {
  background-color: var(--bg-tertiary);
}

.sidebar-section[data-controller="sidebar-section"] .sidebar-title .sidebar-add-btn {
  margin-left: auto;
}

.sidebar-section-body {
  max-height: 500px;
  overflow: visible;
  transition: max-height 0.2s ease, opacity 0.2s ease;
  opacity: 1;
}

.sidebar-section.collapsed .sidebar-section-body {
  overflow: hidden;
}

.sidebar-section.collapsed .sidebar-section-body {
  max-height: 0;
  opacity: 0;
}

/* Hide chevrons and disable section collapse when full sidebar is collapsed */
body.sidebar-collapsed .sidebar-section-chevron {
  display: none;
}

body.sidebar-collapsed .sidebar-section[data-controller="sidebar-section"] .sidebar-title {
  cursor: default;
  pointer-events: none;
}

body.sidebar-collapsed .sidebar-section.collapsed .sidebar-section-body {
  max-height: 500px;
  opacity: 1;
  overflow: visible;
}

.sidebar-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  transition: background-color 0.15s;
}

.sidebar-add-btn svg {
  width: 10px;
  height: 10px;
}

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

.task-sidebar-nav .sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.15s;
  text-decoration: none;
  overflow: hidden;
}

.task-sidebar-nav .sidebar-item > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-sidebar-nav .sidebar-item:hover {
  background-color: var(--bg-tertiary);
}

.task-sidebar-nav .sidebar-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.15));
  border-left: 2px solid var(--accent-primary);
  margin-left: -2px;
}

.task-sidebar-nav .sidebar-item:has(.sidebar-badge, .sidebar-unread-dot) > span {
  font-weight: 600;
}

.task-sidebar-nav .sidebar-item svg {
  flex-shrink: 0;
  opacity: 0.7;
  width: 18px;
  height: 18px;
}

.task-sidebar-nav .sidebar-item.active svg {
  opacity: 1;
}


/* Project group title */
.task-sidebar-nav .sidebar-project-title {
  text-transform: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  padding: 6px 12px;
  margin-bottom: 2px;
  gap: 8px;
  justify-content: flex-start;
  text-decoration: none;
  cursor: pointer;
  border-radius: 6px;
}

.task-sidebar-nav a.sidebar-project-title:hover {
  background-color: var(--bg-tertiary);
}

.task-sidebar-nav a.sidebar-project-title.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.15));
  border-left: 2px solid var(--accent-primary);
  margin-left: -2px;
}

.task-sidebar-nav a.sidebar-project-title:has(.sidebar-badge, .sidebar-unread-dot) > span {
  color: var(--text-primary);
  font-weight: 600;
}

/* Tasks nested under project groups */
.task-sidebar-nav .sidebar-section .sidebar-section-body .sidebar-item {
  font-size: 13px;
  padding-left: 28px;
  gap: 6px;
}

/* Status line — vertical bar indicator */
.sidebar-status-dot {
  width: 2px;
  height: 14px;
  border-radius: 1px;
  flex-shrink: 0;
  opacity: 0.65;
}

.sidebar-status-dot-backlog { background: #9ca3af; }
.sidebar-status-dot-active { background: #3b82f6; }
.sidebar-status-dot-in-progress { background: #f59e0b; }
.sidebar-status-dot-in-review { background: #8b5cf6; }
.sidebar-status-dot-done { background: #22c55e; }



.sidebar-notifications {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.sidebar-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-unread-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  margin-right: 6px; /* Align center with badge center */
  flex-shrink: 0;
}

.sidebar-empty {
  padding: 12px;
  font-size: 12px;
  text-align: center;
  opacity: 0.6;
}


.sidebar-channel-hash {
  color: var(--text-secondary);
  font-weight: 500;
}

.sidebar-project-hash {
  color: var(--text-secondary);
  font-weight: 500;
  margin-right: -5px;
}

.project-hash {
  color: var(--text-secondary);
  font-weight: 400;
  margin-right: 4px;
}

.sidebar-task-number {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.sidebar-label-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Main Content Area */
.task-main-content {
  flex: 1;
  padding: 52px 48px 16px;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
  transition: padding-right 0.2s ease;
}

/* Dark mode: content area is lighter */
[data-theme="dark"] .task-main-content {
  background-color: var(--bg-tertiary);
}

[data-theme="dark"] .task-main-content:has(> .empty-state) {
  background-color: transparent;
}

/* Header */
.task-header {
  padding: 20px 48px 18px;
  margin-left: -48px;
  margin-right: -48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  transition: padding-right 0.2s ease, margin-right 0.2s ease;
}

.task-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--border-color);
  transition: right 0.2s ease;
}


/* Content Area - wraps thread and details panel */
.task-content-area {
  flex: 1;
  display: flex;
  position: relative;
  min-height: 0;
  overflow: hidden;
  margin-right: -48px;
  padding-right: 48px;
}

.task-layout-wrapper.open .task-thread {
  margin-right: var(--details-panel-width);
}


.task-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  width: 100%;
}

.task-header-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.task-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.task-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
}

.task-title-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

/* Status dot indicator */
.task-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
  cursor: default;
  box-shadow: 0 0 0 4px var(--bg-tertiary), 0 0 0 5px var(--border-color);
}

.task-status-dot-backlog { background: #9ca3af; box-shadow: 0 0 0 4px rgba(156, 163, 175, 0.15), 0 0 0 5px rgba(156, 163, 175, 0.3); }
.task-status-dot-active { background: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 0 0 5px rgba(59, 130, 246, 0.3); }
.task-status-dot-in-progress { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15), 0 0 0 5px rgba(245, 158, 11, 0.3); }
.task-status-dot-in-review { background: #8b5cf6; box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15), 0 0 0 5px rgba(139, 92, 246, 0.3); }
.task-status-dot-done { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15), 0 0 0 5px rgba(34, 197, 94, 0.3); }

/* Legacy text status (kept for other pages) */
.task-header-status {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.task-header-status-backlog { background: rgba(107, 114, 128, 0.1); color: #9ca3af; }
.task-header-status-active { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.task-header-status-in-progress { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.task-header-status-in-review { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.task-header-status-done { background: rgba(34, 197, 94, 0.15); color: #22c55e; }


.header-assignee {
  display: flex;
  align-items: center;
}

.header-assignee-empty {
  color: var(--text-secondary);
  opacity: 0.5;
}

.task-header-right .badge {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
}

.task-status-assignee {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background-color: var(--bg-secondary);
  border-radius: 6px;
}

.task-id {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text-secondary);
  font-family: 'SF Mono', Monaco, monospace;
}

.task-title {
  font-size: var(--font-lg);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.task-assignee {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-meta-divider {
  width: 1px;
  height: 16px;
  background-color: var(--border-color);
  margin: 0 8px;
}

.task-repo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background-color: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.task-repo:hover {
  background-color: var(--bg-secondary);
}

.task-repo svg {
  color: var(--text-secondary);
}

.task-meta-arrow {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.task-branch-wrapper {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-tertiary);
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.task-branch-wrapper:hover {
  background-color: var(--bg-secondary);
}

.task-branch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  color: var(--text-primary);
  text-decoration: none;
}

.task-branch svg {
  color: var(--text-secondary);
}

.task-branch-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  background: none;
  border: none;
  border-left: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease;
}

.task-branch-copy:hover {
  color: var(--text-primary);
}

.task-branch-copy .check-icon {
  display: none;
}

.task-branch-copy.copied {
  color: var(--accent-green);
}

.task-branch-copy.copied .copy-icon {
  display: none;
}

.task-branch-copy.copied .check-icon {
  display: block;
}

.project-description {
  font-size: 14px;
  color: var(--text-secondary);
}



/* Meta Row */
.task-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-meta-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.meta-text {
  color: var(--text-secondary);
}

/* Assignee in meta row */
.meta-assignee {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.meta-assignee .avatar {
  width: 18px;
  height: 18px;
  font-size: 9px;
}

.meta-assignee-name {
  color: var(--text-secondary);
}

.meta-assignee-empty {
  color: var(--text-muted);
}

.meta-assignee-empty svg {
  opacity: 0.6;
}

/* Status indicator with dot and text */
.meta-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.meta-status-dot {
  width: 2px;
  height: 14px;
  border-radius: 1px;
  flex-shrink: 0;
  background: var(--text-muted);
}

.meta-status-dot-backlog { background: #9ca3af; }
.meta-status-dot-active { background: #3b82f6; }
.meta-status-dot-in-progress { background: #f59e0b; }
.meta-status-dot-in-review { background: #8b5cf6; }
.meta-status-dot-done { background: #22c55e; }

.meta-status-text {
  color: var(--text-secondary);
  font-size: 14px;
}

.meta-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 2px 6px;
  margin: -2px -6px;
  border-radius: 4px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.meta-link:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.meta-project-link {
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 2px 6px;
  margin: -2px -6px;
  border-radius: 4px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.meta-project-link:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.meta-project-none {
  color: var(--text-muted);
  font-size: 14px;
}

.meta-text-muted {
  color: var(--text-muted);
}

/* Follow button in meta row */
.meta-follow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  font-size: 14px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.meta-follow:hover {
  color: var(--text-primary);
}

.meta-follow-active {
  color: var(--accent-primary);
}

.meta-follow-active:hover {
  color: var(--accent-primary);
  opacity: 0.8;
}

/* Icon-only follow button */
.meta-follow-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.meta-follow-icon:hover {
  color: var(--text-secondary);
  background-color: var(--bg-secondary);
  border-color: var(--text-muted);
}

.meta-follow-icon-active {
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

.meta-follow-icon-active:hover {
  color: var(--accent-primary);
  background-color: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
}

/* Icon-only activity toggle button */
.meta-activity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.meta-activity-icon:hover {
  color: var(--text-secondary);
  background-color: var(--bg-secondary);
  border-color: var(--text-muted);
}

.meta-activity-icon.active {
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.meta-activity-icon.active:hover {
  color: var(--accent-green);
  background-color: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
}

/* Header details panel toggle button */
.header-details-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.header-details-icon:hover {
  color: var(--text-secondary);
  background-color: var(--bg-secondary);
  border-color: var(--text-muted);
}

.header-details-icon.active {
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

.header-details-icon.active:hover {
  color: var(--accent-primary);
  background-color: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
}

/* Icon-only linked tasks button */
.meta-linked-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.meta-linked-icon:hover {
  color: var(--text-secondary);
  background-color: var(--bg-secondary);
  border-color: var(--text-muted);
}

.meta-linked-icon.has-links {
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.meta-linked-icon.has-links:hover {
  color: var(--accent-blue);
  background-color: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
}

/* Task actions dropdown */
.task-meta-actions {
  position: relative;
}

.task-actions-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.task-actions-btn:hover,
.task-actions-btn.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.task-actions-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 180px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.15s ease;
  z-index: 100;
}

.task-actions-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-section {
  padding: 4px;
}

.dropdown-section-label {
  padding: 6px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-primary);
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease;
}

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

.dropdown-item svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.meta-status {
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.meta-status-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.meta-status-orange {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.meta-status-purple {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.meta-status-green {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.meta-status-red {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.meta-dot {
  color: var(--text-muted);
}

.meta-dot.faded {
  opacity: 0.4;
}

.meta-status-active {
  color: #3b82f6;
}

.meta-status-in-progress {
  color: #f97316;
}

.meta-status-in-review {
  color: #8b5cf6;
}


.meta-branch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 6px;
  margin: -2px -6px;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.meta-branch:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.meta-branch svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.meta-branch .copy-check {
  display: none;
  color: #22c55e;
}

.meta-branch.copied .branch-name {
  display: none;
}

.meta-branch.copied .copy-check {
  display: block;
}

.activity-toggle-pill {
  display: flex;
  align-items: center;
  background-color: var(--bg-tertiary);
  padding: 3px;
  border-radius: 8px;
}

.activity-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

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

.activity-toggle-btn.active {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Two Column Layout */
.task-columns {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 24px;
}

/* Diff Panel */
.task-diff-panel {
  flex: 1;
  min-width: 320px;
  min-height: 0;
  overflow-y: auto;
}

/* Branch Header */
.diff-branch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 16px;
}

.diff-branch-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diff-branch-compare {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diff-branch-name {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-primary);
}

.diff-branch-base {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  color: var(--text-secondary);
}

.diff-branch-compare svg {
  color: var(--text-secondary);
}

.diff-branch-status {
  display: flex;
  gap: 12px;
  font-size: 12px;
}

.diff-ahead {
  color: #22c55e;
}

.diff-behind {
  color: #f97316;
}

.diff-branch-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Diff Summary */
.diff-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background-color: var(--bg-secondary);
  border-radius: 8px;
}

.diff-stats {
  display: flex;
  gap: 8px;
}

.diff-stat {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  font-weight: 600;
}

.diff-stat-added {
  color: #22c55e;
}

.diff-stat-removed {
  color: #ef4444;
}

/* Diff File */
.diff-file {
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.diff-file-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.diff-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.diff-file-info svg {
  color: var(--text-secondary);
}

.diff-file-name {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  font-weight: 500;
}

.diff-file-stats {
  display: flex;
  gap: 8px;
  font-size: 12px;
}

/* Diff Content */
.diff-content {
  background-color: var(--bg-primary);
  overflow-x: auto;
}

.diff-line {
  display: flex;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  line-height: 1.6;
}

.diff-line-number {
  width: 45px;
  padding: 0 8px;
  text-align: right;
  color: var(--text-secondary);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  user-select: none;
  flex-shrink: 0;
}

.diff-line-code {
  flex: 1;
  padding: 0 12px;
  white-space: pre;
}

.diff-line-context {
  background-color: var(--bg-primary);
}

.diff-line-added {
  background-color: rgba(34, 197, 94, 0.1);
}

.diff-line-added .diff-line-number {
  background-color: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.diff-line-added .diff-line-code::before {
  content: "+";
  color: #22c55e;
  margin-right: 8px;
}

.diff-line-removed {
  background-color: rgba(239, 68, 68, 0.1);
}

.diff-line-removed .diff-line-number {
  background-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.diff-line-removed .diff-line-code::before {
  content: "-";
  color: #ef4444;
  margin-right: 8px;
}

.diff-hunk {
  padding: 8px 12px;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.diff-collapsed {
  padding: 16px;
  text-align: center;
}

.diff-expand-btn {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--accent-primary);
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
}

.diff-expand-btn:hover {
  background-color: var(--bg-tertiary);
}

/* Description Panel (hidden when viewing diff) */
.task-description-panel {
  flex: 1;
  min-width: 320px;
  overflow-y: auto;
  min-height: 0;
}

.task-test-plan-panel {
  flex: 1;
  min-width: 320px;
  overflow-y: auto;
  min-height: 0;
}

.task-test-plan-panel .card {
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  overflow: hidden;
}

.task-test-plan-panel .card-header-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.task-test-plan-panel .card-header-with-icon svg {
  color: var(--accent-green);
}

.task-test-plan-panel .card-header-with-icon h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin: 0;
}

.task-test-plan-panel .test-plan-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 24px;
}

.task-description-panel .card {
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  overflow: hidden;
}

/* Thread Layout - Chat is the main content now */
.task-thread {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.task-thread .task-chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

.task-thread .chat-container {
  display: flex !important;
  flex: 1;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}

/* Chat Wrapper (contains chat panel + details panel) */
.task-chat-wrapper {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 0;
}

.task-chat-wrapper .task-chat-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Details Panel - positioned within content area */
.details-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 10;
}

.details-panel.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* Details Panel Container */
.details-panel-container {
  display: flex;
  flex-direction: column;
  width: 340px;
  min-width: 0;
  height: 100%;
  background-color: var(--bg-primary);
  border-left: 1px solid var(--border-color);
  box-shadow: -1px 0 3px rgba(0, 0, 0, 0.03);
  overflow: visible;
  position: relative;
}

/* Details Panel Resize Handle */
.details-panel-resize-handle {
  position: absolute;
  left: -6px;
  top: 0;
  bottom: 0;
  width: 12px;
  cursor: col-resize;
  z-index: 10;
}

.details-panel-resize-handle-line {
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: transparent;
  border-radius: 1px;
  transition: background-color 0.15s ease;
}

.details-panel-resize-handle:hover .details-panel-resize-handle-line,
.details-panel-resize-handle.resizing .details-panel-resize-handle-line {
  background-color: var(--accent-primary);
}

/* Details Panel Header */
.details-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.details-panel-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.details-panel-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.details-panel-close-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

/* Details Panel Body */
.details-panel-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Sections */
.details-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.details-section:last-child {
  border-bottom: none;
}

.details-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-bottom: 10px;
}

.details-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.details-section-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
}

.details-section-body {
  transition: max-height 0.2s ease, padding 0.2s ease, opacity 0.2s ease;
  opacity: 1;
}

.details-section.collapsed .details-section-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  overflow: hidden;
}

.details-section-empty {
  font-size: 13px;
  color: var(--text-muted);
}

.details-section-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.details-section-meta .meta-dot {
  color: var(--text-muted);
}

/* References List */
.details-references-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.details-reference-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}

.details-reference-card:hover {
  border-color: var(--accent-primary);
}

.details-reference-card-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.details-reference-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.details-reference-number {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: 'SF Mono', Monaco, monospace;
  flex-shrink: 0;
}

.details-reference-meta-text {
  font-size: 11px;
  color: var(--text-secondary);
}

.details-reference-dot {
  font-size: 11px;
  color: var(--text-muted);
}

.details-reference-card-meta .meta-status-indicator {
  margin-left: 0;
}

.details-reference-card-meta .meta-status-text {
  font-size: 12px;
}

.details-reference-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* History List */
.details-history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.details-history-item {
  padding: 10px 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.details-history-item + .details-history-item {
  border-top: 1px solid rgba(128, 128, 128, 0.08);
}

.details-history-dot {
  color: var(--text-muted);
  opacity: 0.4;
  flex-shrink: 0;
}

.details-history-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.details-history-time {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
  white-space: nowrap;
  flex-shrink: 0;
}

.details-history-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.details-history-show-more {
  display: inline;
  background: none;
  border: none;
  padding: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.details-history-show-more:hover {
  color: var(--text-secondary);
}

.task-thread .chat-header {
  background: transparent;
  border-radius: 0;
  padding: 0 0 16px 0;
}

.task-thread .chat-messages {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}


.task-thread .chat-typing {
  background: transparent;
  border-top: none;
  padding: 8px 0;
}

.task-thread .chat-input {
  flex-shrink: 0;
  background-color: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px 2px;
  margin-top: 0;
  margin-bottom: 24px;
}

.task-thread .typing-indicator {
  margin-top: 10px;
  margin-bottom: 10px;
  padding-left: 16px;
}

[data-theme="dark"] .task-thread .chat-input {
  background-color: var(--bg-tertiary);
}

.task-thread .chat-input-hint {
  margin-top: 2px;
  text-align: right;
}

/* Pinned Description */




.task-description-panel h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 20px 24px;
  margin: 0;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.task-description-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.task-description-body p {
  margin-bottom: 12px;
}

.task-description-body h4 {
  font-size: 14px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.task-description-body ul,
.task-description-body ol {
  margin-bottom: 12px;
  padding-left: 20px;
}

.task-description-body li {
  margin-bottom: 6px;
}

.task-description-body .code-block {
  margin-top: 16px;
}

/* Test Plan Section */
.task-description-panel .card-test-plan {
  margin-top: 16px;
  padding: 0;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.04), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 10px;
  overflow: hidden;
}

.card-header-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header-with-icon svg {
  color: var(--accent-green);
  flex-shrink: 0;
  transform: translateY(1px);
}

.card-header-with-icon h3 {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.test-plan-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.test-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.test-item:hover {
  background: rgba(16, 185, 129, 0.08);
}

.test-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent-green);
  cursor: pointer;
}

.test-item span {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}

.test-item:has(.test-checkbox:checked) span {
  color: var(--text-secondary);
  text-decoration: line-through;
}

/* Collapsible Cards */
.card-collapsible {
  overflow: hidden;
}

.card-collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px 24px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.card-collapse-header:hover {
  background-color: var(--bg-tertiary);
}

.card-collapse-header h3 {
  margin: 0;
  padding: 0;
  border: none;
}

.collapse-chevron {
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.card-collapsible.collapsed .collapse-chevron {
  transform: rotate(-90deg);
}

.card-collapse-body {
  transition: max-height 0.2s ease, opacity 0.2s ease, padding 0.2s ease;
}

.card-collapsible.collapsed .card-collapse-body {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.card-collapsible.collapsed .card-collapse-header {
  border-bottom: none;
}

/* Test plan header adjustments when collapsible */
.card-test-plan .card-collapse-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(16, 185, 129, 0.15);
}

.card-test-plan .card-collapse-header:hover {
  background: rgba(16, 185, 129, 0.08);
}

.card-test-plan .card-collapse-header h3 {
  flex: 1;
}

.card-test-plan .card-collapse-body {
  padding: 16px 20px;
}

.card-test-plan.collapsed .card-collapse-header {
  border-bottom: none;
}

.chat-container {
  position: relative;
  background-color: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  flex-shrink: 0;
  border-radius: 8px 8px 0 0;
}

.chat-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}


.chat-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.header-participants {
  display: flex;
  align-items: center;
}

.header-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-assignee .avatar {
  width: 20px;
  height: 20px;
  font-size: 8px;
}

/* Icon-style assignee in header right */
.header-assignee-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.header-assignee-icon .avatar {
  width: 18px;
  height: 18px;
  font-size: 7px;
}

.header-assignee-empty {
  color: var(--text-muted);
}

.header-assignee-empty:hover {
  color: var(--text-secondary);
}

.header-participants .avatar {
  width: 24px;
  height: 24px;
  font-size: 9px;
  margin-left: -6px;
  border: 2px solid var(--bg-primary);
}

.header-participants .avatar:first-child {
  margin-left: 0;
}

.header-participants-more {
  font-size: 11px;
  color: var(--text-secondary);
  margin-left: 6px;
  font-weight: 500;
}

.header-participants-right {
  margin-left: auto;
}

.chat-collapse-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.presence-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

/* Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Individual Message */
.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 5px 12px;
  margin-left: -12px;
  margin-right: -12px;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.chat-message:hover {
  background-color: var(--bg-secondary);
}

.chat-message-grouped {
  padding-top: 0;
  padding-bottom: 4px;
  padding-left: 57px;
}

.chat-system-message {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.chat-system-time {
  color: var(--text-muted);
  opacity: 0.7;
}

.chat-reference svg {
  flex-shrink: 0;
  opacity: 0.5;
}

.chat-reference a {
  color: var(--accent-primary);
  text-decoration: none;
}

.chat-reference a:hover {
  text-decoration: underline;
}

.chat-system-message::before,
.chat-system-message::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-primary);
  max-width: 60px;
}

.chat-message-content {
  flex: 1;
  min-width: 0;
}

.chat-message-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.chat-message-author {
  font-weight: 600;
  font-size: 14px;
}

.chat-message-badge {
  font-size: 9px;
  font-weight: 500;
  padding: 2px 5px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.chat-message-time {
  font-size: 11px;
  color: var(--text-secondary);
}

.chat-message-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}

.chat-message-body-muted {
  color: var(--text-muted);
}

/* System Activity Messages */
.chat-system-message {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-left: -12px;
  margin-right: -12px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.chat-system-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.chat-system-icon svg {
  width: 10px;
  height: 10px;
}

.chat-system-text {
  color: var(--text-secondary);
}

.chat-system-text strong {
  color: var(--text-primary);
  font-weight: 500;
}

.chat-system-time {
  color: var(--text-muted);
  font-size: 11px;
}

.chat-intro-banner {
  padding: 24px 20px 8px;
}

.chat-intro-banner h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.chat-intro-banner p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.chat-thread-start {
  padding: 24px 0 16px;
}

.chat-thread-start h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.chat-thread-start p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.chat-date-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  position: relative;
}

.chat-date-separator::before,
.chat-date-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border-color);
}

.chat-date-separator span {
  padding: 0 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-message-body p {
  margin-bottom: 6px;
}

.chat-message-body p:last-child {
  margin-bottom: 0;
}

.chat-message-body ol,
.chat-message-body ul {
  margin: 6px 0;
  padding-left: 18px;
}

.chat-message-body li {
  margin-bottom: 2px;
}

/* Rich text styling */
.chat-message-body strong {
  font-weight: 600;
}

.chat-message-body em {
  font-style: italic;
}

.chat-message-body code {
  padding: 2px 7px;
  background-color: var(--bg-tertiary);
  border-radius: 5px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  color: var(--accent-secondary);
}

[data-theme="dark"] .chat-message-body code {
  background-color: #3e3e4a;
  color: #8f9bef;
}

.chat-message-body pre {
  background-color: var(--bg-tertiary);
  padding: 8px 12px;
  border-radius: 6px;
  margin: 4px 0;
  overflow-x: auto;
}

[data-theme="dark"] .chat-message-body pre {
  background-color: #3e3e4a;
}

.chat-message-body pre code {
  padding: 0;
  background: none;
  color: var(--text-primary);
}

.chat-message-body blockquote {
  border-left: 3px solid var(--accent-primary);
  padding-left: 1em;
  margin: 4px 0;
  color: var(--text-secondary);
}

.chat-message-body a {
  color: var(--accent-primary);
  text-decoration: none;
}

.chat-message-body a:hover {
  text-decoration: underline;
}

.chat-code-block {
  display: block;
  margin: 8px 0;
  padding: 10px 12px;
  background-color: var(--bg-tertiary);
  border-radius: 6px;
  overflow-x: auto;
}

.chat-code-block code {
  padding: 0;
  background: none;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  color: var(--text-primary);
}

.chat-message .reactions-bar {
  margin-top: 6px;
}

.chat-message .reaction {
  padding: 2px 6px;
  font-size: 11px;
}

/* Typing Indicator - Pinned above input */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.chat-typing .typing-indicator {
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
}

.chat-typing .typing-dots {
  transform: scale(0.8);
}

/* Unread Divider */
.chat-messages .unread-divider {
  margin: 4px 0;
  font-size: 11px;
  padding: 4px 0;
}

/* Chat Input */
.chat-input {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  border-radius: 0 0 8px 8px;
}


.toolbar-divider {
  width: 1px;
  height: 16px;
  background-color: var(--border-color);
  margin: 0 4px;
}

.chat-input textarea {
  width: 100%;
  resize: none;
  font-size: 14px;
  min-height: 40px;
  padding-right: 48px;
  box-sizing: border-box;
}

.chat-tiptap-editor {
  width: 100%;
  min-height: 40px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 48px 8px 0;
  background-color: transparent;
  font-size: 14px;
  line-height: 1.5;
  cursor: text;
  display: flex;
  align-items: center;
}

.chat-tiptap-editor:focus-within {
  outline: none;
}

.chat-tiptap-editor .ProseMirror {
  outline: none;
  min-height: 20px;
  width: 100%;
}

.chat-tiptap-editor .ProseMirror p {
  margin: 0;
}

.chat-tiptap-editor .ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: var(--text-secondary);
  pointer-events: none;
  height: 0;
}

.chat-tiptap-editor .ProseMirror code {
  padding: 2px 7px;
  background-color: var(--bg-tertiary);
  border-radius: 5px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  color: var(--accent-secondary);
}

[data-theme="dark"] .chat-tiptap-editor .ProseMirror code {
  background-color: #3e3e4a;
  color: #8f9bef;
}

.chat-tiptap-editor .ProseMirror pre {
  background-color: var(--bg-tertiary);
  padding: 8px 12px;
  border-radius: 6px;
  margin: 4px 0;
  overflow-x: auto;
}

[data-theme="dark"] .chat-tiptap-editor .ProseMirror pre {
  background-color: #3e3e4a;
}

.chat-tiptap-editor .ProseMirror pre code {
  padding: 0;
  background: none;
  color: var(--text-primary);
}

.chat-tiptap-editor .ProseMirror blockquote {
  border-left: 3px solid var(--accent-primary);
  padding-left: 1em;
  margin: 4px 0;
  color: var(--text-secondary);
}

.chat-tiptap-editor .ProseMirror ul,
.chat-tiptap-editor .ProseMirror ol {
  padding-left: 1.5em;
  margin: 4px 0;
}

.chat-tiptap-editor .ProseMirror a {
  color: var(--accent-primary);
  text-decoration: none;
}

.chat-tiptap-editor .ProseMirror a:hover {
  text-decoration: underline;
}

.chat-input-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  margin: -12px -16px 8px -16px;
  background-color: var(--bg-secondary);
  border-radius: 12px 12px 0 0;
}

.chat-input-wrapper {
  position: relative;
}

.mention-popup-command-name {
  font-size: 13px;
  color: var(--text-primary);
  min-width: 80px;
}

.mention-popup-command-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.chat-input-hint {
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 12px 12px;
  text-align: left;
  opacity: 0.5;
}

.chat-input-hint kbd {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 11px;
}

.activity-toggle {
  border: none;
  background: none;
  padding: 0;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.6;
  white-space: nowrap;
}

.activity-toggle:hover {
  opacity: 1;
  text-decoration: underline;
}

.chat-send-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
}

.chat-send-btn svg {
  width: 16px;
  height: 16px;
}

.toolbar-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-btn svg {
  width: 14px;
  height: 14px;
}

/* Collapsed Sidebar State */
body.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: 12px;
  margin-bottom: 12px;
}

body.sidebar-collapsed .sidebar-header-icon {
  display: flex;
}

body.sidebar-collapsed .sidebar-header-name {
  display: none;
}

body.sidebar-collapsed .sidebar-collapse-btn {
  display: none;
}

body.sidebar-collapsed .sidebar-profile-collapsed {
  display: flex;
  justify-content: center;
}

body.sidebar-collapsed .sidebar-resize-handle {
  display: none;
}

body.sidebar-collapsed .sidebar-team-name {
  display: none;
}

body.sidebar-collapsed .sidebar-team-icon-collapsed {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

body.sidebar-collapsed .sidebar-team-icon-collapsed span {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.sidebar-collapsed .sidebar-section {
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

body.sidebar-collapsed .sidebar-title {
  display: none;
}

body.sidebar-collapsed .sidebar-project-title {
  display: flex;
  justify-content: center;
  padding: 10px 0;
  pointer-events: auto;
  cursor: pointer;
  position: relative;
}

body.sidebar-collapsed .sidebar-project-title > span:not(.sidebar-project-hash):not(.sidebar-notifications) {
  display: none;
}

body.sidebar-collapsed .sidebar-project-hash {
  font-size: 18px;
  font-weight: 400;
}

body.sidebar-collapsed .sidebar-project-title .sidebar-notifications {
  display: contents;
}

body.sidebar-collapsed .sidebar-project-title .sidebar-badge {
  position: absolute;
  top: 4px;
  right: 4px;
}

body.sidebar-collapsed .sidebar-project-title .sidebar-unread-dot {
  position: absolute;
  top: 6px;
  right: 6px;
}

body.sidebar-collapsed .sidebar-add-btn {
  display: none;
}

body.sidebar-collapsed .sidebar-item {
  justify-content: center;
  padding: 10px 0 !important;
  position: relative;
}

body.sidebar-collapsed .sidebar-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.5;
}

body.sidebar-collapsed .sidebar-item > span:not(.sidebar-badge):not(.sidebar-task-icon):not(.sidebar-unread-dot):not(.sidebar-notifications) {
  display: none;
}

body.sidebar-collapsed .sidebar-item[class*="sidebar-item-"] {
  padding: 10px 0;
}

/* Task icon/number toggle for collapsed state */
.sidebar-task-icon {
  display: none;
}

body.sidebar-collapsed .sidebar-task-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.sidebar-collapsed .sidebar-item .kanban-column-status-dot {
  display: none;
}

body.sidebar-collapsed .sidebar-item:has(.sidebar-badge, .sidebar-unread-dot) svg {
  opacity: 1;
  color: var(--text-primary);
}

body.sidebar-collapsed .sidebar-notifications {
  display: contents;
}

body.sidebar-collapsed .sidebar-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  margin-left: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 11px;
}

body.sidebar-collapsed .sidebar-unread-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  margin-left: 0;
}

body.sidebar-collapsed .sidebar-empty {
  display: none;
}

/* Tooltip on hover when collapsed */
body.sidebar-collapsed .sidebar-item::before {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 1100;
  pointer-events: none;
}

body.sidebar-collapsed .sidebar-item:hover::before {
  opacity: 1;
  visibility: visible;
}

body.sidebar-collapsed .sidebar-project-title::before {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 1100;
  pointer-events: none;
}

body.sidebar-collapsed .sidebar-project-title:hover::before {
  opacity: 1;
  visibility: visible;
}

/* ========================================
   DIFF VIEW WITH CHAT RAIL
   ======================================== */

/* Wrapper for diff + chat side by side */
.task-diff-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 16px;
  overflow: hidden;
}

.task-diff-wrapper .task-diff-panel {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

/* Chat Panel Container (contains rail + expanded panel) */
.diff-chat-panel {
  position: relative;
  display: flex;
  flex-shrink: 0;
  overflow: hidden;
}

/* Collapsed Rail */
.diff-chat-rail {
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  gap: 16px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.diff-chat-rail:hover {
  background-color: var(--bg-tertiary);
}

.diff-chat-rail:hover .diff-chat-rail-icon {
  color: var(--accent-primary);
}

.diff-chat-rail:hover .diff-chat-rail-expand {
  color: var(--accent-primary);
}

.diff-chat-rail-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  width: 100%;
  color: var(--text-secondary);
}

.diff-chat-rail-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diff-chat-rail-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diff-chat-rail-label {
  display: none;
}

.diff-chat-rail-count {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.3;
}

.diff-chat-rail-avatars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diff-chat-rail-expand {
  margin-top: auto;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

/* Resize Handle */
.diff-chat-resize-handle {
  display: none;
  width: 16px;
  cursor: col-resize;
  position: relative;
  flex-shrink: 0;
}

.diff-chat-resize-handle-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--border-color);
  transform: translateX(-50%);
  border-radius: 1px;
  transition: background-color 0.15s ease;
}

.diff-chat-resize-handle-line::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 24px;
  background-image: radial-gradient(circle, var(--text-secondary) 1px, transparent 1px);
  background-size: 2px 6px;
  background-position: center;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.diff-chat-resize-handle:hover .diff-chat-resize-handle-line,
.diff-chat-resize-handle.resizing .diff-chat-resize-handle-line {
  background-color: var(--accent-primary);
}

.diff-chat-resize-handle:hover .diff-chat-resize-handle-line::before,
.diff-chat-resize-handle.resizing .diff-chat-resize-handle-line::before {
  opacity: 0;
}

/* Expanded Chat Container */
.diff-chat-container {
  display: none;
  flex-direction: column;
  width: 480px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

/* Open State */
.task-diff-wrapper.open .diff-chat-rail {
  display: none;
}

.task-diff-wrapper.open .diff-chat-container {
  display: flex;
}

.task-diff-wrapper.open .diff-chat-resize-handle {
  display: block;
}

.task-diff-wrapper.open .diff-chat-panel {
  cursor: default;
}

/* Chat Header */
.diff-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  border-radius: 8px 8px 0 0;
  flex-shrink: 0;
}

.diff-chat-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.diff-chat-header .collapse-chevron {
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.diff-chat-header:hover .collapse-chevron {
  color: var(--text-primary);
}

/* Chat Messages */
.diff-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Message Styles */
.diff-chat-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin-left: -12px;
  margin-right: -12px;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.diff-chat-message:hover {
  background-color: var(--bg-tertiary);
}

.diff-chat-message-content {
  flex: 1;
  min-width: 0;
}

.diff-chat-message-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.diff-chat-message-author {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.diff-chat-message-time {
  font-size: 11px;
  color: var(--text-secondary);
}

.diff-chat-message-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}

.diff-chat-message-body p {
  margin: 0 0 6px;
}

.diff-chat-message-body p:last-child {
  margin-bottom: 0;
}

/* System Messages */
.diff-chat-system-message {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-left: -12px;
  margin-right: -12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.diff-chat-system-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.diff-chat-system-icon svg {
  width: 10px;
  height: 10px;
}

.diff-chat-system-text {
  color: var(--text-secondary);
}

.diff-chat-system-text strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* Chat Input */
.diff-chat-input {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  border-radius: 0 0 8px 8px;
  flex-shrink: 0;
}

.diff-chat-input-wrapper {
  position: relative;
}

.diff-chat-tiptap-editor {
  width: 100%;
  min-height: 36px;
  max-height: 120px;
  overflow-y: auto;
  padding: 8px 40px 8px 12px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.diff-chat-tiptap-editor:focus-within {
  outline: none;
  border-color: var(--accent-primary);
}

.diff-chat-tiptap-editor .ProseMirror {
  outline: none;
  min-height: 20px;
}

.diff-chat-tiptap-editor .ProseMirror p {
  margin: 0;
}

.diff-chat-tiptap-editor .ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: var(--text-muted);
  pointer-events: none;
  height: 0;
}

.diff-chat-send-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
}

/* Disable body resizing cursor during panel resize */
body.resizing-panel {
  cursor: col-resize;
  user-select: none;
}

body.resizing-panel * {
  cursor: col-resize !important;
}

body.resizing-panel .task-main-content,
body.resizing-panel .task-content-area {
  transition: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .task-layout-wrapper {
    flex-direction: column;
    padding-left: 0;
  }

  .workspace-bar {
    display: none;
  }

  .task-sidebar-nav {
    position: relative;
    top: auto;
    left: auto;
    bottom: auto;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 12px;
  }

  .sidebar-header {
    margin: 0 -12px 12px;
    padding: 12px;
  }

  .task-main-content {
    padding: 20px;
  }

  /* Hide chat rail on mobile, show only expanded */
  .diff-chat-rail {
    display: none;
  }

  .diff-chat-container {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50vh;
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-color);
  }
}

/* ========================================
   Mentions
   ======================================== */

/* Mention in editor */
.mention {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border-radius: 4px;
  padding: 1px 4px;
  font-weight: 500;
}

/* Mention popup */
.mention-popup {
  position: fixed;
  z-index: 1000;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  max-width: 280px;
  overflow: hidden;
  display: none;
}

.mention-popup-empty {
  padding: 12px 16px;
  color: var(--text-secondary);
  font-size: 12px;
}

.mention-popup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  color: var(--text-primary);
}

.mention-popup-item:hover,
.mention-popup-item.selected {
  background: var(--bg-secondary);
}

.mention-popup-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mention-popup-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-popup-task-number {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  flex-shrink: 0;
}

.mention-task {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  text-decoration: none;
  cursor: pointer;
}

.mention-task:hover {
  background: rgba(59, 130, 246, 0.25);
}

/* Task hover preview */
.task-preview {
  position: fixed;
  z-index: 1100;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 12px 14px;
  width: 280px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
  pointer-events: auto;
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
}

.task-preview:hover {
  border-color: var(--accent-primary);
}

.task-preview.show {
  opacity: 1;
  transform: translateY(0);
}

.task-preview-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.task-preview-number {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.task-preview-status {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.task-preview-status-active { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.task-preview-status-in-progress { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.task-preview-status-in-review { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.task-preview-status-done { background: rgba(34, 197, 94, 0.15); color: #22c55e; }

.task-preview-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-preview-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.task-preview-meta-text {
  font-size: 11px;
  color: var(--text-secondary);
}

.task-preview-dot {
  font-size: 11px;
  color: var(--text-muted);
}

.task-preview-meta .meta-status-indicator {
  margin-left: 0;
}

.task-preview-meta .meta-status-text {
  font-size: 12px;
}
