/* ============================================
   Layer - Component Styles
   ============================================ */

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background-color: var(--border);
  color: #ffffff62;
}

.btn-primary:hover {
  background-color: var(--muted-foreground);
  color: #ffffff;
}

.btn-secondary {
  background-color: var(--muted);
  color: var(--muted-foreground);
}

.btn-secondary:hover {
  background-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
}

.btn-ghost:hover {
  background-color: var(--accent);
  color: var(--foreground);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* ============================================
   Filter Tabs
   ============================================ */
.filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.filter-tabs::-webkit-scrollbar {
  height: 4px;
}

.filter-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.filter-tabs::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 2px;
}

.filter-tabs::-webkit-scrollbar-thumb:hover {
  background-color: var(--muted-foreground);
}

.filter-tab {
  padding: 6px 12px;
  border: none;
  background-color: var(--surface-hover);
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.filter-tab:hover {
  color: var(--foreground);
}

.filter-tab.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
}

.card-hover:hover {
  border-color: hsla(239, 84%, 67%, 0.3);
}

/* ============================================
   Tables
   ============================================ */
.table-header {
  display: grid;
  gap: 16px;
  padding: 12px 20px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.table-row {
  display: grid;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s;
  cursor: pointer;
  align-items: center;
}

.table-row:last-child {
  border-bottom: none;
}

.table-row:hover {
  background-color: var(--surface-hover);
}

.issues-grid {
  grid-template-columns: auto 3fr auto auto auto;
}

/* ============================================
   Badges
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.badge-sm {
  padding: 2px 8px;
  font-size: 11px;
}

.badge-todo {
  background-color: hsla(215, 16%, 47%, 0.15);
  color: var(--status-todo);
}

.badge-in-progress {
  background-color: hsla(217, 91%, 60%, 0.15);
  color: var(--status-in-progress);
}

.badge-review {
  background-color: hsla(271, 91%, 65%, 0.15);
  color: var(--status-review);
}

.badge-done {
  background-color: hsla(142, 71%, 45%, 0.15);
  color: var(--status-done);
}

.badge-backlog {
  background-color: hsla(215, 14%, 45%, 0.15);
  color: var(--status-backlog);
}

.badge-priority-high {
  background-color: hsla(0, 84%, 60%, 0.15);
  color: var(--priority-high);
  border: 1px solid hsla(0, 84%, 60%, 0.3);
  border-radius: 4px;
}

.badge-priority-medium {
  background-color: hsla(48, 96%, 53%, 0.15);
  color: var(--priority-medium);
  border: 1px solid hsla(48, 96%, 53%, 0.3);
  border-radius: 4px;
}

.badge-priority-low {
  background-color: hsla(142, 71%, 45%, 0.15);
  color: var(--priority-low);
  border: 1px solid hsla(142, 71%, 45%, 0.3);
  border-radius: 4px;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--destructive);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--foreground);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--muted-foreground);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px hsla(239, 84%, 67%, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  min-height: 400px;
}

.empty-state-icon {
  font-size: 60px;
  opacity: 0.25;
  margin-bottom: 20px;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  color: var(--muted-foreground);
  margin-bottom: 24px;
  max-width: 320px;
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-bar {
  width: 100%;
  height: 6px;
  background-color: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.progress-bar-sm {
  height: 4px;
}

/* ============================================
   Checkbox
   ============================================ */
.checkbox-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--muted-foreground);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.checkbox-container:hover .checkbox-custom {
  border-color: hsla(239, 84%, 67%, 0.5);
}

.checkbox-container input:checked+.checkbox-custom {
  background-color: var(--primary);
  border-color: var(--primary);
}

.checkbox-custom .check-icon {
  display: none;
  width: 12px;
  height: 12px;
  color: var(--primary-foreground);
}

.checkbox-container input:checked+.checkbox-custom .check-icon {
  display: block;
}

/* ============================================
   View Headers
   ============================================ */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;

  flex-wrap: wrap;
  gap: 12px;
}

.view-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--foreground);
}

/* ============================================
   Backlog View
   ============================================ */
.backlog-container {
  padding: 24px;
}

.backlog-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.backlog-progress-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.backlog-progress-text {
  font-size: 14px;
  color: var(--muted-foreground);
}

.backlog-progress-bar {
  width: 220px;
}

.backlog-tasks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.backlog-task {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.15s;
}

.backlog-task.done {
  opacity: 0.6;
}

.backlog-task-title {
  flex: 1;
  font-size: 14px;
  color: var(--foreground);
  outline: none;
  min-height: 24px;
  line-height: 1.5;
}

.backlog-task.done .backlog-task-title {
  text-decoration: line-through;
}

.backlog-task-delete {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--muted-foreground);
  opacity: 0.5;
  transition: all 0.15s;
}

.backlog-task:hover .backlog-task-delete {
  opacity: 1;
}

.backlog-task-delete:hover {
  color: var(--destructive);
}

.quick-add {
  margin-top: 24px;
  padding: 14px 16px;
  background-color: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.quick-add input {
  width: 100%;
  background: transparent;
  border: none;
  font-size: 14px;
  color: var(--foreground);
  outline: none;
}

.quick-add input::placeholder {
  color: var(--muted-foreground);
}

/* ============================================
   Activity / Projects View
   ============================================ */
.projects-container {
  padding: 20px;
}

.project-card {
  padding: 20px;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.project-card:hover {
  border-color: hsla(239, 84%, 67%, 0.3);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.project-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--foreground);
  transition: color 0.15s;
}

.project-card:hover .project-card-title {
  color: var(--primary);
}

.project-card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-delete-btn {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--muted-foreground);
  opacity: 0;
  transition: all 0.15s;
}

.project-card:hover .project-delete-btn {
  opacity: 1;
}

.project-delete-btn:hover {
  color: var(--destructive);
}

.project-description {
  font-size: 14px;
  color: var(--muted-foreground);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-progress {
  margin-bottom: 16px;
}

.project-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.project-progress-label {
  font-size: 14px;
  color: var(--muted-foreground);
}

.project-progress-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.project-progress-stats {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 6px;
}

.project-meta {
  font-size: 12px;
  color: var(--muted-foreground);
}

/* ============================================
   Project Detail View
   ============================================ */
.project-detail {
  display: flex;
  height: 100%;
}

.project-detail-main {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
}

.project-detail-header {
  display: flex;
  gap: 24px;
  margin-bottom: 40px;
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.back-btn:hover {
  background-color: var(--accent);
  color: var(--foreground);
}

.project-detail-info {
  flex: 1;
}

.project-detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.project-detail-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--foreground);
  outline: none;
  margin-bottom: 8px;
}

.project-detail-badges {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.project-detail-delete {
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--muted-foreground);
  transition: color 0.15s;
}

.project-detail-delete:hover {
  color: var(--destructive);
}

.project-update-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 32px;
}

.project-update-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background-color: hsla(142, 71%, 45%, 0.15);
  color: var(--status-done);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.project-update-meta {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-bottom: 4px;
}

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

.project-description-section {
  margin-bottom: 32px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 8px;
}

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

/* Kanban Board */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  margin-bottom: 32px;
}

.kanban-column {
  flex-shrink: 0;
  width: 280px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

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

.kanban-column-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  outline: none;
  min-width: 60px;
}

.kanban-column-count {
  font-size: 12px;
  color: var(--muted-foreground);
}

.kanban-column-delete {
  opacity: 0;
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--muted-foreground);
  transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
  border-radius: 4px;
  pointer-events: none;
}

.kanban-column-header:hover .kanban-column-delete {
  opacity: 1;
  pointer-events: auto;
}

.kanban-column-delete:hover {
  color: var(--destructive);
  background-color: rgba(239, 68, 68, 0.1);
}

.kanban-tasks {
  padding: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.kanban-task {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  transition: all 0.15s;
}

.kanban-task:hover {
  border-color: hsla(239, 84%, 67%, 0.3);
}

.kanban-task.done {
  opacity: 0.6;
}

/* Task Completer Avatar */
.task-completer-avatar {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 10px;
  font-weight: 600;
  overflow: hidden;
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2), 0 2px 8px rgba(99, 102, 241, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: completerAvatarIn 0.3s ease;
}

.task-completer-avatar:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4), 0 4px 12px rgba(99, 102, 241, 0.25);
}

@keyframes completerAvatarIn {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.kanban-task-title {
  flex: 1;
  font-size: 13px;
  color: var(--foreground);
}

.kanban-task.done .kanban-task-title {
  text-decoration: line-through;
}

.kanban-task-delete {
  background: transparent;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--muted-foreground);
  opacity: 0;
  transition: all 0.15s;
}

.kanban-task:hover .kanban-task-delete {
  opacity: 1;
}

.kanban-task-delete:hover {
  color: var(--destructive);
}

.kanban-add-task {
  padding: 8px;
}

.kanban-add-input {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  color: var(--foreground);
  outline: none;
  transition: border-color 0.15s;
}

.kanban-add-input::placeholder {
  color: var(--muted-foreground);
}

.kanban-add-input:focus {
  border-color: var(--border);
}

/* Project Detail Sidebar */
.project-detail-sidebar {
  width: 260px;
  background-color: var(--surface);
  border-left: 1px solid var(--border);
  padding: 24px;
  overflow-y: auto;
}

.project-sidebar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 24px;
}

.progress-circle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}

.progress-circle {
  position: relative;
  width: 140px;
  height: 140px;
}

.progress-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-circle-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.progress-circle-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.7s ease;
}

.progress-circle-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--foreground);
}

.progress-circle-label {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 8px;
}

.properties-list {
  display: flex;
  flex-direction: column;
}

.property-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.property-item:last-child {
  border-bottom: none;
}

.property-label {
  font-size: 12px;
  color: var(--muted-foreground);
}

.property-value {
  font-size: 12px;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 6px;
}

.property-link {
  color: var(--foreground);
  cursor: pointer;
}

.property-link:hover {
  text-decoration: underline;
}

/* ============================================
   Inbox View
   ============================================ */
.inbox-container {
  padding: 24px;
}


/* ============================================
   Team View - ClickUp-Inspired Chat & Collaboration
   ============================================ */
.team-container {
  padding: 24px;
}

 /* Team Chat Layout - Glassmorphism Floating Container */
 .team-chat-layout {
  display: flex;
  height: 100vh;
  padding: var(--sidebar-inset);
  background: transparent;
  gap: 0;
 }

 .team-chat-inner {
  flex: 1;
  display: flex;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  animation: containerFadeIn 0.4s ease-out;
 }

 .team-chat-sidebar {
  width: 260px;
  min-width: 260px;
  background: rgba(255, 255, 255, 0.02);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
 }

 .team-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  border-left: 1px solid var(--glass-border);
  overflow: hidden;
 }

 .team-members-panel {
  width: 300px;
  min-width: 300px;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  border-left: 1px solid var(--glass-border);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: none;
  transition: all 0.3s ease;
 }

.team-members-panel.collapsed {
  width: 0;
  min-width: 0;
  opacity: 0;
  border: none;
  pointer-events: none;
}

.team-chat-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  height: 57px;
}

.team-chat-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.team-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.team-icon-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

.team-icon-btn:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.team-icon-btn svg {
  width: 16px;
  height: 16px;
}

.team-icon-btn-sm {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--muted-foreground);
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s ease;
}

.team-icon-btn-sm svg {
  width: 12px;
  height: 12px;
}

.team-chat-section-divider:hover .team-icon-btn-sm {
  opacity: 1;
}

.team-icon-btn-sm:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

/* Create Dropdown */
.team-create-dropdown-wrapper {
  position: relative;
}

.team-create-btn {
  display: flex;
  align-items: center;
  gap: 2px;
}

.dropdown-chevron-sm {
  width: 10px;
  height: 10px;
}

.team-create-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 240px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  padding: 6px;
  z-index: 100;
  display: none;
}

.team-create-dropdown.show {
  display: block;
}

.team-create-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--foreground);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.team-create-item:hover {
  background: var(--surface-hover);
}

.team-create-item svg {
  width: 18px;
  height: 18px;
  color: var(--muted-foreground);
  flex-shrink: 0;
  margin-top: 2px;
}

.team-create-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.create-item-title {
  font-size: 14px;
  font-weight: 500;
}

.create-item-desc {
  font-size: 12px;
  color: var(--muted-foreground);
}

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

.team-chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted-foreground);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  margin-bottom: 2px;
}

.team-chat-item:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.team-chat-item.active {
  background: var(--accent);
  color: var(--accent-foreground);
}

.team-chat-item-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--muted-foreground);
}

.team-chat-item-icon.megaphone {
  color: hsl(271 91% 65%);
}

.team-chat-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-chat-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background: hsl(271 91% 65%);
  color: white;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Section Divider */
.team-chat-section-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Direct Message Avatar */
.team-dm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
  position: relative;
  flex-shrink: 0;
}

.team-dm-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--muted-foreground);
}

.team-dm-avatar.online .team-dm-status-dot {
  background: hsl(142 71% 45%);
}

.team-dm-avatar.away .team-dm-status-dot {
  background: hsl(48 96% 53%);
}

/* Group Item */
.team-group-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--surface-hover);
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-group-icon svg {
  width: 14px;
  height: 14px;
  color: var(--muted-foreground);
}

.team-group-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.team-group-project {
  font-size: 11px;
  color: hsl(217 91% 60%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-group-members {
  font-size: 11px;
  color: var(--muted-foreground);
  background: var(--surface-hover);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Main Chat Area */
.team-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  overflow: hidden;
}

/* Chat Header */
.team-chat-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: nowrap;
  justify-content: space-between;
  background: var(--background);
}

.team-chat-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.team-mobile-back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.team-mobile-back:hover {
  background: var(--surface-hover);
}

.team-mobile-back:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px hsl(217 91% 60% / 0.25);
  border-color: hsl(217 91% 60% / 0.35);
}

.team-chat-header-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.team-chat-header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--muted);
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  font-weight: 700;
}

.team-chat-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-chat-header-status-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--card);
  background: var(--muted-foreground);
}

.team-chat-header-avatar.online .team-chat-header-status-dot {
  background: hsl(142 71% 45%);
}

.team-chat-header-avatar.away .team-chat-header-status-dot {
  background: hsl(48 96% 53%);
}

.team-chat-header-titleblock {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.team-chat-header-titleblock .team-channel-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-chat-header-subtitle {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 1px;
}

.team-chat-header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.team-channel-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.team-header-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

.team-header-action-btn:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.team-header-action-btn.star:hover {
  color: hsl(48 96% 53%);
}

/* Chat Tabs */
.team-chat-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: center;
  overflow-x: auto;
  padding: 2px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  max-width: 100%;
}

.team-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.team-tab:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.team-tab.active {
  background: var(--surface-hover);
  color: var(--foreground);
}

.team-tab.add-view {
  color: var(--muted-foreground);
  border: 1px dashed var(--border);
}

.team-tab.add-view:hover {
  border-color: var(--muted-foreground);
}

/* Header Right */
.team-chat-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.team-header-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted-foreground);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.team-header-btn:hover {
  background: var(--surface-hover);
  color: var(--foreground);
  border-color: var(--border-strong);
}

.team-header-btn .badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  background: hsl(0 84% 60%);
  color: white;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-header-btn.ai-btn {
  background: linear-gradient(135deg, hsl(271 91% 65% / 0.1), hsl(217 91% 60% / 0.1));
  border-color: hsl(271 91% 65% / 0.3);
  color: hsl(271 91% 65%);
}

.team-header-btn.ai-btn:hover {
  background: linear-gradient(135deg, hsl(271 91% 65% / 0.2), hsl(217 91% 60% / 0.2));
}

.team-header-btn.share-btn {
  background: hsl(217 91% 60%);
  border-color: hsl(217 91% 60%);
  color: white;
}

.team-header-btn.share-btn:hover {
  background: hsl(217 91% 55%);
}

/* Chat Content */
.team-chat-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  min-height: 0;
}

.team-list-tab-placeholder {
  width: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted-foreground);
}

.team-list-tab-placeholder-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.team-list-tab-placeholder-subtitle {
  font-size: 13px;
  max-width: 420px;
  text-align: center;
}

.team-dm-checklist {
  width: 100%;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-dm-checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
}

.team-dm-checklist-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--foreground);
}

.team-dm-checklist-subtitle {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.team-dm-checklist-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--foreground);
  font-size: 12px;
  font-weight: 600;
}

.team-dm-checklist-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 0 2px;
}

.team-dm-checklist-search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--foreground);
  font-size: 13px;
  outline: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.team-dm-checklist-search input:focus {
  border-color: hsla(239, 84%, 67%, 0.6);
  box-shadow: 0 0 0 4px hsla(239, 84%, 67%, 0.16);
}

.team-dm-checklist-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}

.team-dm-checklist-progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  overflow: hidden;
}

.team-dm-checklist-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, hsla(239, 84%, 67%, 0.95), hsla(217, 91% 60%, 0.9));
}

.team-dm-checklist-progress-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--foreground);
  min-width: 38px;
  text-align: right;
}

.team-dm-checklist-body {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
}

.team-dm-checklist-items {
  display: flex;
  flex-direction: column;
}

.team-dm-checklist-item {
  display: grid;
  grid-template-columns: 28px 1fr 28px 28px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s;
}

.team-dm-checklist-item:last-child {
  border-bottom: none;
}

.team-dm-checklist-item:hover {
  background: var(--surface-hover);
}

.team-dm-checklist-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.team-dm-checklist-checkbox svg {
  width: 14px;
  height: 14px;
}

.team-dm-checklist-item.completed .team-dm-checklist-checkbox {
  background: hsla(142, 71%, 45%, 0.15);
  border-color: hsla(142, 71%, 45%, 0.4);
  color: hsla(142, 71%, 45%, 1);
}

.team-dm-checklist-item-text {
  font-size: 13px;
  color: var(--foreground);
  line-height: 1.35;
  word-break: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.team-dm-checklist-item.completed .team-dm-checklist-item-text {
  color: var(--muted-foreground);
  text-decoration: line-through;
}

.team-dm-checklist-checked-by {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.team-dm-checklist-checked-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.team-dm-checklist-checked-avatar-fallback {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(239 84% 67%), hsl(217 91% 60%));
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-dm-checklist-delete {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s, color 0.15s;
}

.team-dm-checklist-delete svg {
  width: 16px;
  height: 16px;
}

.team-dm-checklist-delete:hover {
  background: hsla(0, 84%, 60%, 0.12);
  color: hsla(0, 84%, 60%, 0.95);
}

.team-dm-checklist-empty {
  padding: 28px 18px;
  text-align: center;
}

.team-dm-checklist-empty-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--foreground);
}

.team-dm-checklist-empty-subtitle {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted-foreground);
}

.team-dm-checklist-footer {
  padding: 0 2px;
}

.team-dm-checklist-add {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--foreground);
  font-size: 13px;
  outline: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.team-dm-checklist-add:focus {
  border-color: hsla(239, 84%, 67%, 0.6);
  box-shadow: 0 0 0 4px hsla(239, 84%, 67%, 0.16);
}

.team-dm-checklist-skeleton {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-dm-checklist-skeleton-header,
.team-dm-checklist-skeleton-row {
  height: 14px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--surface-hover), var(--surface), var(--surface-hover));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

.team-dm-checklist-skeleton-header {
  height: 22px;
  width: 48%;
}

.team-dm-checklist-skeleton-row {
  height: 16px;
  width: 100%;
}

@keyframes shimmer {
  0% {
    background-position: 0% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

/* Welcome Screen */
.team-chat-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.team-welcome-bookmark {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--muted-foreground);
  margin-bottom: 32px;
}

.bookmark-icons {
  display: flex;
  gap: 2px;
}

.bookmark-icon {
  font-size: 14px;
}

.team-welcome-main h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 12px;
}

.team-welcome-main p {
  font-size: 14px;
  color: var(--muted-foreground);
  max-width: 480px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.team-welcome-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

.team-welcome-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.team-welcome-btn.outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

.team-welcome-btn.outline:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.team-welcome-btn.slack {
  color: #e01e5a;
}

.team-welcome-btn.slack:hover {
  border-color: #e01e5a;
}

/* Feature Cards */
.team-welcome-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 400px;
}

.team-feature-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.team-feature-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature-icon.blue {
  background: linear-gradient(135deg, hsl(217 91% 60% / 0.2), hsl(271 91% 65% / 0.2));
  color: hsl(217 91% 60%);
}

.feature-icon.green {
  background: linear-gradient(135deg, hsl(142 71% 45% / 0.2), hsl(160 84% 39% / 0.2));
  color: hsl(142 71% 45%);
}

.feature-icon.teal {
  background: linear-gradient(135deg, hsl(173 80% 40% / 0.2), hsl(160 84% 39% / 0.2));
  color: hsl(173 80% 40%);
}

.feature-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feature-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
}

.feature-desc {
  font-size: 13px;
  color: var(--muted-foreground);
}

/* Messages List - Modern Chat Behavior */
.team-messages-list {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  max-height: calc(100vh - 200px);
  width: 100%;
  max-width: none;
  margin: 0;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  background: var(--background, hsl(220 15% 8%));
}

/* Webkit scrollbar styling */
.team-messages-list::-webkit-scrollbar {
  width: 5px;
}

.team-messages-list::-webkit-scrollbar-track {
  background: transparent;
}

.team-messages-list::-webkit-scrollbar-thumb {
  background: hsla(220, 13%, 40%, 0.3);
  border-radius: 10px;
}

.team-messages-list::-webkit-scrollbar-thumb:hover {
  background: hsla(220, 13%, 50%, 0.5);
}

/* New message indicator */
.team-messages-list::before {
  content: '';
  position: sticky;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.team-messages-list.has-new-messages::before {
  opacity: 1;
}

/* Date separator */
.team-messages-date-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  gap: 12px;
}

.team-messages-date-separator::before,
.team-messages-date-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: hsla(220, 13%, 30%, 0.3);
}

.team-messages-date-separator span {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--background, hsl(220 15% 8%));
  padding: 4px 12px;
  border-radius: 10px;
  border: 1px solid hsla(220, 13%, 30%, 0.2);
}

/* Scroll to bottom button */
.scroll-to-bottom-btn {
  position: absolute;
  bottom: 80px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface, hsl(220 13% 16%));
  border: 1px solid hsla(220, 13%, 30%, 0.3);
  color: var(--foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  opacity: 0;
  transform: scale(0.8) translateY(10px);
  pointer-events: none;
}

.scroll-to-bottom-btn.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.scroll-to-bottom-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: scale(1.05) translateY(0);
}

.scroll-to-bottom-btn svg {
  width: 18px;
  height: 18px;
}

.scroll-to-bottom-btn .new-message-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  background: hsl(0 84% 60%);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  color: white;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

/* Individual Message - Chat Bubble Style */
.team-message {
  display: flex;
  gap: 8px;
  min-width: 0;
  max-width: 72%;
  align-items: flex-end;
  padding: 2px 0;
}

/* Consecutive messages from same user - tighter spacing */
.team-message + .team-message:not(.own) {
  margin-top: -2px;
}

.team-message.own + .team-message.own {
  margin-top: -2px;
}

/* Own messages - right aligned bubble */
.team-message.own {
  flex-direction: row-reverse;
  margin-left: auto;
}

.team-message.own .team-message-body {
  align-items: flex-end;
}

.team-message.own .team-message-content {
  background: var(--primary);
  color: white;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 1px 4px hsla(var(--primary), 0.2);
}

.team-message.own .team-message-content a {
  color: hsla(0, 0%, 100%, 0.9);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.team-message.own .team-message-header {
  flex-direction: row-reverse;
}

.team-message.own .team-message-time {
  text-align: right;
}

.team-message.own .team-message-status {
  justify-content: flex-end;
}

/* Hide avatar on consecutive own messages */
.team-message.own + .team-message.own .team-message-avatar {
  visibility: hidden;
}

/* System messages */
.team-message.system {
  max-width: 100%;
  justify-content: center;
  opacity: 0.6;
  padding: 8px 0;
}

.team-message.system .team-message-content {
  background: transparent;
  font-size: 12px;
  color: var(--muted-foreground);
  padding: 6px 16px;
  text-align: center;
  border-radius: 12px;
  background: hsla(220, 13%, 18%, 0.5);
  border: 1px solid hsla(220, 13%, 25%, 0.2);
  box-shadow: none;
}

/* Avatar */
.team-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(220 13% 28%), hsl(220 13% 20%));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: hsla(0, 0%, 100%, 0.85);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 2px solid hsla(220, 13%, 25%, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.team-message-avatar img {
  border-radius: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-message.system .team-message-avatar {
  display: none;
}

/* Message Body */
.team-message-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Message Header */
.team-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px 1px;
}

.team-message-user {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary, hsl(220 80% 65%));
  letter-spacing: -0.01em;
}

.team-message-time {
  font-size: 10px;
  color: var(--muted-foreground);
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

/* Message Content - Bubble */
.team-message-content {
  font-size: 13.5px;
  color: var(--foreground);
  line-height: 1.5;
  position: relative;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  background: var(--surface, hsl(220 13% 15%));
  padding: 10px 14px;
  border-radius: 4px 18px 18px 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
  border: 1px solid hsla(220, 13%, 25%, 0.15);
}

.team-message-content p {
  margin: 0;
}

.team-message-content a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

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

.team-message:hover .team-message-content {
  border-color: hsla(220, 13%, 30%, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Reactions row */
.team-message-reactions {
  display: flex;
  gap: 4px;
  padding: 2px 4px 0;
  flex-wrap: wrap;
}

.team-message-reaction {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 12px;
  background: hsla(220, 13%, 20%, 0.6);
  border: 1px solid hsla(220, 13%, 28%, 0.3);
  cursor: pointer;
  transition: all 0.15s ease;
}

.team-message-reaction:hover {
  background: hsla(220, 13%, 25%, 0.8);
  border-color: hsla(220, 13%, 35%, 0.4);
}

.team-message-reaction.active {
  background: hsla(var(--primary), 0.15);
  border-color: hsla(var(--primary), 0.3);
}

.team-message-reaction .count {
  font-size: 10px;
  color: var(--muted-foreground);
  font-weight: 500;
}

/* Message Status */
.team-message-status {
  display: flex;
  justify-content: flex-end;
  margin-top: 1px;
  padding: 0 6px;
  font-size: 10px;
  gap: 4px;
  align-items: center;
}

.team-message-status .message-time-inline {
  font-size: 10px;
  color: var(--muted-foreground);
  opacity: 0.5;
}

.team-message-status .message-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 8px;
  color: var(--muted-foreground);
}

.team-message-status .message-status.received {
  color: var(--muted-foreground);
  opacity: 0.6;
}

.team-message-status .message-status.seen {
  color: var(--status-done, hsl(142 71% 45%));
  opacity: 1;
}

.team-message-status .message-status svg {
  width: 14px;
  height: 14px;
}

/* Context Menu for Messages */
.context-menu {
  position: fixed;
  background: var(--surface, hsl(220 13% 14%));
  border: 1px solid hsla(220, 13%, 28%, 0.4);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  min-width: 200px;
  padding: 6px;
  backdrop-filter: blur(20px);
  animation: contextFadeIn 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes contextFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.context-menu-item {
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  transition: all 0.12s ease;
}

.context-menu-item:hover {
  background: hsla(220, 13%, 22%, 0.8);
}

.context-menu-item.delete {
  color: hsl(0 84% 60%);
}

.context-menu-item.delete:hover {
  background: hsla(0, 84%, 60%, 0.1);
}

.context-menu-item.favorite {
  color: hsl(45 93% 47%);
}

.context-menu-item svg {
  width: 15px;
  height: 15px;
  opacity: 0.75;
}

.context-menu-divider {
  height: 1px;
  background: hsla(220, 13%, 28%, 0.3);
  margin: 4px 6px;
}

/* Hide context menu by default */
.context-menu.hidden {
  display: none;
}

/* Message Input */
.team-message-input-container {
  padding: 12px 16px 16px;
  background: var(--background, hsl(220 15% 8%));
  border-top: 1px solid hsla(220, 13%, 20%, 0.4);
}

.team-message-input-wrapper {
  background: var(--surface, hsl(220 13% 14%));
  border: 1px solid hsla(220, 13%, 25%, 0.3);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.team-message-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px hsla(220, 80%, 60%, 0.08);
}

.team-input-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.toolbar-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

.toolbar-btn:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

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

.toolbar-btn.add {
  background: var(--surface-hover);
}

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

.toolbar-btn.message-type {
  width: auto;
  padding: 0 8px;
  font-size: 13px;
  gap: 4px;
}

 .team-composer-attachments {
   display: flex;
   flex-wrap: wrap;
   gap: 6px;
   padding: 10px 12px;
   border-top: 1px solid var(--border);
   background: var(--surface);
 }

 .team-composer-links {
   display: flex;
   flex-wrap: wrap;
   gap: 6px;
   padding: 10px 12px;
   border-top: 1px solid var(--border);
   background: var(--surface);
 }

 .team-composer-link-chip {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   max-width: 100%;
 }

 .team-composer-link-remove {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   width: 28px;
   height: 28px;
   border: 1px solid var(--border);
   border-radius: 10px;
   background: var(--surface-hover);
   color: var(--muted-foreground);
   cursor: pointer;
   flex-shrink: 0;
 }

 .team-composer-link-remove:hover {
   background: var(--accent);
   color: var(--foreground);
 }

 .team-composer-attachment-chip {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 6px 10px;
   border: 1px solid var(--border);
   border-radius: 999px;
   background: var(--surface-hover);
   max-width: 100%;
 }

 .team-composer-attachment-name {
   color: var(--foreground);
   text-decoration: none;
   font-size: 12px;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
   max-width: 260px;
 }

 .team-composer-attachment-name:hover {
   text-decoration: underline;
 }

 .team-composer-attachment-remove {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   width: 24px;
   height: 24px;
   border: none;
   border-radius: 6px;
   background: transparent;
   color: var(--muted-foreground);
   cursor: pointer;
 }

 .team-composer-attachment-remove:hover {
   background: var(--accent);
   color: var(--foreground);
 }

 .team-composer-popover {
   position: fixed;
   z-index: 10050;
   width: 320px;
   max-width: calc(100vw - 16px);
   background: var(--surface);
   border: 1px solid var(--border);
   border-radius: 12px;
   box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
   overflow: hidden;
 }

 .team-composer-popover-header {
   padding: 10px 12px;
   font-size: 12px;
   font-weight: 600;
   color: var(--muted-foreground);
   border-bottom: 1px solid var(--border);
 }

 .team-composer-emoji-grid {
   display: grid;
   grid-template-columns: repeat(8, 1fr);
   gap: 6px;
   padding: 10px;
 }

 .team-composer-emoji-btn {
   width: 34px;
   height: 34px;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   border: 1px solid transparent;
   border-radius: 10px;
   background: transparent;
   cursor: pointer;
   font-size: 18px;
 }

 .team-composer-emoji-btn:hover {
   background: var(--surface-hover);
   border-color: var(--border);
 }

 .team-composer-list {
   max-height: 260px;
   overflow: auto;
   padding: 6px;
 }

 .team-composer-list-item {
   width: 100%;
   display: flex;
   align-items: center;
   gap: 10px;
   padding: 10px 10px;
   border: none;
   background: transparent;
   color: var(--foreground);
   border-radius: 10px;
   cursor: pointer;
   text-align: left;
   font-size: 13px;
 }

 .team-composer-list-item:hover {
   background: var(--surface-hover);
 }

 .team-composer-list-loading,
 .team-composer-list-empty {
   padding: 14px 12px;
   color: var(--muted-foreground);
   font-size: 13px;
 }

 .team-composer-mention-avatar {
   width: 24px;
   height: 24px;
   border-radius: 50%;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   background: var(--surface-hover);
   border: 1px solid var(--border);
   overflow: hidden;
   flex-shrink: 0;
 }

 .team-composer-mention-avatar img {
   width: 100%;
   height: 100%;
   object-fit: cover;
 }

 .team-composer-mention-avatar span {
   font-size: 12px;
   font-weight: 600;
   color: var(--muted-foreground);
 }

 .team-composer-mention-name {
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
 }

 .team-chat-doc-btn {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 6px 10px;
   border: 1px solid var(--border);
   border-radius: 10px;
   background: var(--surface-hover);
   color: var(--foreground);
   cursor: pointer;
   max-width: 100%;
   vertical-align: middle;
 }

 .team-chat-doc-btn:hover {
   background: var(--accent);
 }

 .team-chat-doc-btn-icon {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   width: 18px;
   height: 18px;
   color: var(--muted-foreground);
   flex-shrink: 0;
 }

 .team-chat-doc-btn-text {
   font-size: 12px;
   font-weight: 500;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
   max-width: 260px;
 }

.team-input-area {
  padding: 12px 16px;
}

.team-message-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--foreground);
}

.team-message-input::placeholder {
  color: var(--muted-foreground);
}

.team-input-actions {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  justify-content: flex-end;
  gap: 4px;
}

.team-send-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

.team-send-btn:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.team-send-btn svg {
  width: 18px;
  height: 18px;
}



/* Members Panel */
.team-members-panel {
  width: 280px;
  min-width: 280px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.team-members-panel.collapsed {
  width: 0;
  min-width: 0;
  overflow: hidden;
  border-left: none;
}

.team-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.team-panel-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted-foreground);
  cursor: pointer;
}

.team-panel-close:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.team-panel-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}

.team-panel-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted-foreground);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.team-panel-tab:hover {
  background: var(--surface-hover);
}

.team-panel-tab.active {
  background: var(--surface-hover);
  color: var(--foreground);
}

.tab-count {
  background: var(--surface-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* Invite Notifications Modal Styles */
.invite-notifications-modal {
  padding: 20px;
  max-width: 500px;
  margin: 0 auto;
}

.invite-notifications-modal h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--foreground);
}

.invite-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.invite-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--surface-hover);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.invite-info {
  flex: 1;
}

.invite-sender {
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 4px;
}

.invite-date {
  font-size: 12px;
  color: var(--muted-foreground);
}

.invite-actions {
  display: flex;
  gap: 8px;
}

.invite-actions .btn {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.invite-actions .btn-primary {
  background: hsl(217 91% 60%);
  color: white;
  border: none;
}

.invite-actions .btn-primary:hover {
  background: hsl(217 91% 55%);
}

.invite-actions .btn-secondary {
  background: var(--surface);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.invite-actions .btn-secondary:hover {
  background: var(--surface-hover);
}

.team-panel-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  margin: 8px 16px;
  background: var(--surface-hover);
  border-radius: 8px;
  color: var(--muted-foreground);
}

.team-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--foreground);
}

.team-search-input::placeholder {
  color: var(--muted-foreground);
}

.team-panel-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

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

.team-add-people-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 3px;
  color: var(--muted-foreground);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.team-add-people-btn:hover {
  border-color: var(--muted-foreground);
  color: var(--foreground);
  background: var(--surface-hover);
  border-style: solid;
}

.team-followers-list {
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.team-follower-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  position: relative;
}

.team-follower-item:hover {
  background-color: var(--hover);
}

.conversation-button {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface-hover);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.team-follower-item:hover .conversation-button {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(-4px);
}

.conversation-button:hover {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--accent);
  transform: translateY(-50%) translateX(-4px) scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.conversation-button svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ============================================
   Team Member Context Menu
   ============================================ */

.team-member-context-menu {
  position: fixed;
  z-index: 10000;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  min-width: 220px;
  padding: 8px;
  animation: contextMenuFadeIn 0.15s ease-out;
}

@keyframes contextMenuFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.context-menu-header {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.context-menu-user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--foreground);
  margin-bottom: 2px;
}

.context-menu-user-email {
  font-size: 12px;
  color: var(--muted-foreground);
}

.context-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  color: var(--foreground);
}

.context-menu-item:hover {
  background: var(--hover);
}

.context-menu-item.danger {
  color: var(--destructive);
}

.context-menu-item.danger:hover {
  background: var(--destructive);
  color: white;
}

.context-menu-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.context-menu-item:hover svg {
  opacity: 1;
}

.team-follower-avatar-wrapper {
  position: relative;
  width: 32px;
  height: 32px;
}

.team-follower-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(271 91% 65%), hsl(217 91% 60%));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
  overflow: hidden;
}

.team-follower-status {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  z-index: 2;
}

.team-follower-status.online {
  background-color: #10b981;
}

.team-follower-status.offline {
  background-color: #94a3b8;
}

.team-follower-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.team-follower-name {
  flex: 1;
  font-size: 14px;
  color: var(--foreground);
}

.team-owner-badge {
  font-size: 11px;
  color: var(--muted-foreground);
  background: var(--surface-hover);
  padding: 2px 8px;
  border-radius: 4px;
  position: relative;
  top: -12px;
}

/* Responsive */
@media (max-width: 1024px) {
  .team-members-panel {
    display: none;
  }
}

/* Add People Dropdown Styles */
.team-add-people-dropdown-wrapper {
  position: relative;
}

.team-add-people-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 320px;
  max-width: calc(100vw - 20px);
  z-index: 1000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  margin-top: 4px;
  animation: dropdownSlideIn 0.2s ease-out;
}

/* Invites Dropdown Styles */
.team-invites-dropdown {
  position: relative;
  width: 100%;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  animation: dropdownSlideIn 0.2s ease-out;
  z-index: 1000;
}

.team-invites-dropdown .dropdown-content {
  padding: 12px;
}

.team-invites-dropdown .dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.team-invites-dropdown .dropdown-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.team-invites-dropdown .dropdown-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-invites-dropdown .invite-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-invites-dropdown .invite-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--surface-hover);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.team-invites-dropdown .invite-info {
  flex: 1;
}

.team-invites-dropdown .invite-sender {
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 4px;
  font-size: 13px;
}

.team-invites-dropdown .invite-date {
  font-size: 11px;
  color: var(--muted-foreground);
}

.team-invites-dropdown .invite-actions {
  display: flex;
  gap: 6px;
}

.team-invites-dropdown .invite-actions .btn {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 4px;
}

.team-invites-dropdown .invite-actions .btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}

/* Invites dropdown panel styles */
.invites-dropdown-header {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.invites-dropdown-list {
  max-height: 300px;
  overflow-y: auto;
}

.invites-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
  text-align: center;
}

.invite-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.invite-dropdown-item:last-child {
  border-bottom: none;
}

.invite-dropdown-item:hover {
  background: var(--surface-hover);
}

.invite-dropdown-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.invite-dropdown-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.invite-dropdown-avatar span {
  color: white;
  font-size: 13px;
  font-weight: 600;
}

.invite-dropdown-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.invite-dropdown-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

.invite-dropdown-email {
  font-size: 11px;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-dropdown-time {
  font-size: 10px;
  color: var(--muted-foreground);
}

.invite-dropdown-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.invite-accept-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.invite-accept-btn:hover {
  background: #059669;
}

.invite-reject-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  background: transparent;
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.invite-reject-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

/* Ensure dropdown stays within viewport */
.team-add-people-dropdown-wrapper {
  position: relative;
}

.dropdown-content {
  padding: 8px;
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.dropdown-header h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
}

.dropdown-close {
  background: none;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 1px;
  border-radius: 3px;
  transition: all 0.15s ease;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-close:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

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

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--foreground);
  transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--background);
  box-shadow: 0 0 0 3px hsla(239, 84%, 67%, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 50px;
}

.form-help {
  font-size: 10px;
  color: var(--muted-foreground);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding-top: 4px;
}

.btn {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  display: flex;
  align-items: center;
  gap: 3px;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background: hsl(217, 91%, 55%);
}

.btn-secondary {
  background: var(--surface);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

/* Pending Follow Requests */
.team-pending-requests {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0;
}

.team-request-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.team-request-item:hover {
  background: var(--hover-bg);
  border-color: var(--primary);
}

.team-request-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

.team-request-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.team-request-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.team-request-email {
  font-size: 12px;
  color: var(--text-secondary);
}

.team-request-time {
  font-size: 11px;
  color: var(--text-tertiary);
}

.team-request-actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: var(--success-hover);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: var(--danger-hover);
  transform: translateY(-1px);
}

/* Current User Email Display */
.current-user-email {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.email-display {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.email-status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.email-status.verified {
  background: var(--success-bg);
  color: var(--success);
}

.form-help {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Notification Badge for Pending Requests */
.tab-count.pending {
  background: var(--warning);
  color: white;
}

@media (max-width: 1024px) {
  .team-chat-tabs {
    display: none;
  }
}

@media (max-width: 768px) {
  .team-chat-layout {
    padding: 0;
    height: 100vh;
    height: 100dvh;
  }

  .team-chat-sidebar {
    display: flex;
    width: 100%;
    min-width: 100%;
    border-radius: 0;
  }

  .team-chat-main {
    display: none;
    border-radius: 0;
  }

  .team-chat-layout.mobile-chat-open .team-chat-sidebar {
    display: none;
  }

  .team-chat-layout.mobile-chat-open .team-chat-main {
    display: flex;
  }

  .team-chat-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 12px 12px;
    flex-wrap: nowrap;
  }

  .team-chat-header-left {
    width: 100%;
    justify-content: space-between;
  }

  .team-channel-name {
    display: none;
  }

  .team-mobile-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--foreground);
    touch-action: manipulation;
  }

  .team-chat-layout:not(.mobile-chat-open) .team-mobile-back {
    display: none;
  }

  .team-chat-header-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
  }

  .team-chat-header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--muted);
    color: var(--foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    font-weight: 700;
  }

  .team-chat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .team-chat-header-status-dot {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--card);
    background: var(--muted-foreground);
  }

  .team-chat-header-avatar.online .team-chat-header-status-dot {
    background: hsl(142 71% 45%);
  }

  .team-chat-header-avatar.away .team-chat-header-status-dot {
    background: hsl(48 96% 53%);
  }

  .team-chat-header-titleblock {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .team-chat-header-titleblock .team-channel-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .team-chat-header-subtitle {
    font-size: 12px;
    color: var(--muted-foreground);
    margin-top: 1px;
  }

  .team-chat-tabs {
    display: none;
  }

  .team-chat-header-right {
    display: none;
  }

  .team-welcome-actions {
    flex-direction: column;
  }

  .team-input-toolbar {
    overflow-x: auto;
  }

  .team-input-toolbar,
  .team-composer-attachments,
  .team-composer-links {
    display: none;
  }

  .team-message-input-container {
    padding: 10px 12px 12px;
  }

  .team-message-input-wrapper {
    border-radius: 14px;
  }
}

/* ============================================
   Issues View
   ============================================ */
.issues-container {
  padding: 24px;
}

.issue-id {
  font-size: 12px;
  font-family: monospace;
  color: var(--muted-foreground);
}

.issue-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.issue-description {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.issue-updated {
  font-size: 12px;
  color: var(--muted-foreground);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 1024px) {
  .project-detail-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .view-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .issues-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .table-header.issues-grid {
    display: none;
  }

  .table-row.issues-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
  }

  .kanban-column {
    width: 260px;
  }

  .project-detail-main {
    padding: 20px;
  }
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: var(--foreground);
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
  background-color: hsl(142 71% 45%);
}

.toggle-switch input:checked+.toggle-slider:before {
  transform: translateX(22px);
  background-color: white;
}

/* Creator Badge */
.creator-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: linear-gradient(135deg, hsl(271 91% 65% / 0.15), hsl(217 91% 60% / 0.15));
  border: 1px solid hsl(271 91% 65% / 0.3);
  border-radius: 8px;
}

.creator-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(271 91% 65%), hsl(217 91% 60%));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.creator-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

/* Progress Chart Modern Styles */
.progress-chart-modern {
  padding: 8px 0;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted-foreground);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.chart-total {
  display: flex;
  align-items: center;
  gap: 8px;
}

.total-label {
  font-size: 12px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.total-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--foreground);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


/* ============================================
   Layer - AI Sidebar Styles
   Minimalistic, Professional Design
   ============================================ */

/* AI Sidebar Container */
.ai-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 400px;
  height: 100vh;
  background: rgba(10, 10, 12, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.5);
}

.ai-sidebar-overlay.open {
  transform: translateX(0);
}

/* AI Sidebar Header */
.ai-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(20, 20, 24, 0.9) 0%, transparent 100%);
}

.ai-sidebar-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-sidebar-title-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
}

.ai-sidebar-title-icon svg {
  width: 18px;
  height: 18px;
  color: #818cf8;
}

.ai-sidebar-title h3 {
  font-size: 15px;
  font-weight: 600;
  color: #fafafa;
  margin: 0;
  letter-spacing: -0.01em;
}

.ai-sidebar-title span {
  font-size: 11px;
  color: #71717a;
  font-weight: 500;
}

.ai-sidebar-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #71717a;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fafafa;
}

.ai-sidebar-close svg {
  width: 16px;
  height: 16px;
}

/* AI Messages Container */
.ai-sidebar-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* AI Message Bubble */
.ai-sidebar-message {
  max-width: 100%;
  animation: messageSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-sidebar-message.user {
  align-self: flex-end;
  max-width: 85%;
}

.ai-sidebar-message.user .ai-message-content {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  padding: 12px 16px;
  border-radius: 16px 16px 4px 16px;
  font-size: 14px;
  line-height: 1.5;
}

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

.ai-sidebar-message.assistant .ai-message-content {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px;
  border-radius: 4px 16px 16px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: #e4e4e7;
}

/* Typography in AI responses */
.ai-message-content .ai-bold {
  color: #fafafa;
  font-weight: 600;
}

.ai-message-content .ai-paragraph {
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.ai-message-content .ai-paragraph:last-child {
  margin-bottom: 0;
}

/* Bullet Lists */
.ai-message-content .ai-bullet-list {
  margin: 8px 0;
  padding-left: 0;
  list-style: none;
}

.ai-message-content .ai-bullet {
  position: relative;
  padding-left: 18px;
  margin: 4px 0;
  color: #d4d4d8;
  line-height: 1.5;
}

.ai-message-content .ai-bullet::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #818cf8;
  font-weight: bold;
}

/* Numbered Lists */
.ai-message-content .ai-numbered-list {
  margin: 8px 0;
  padding-left: 20px;
  counter-reset: ai-counter;
}

.ai-message-content .ai-numbered {
  position: relative;
  margin: 4px 0;
  color: #d4d4d8;
  counter-increment: ai-counter;
  list-style: none;
  line-height: 1.5;
}

.ai-message-content .ai-numbered::before {
  content: counter(ai-counter) ".";
  position: absolute;
  left: -24px;
  color: #818cf8;
  font-weight: 600;
}

/* Inline Code */
.ai-message-content .ai-inline-code {
  font-family: 'Source Code Pro', 'Fira Code', monospace;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: #a5b4fc;
}

/* Code Block Container */
.ai-code-block {
  margin: 10px 0;
  background: #0f0f12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
}

.ai-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-code-lang {
  font-family: 'Source Code Pro', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-code-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #a1a1aa;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-code-copy:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fafafa;
}

.ai-code-content {
  padding: 16px;
  margin: 0;
  overflow-x: auto;
}

.ai-code-content code {
  font-family: 'Source Code Pro', 'Fira Code', 'Monaco', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #e4e4e7;
  white-space: pre;
}

/* Loading Animation */
.ai-loading {
  padding: 12px 20px !important;
}

.ai-loading-animation {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-loading-dot {
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 50%;
  animation: aiLoadingPulse 1.4s ease-in-out infinite;
}

.ai-loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes aiLoadingPulse {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }

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

.ai-loading-text {
  font-size: 13px;
  color: #71717a;
  margin-left: 8px;
  animation: aiLoadingFade 1.4s ease-in-out infinite;
}

@keyframes aiLoadingFade {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* AI Input Area */
.ai-sidebar-input-area {
  padding: 16px 24px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(0deg, rgba(20, 20, 24, 0.9) 0%, transparent 100%);
}

.ai-sidebar-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 4px 4px 4px 16px;
  transition: all 0.2s ease;
}

.ai-sidebar-input-wrapper:focus-within {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ai-sidebar-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: #fafafa;
  padding: 12px 0;
}

.ai-sidebar-input::placeholder {
  color: #52525b;
}

.ai-sidebar-send {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-sidebar-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.ai-sidebar-send:active {
  transform: scale(0.98);
}

.ai-sidebar-send svg {
  width: 18px;
  height: 18px;
}

/* AI Sidebar Welcome */
.ai-sidebar-welcome {
  text-align: center;
  padding: 40px 20px;
  color: #71717a;
}

.ai-sidebar-welcome-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
}

.ai-sidebar-welcome-icon svg {
  width: 28px;
  height: 28px;
  color: #818cf8;
}

.ai-sidebar-welcome h4 {
  font-size: 16px;
  font-weight: 600;
  color: #fafafa;
  margin: 0 0 8px 0;
}

.ai-sidebar-welcome p {
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

/* Backdrop for sidebar */
.ai-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.ai-sidebar-backdrop.open {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   Code Error Highlighting
   ============================================ */

.code-error-highlight {
  background: rgba(239, 68, 68, 0.15) !important;
  border-bottom: 2px wavy #ef4444;
  position: relative;
  cursor: pointer;
}

.code-error-tooltip {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: #1f1f23;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  max-width: 300px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.code-error-highlight:hover .code-error-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-8px);
}

.code-error-tooltip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.code-error-tooltip-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.2);
  border-radius: 4px;
}

.code-error-tooltip-icon svg {
  width: 12px;
  height: 12px;
  color: #ef4444;
}

.code-error-tooltip-type {
  font-size: 11px;
  font-weight: 600;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-error-tooltip-message {
  font-size: 13px;
  color: #e4e4e7;
  line-height: 1.5;
  margin-bottom: 8px;
}

.code-error-tooltip-fix {
  font-size: 12px;
  color: #a1a1aa;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.code-error-tooltip-fix strong {
  color: #10b981;
}

/* Light mode adjustments */
.light .ai-sidebar-overlay {
  background: rgba(255, 255, 255, 0.98);
  border-right-color: rgba(0, 0, 0, 0.08);
}

.light .ai-sidebar-header {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.light .ai-sidebar-title h3 {
  color: #18181b;
}

.light .ai-sidebar-close {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.08);
  color: #71717a;
}

.light .ai-sidebar-message.assistant .ai-message-content {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: #3f3f46;
}

.light .ai-message-content .ai-bold {
  color: #18181b;
}

.light .ai-code-block {
  background: #f4f4f5;
  border-color: rgba(0, 0, 0, 0.08);
}

.light .ai-code-content code {
  color: #3f3f46;
}

.light .ai-sidebar-input-wrapper {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

.light .ai-sidebar-input {
  color: #18181b;
}

/* Responsive */
@media (max-width: 480px) {
  .ai-sidebar-overlay {
    width: 100%;
  }
}


/* ============================================
   Layer - AI Sidebar Styles (Professional & Minimalistic)
   Source Code Pro for code, clean typography hierarchy
   ============================================ */

/* ============================================
   AI Sidebar Container
   ============================================ */
.ai-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 380px;
  height: 100vh;
  background: linear-gradient(180deg, rgba(12, 12, 14, 0.98) 0%, rgba(8, 8, 10, 0.99) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  z-index: 3000;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.5);
}

.ai-sidebar.open {
  transform: translateX(0);
}

/* ============================================
   AI Sidebar Header
   ============================================ */
.ai-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.ai-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-sidebar-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-sidebar-logo svg {
  width: 20px;
  height: 20px;
  color: #818cf8;
}

.ai-sidebar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-sidebar-title h3 {
  font-size: 16px;
  font-weight: 600;
  color: #fafafa;
  margin: 0;
  letter-spacing: -0.02em;
}

.ai-sidebar-title span {
  font-size: 11px;
  color: #71717a;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-sidebar-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #71717a;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fafafa;
}

.ai-sidebar-close svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   AI Messages Container
   ============================================ */
.ai-sidebar-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ai-sidebar-messages::-webkit-scrollbar {
  width: 4px;
}

.ai-sidebar-messages::-webkit-scrollbar-track {
  background: transparent;
}

.ai-sidebar-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* ============================================
   AI Message Bubbles
   ============================================ */
.ai-sidebar-message {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-sidebar-message.user {
  align-items: flex-end;
}

.ai-sidebar-message.user .ai-message-content {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: #ffffff;
  border-radius: 16px 16px 4px 16px;
  max-width: 85%;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 450;
}

.ai-sidebar-message.assistant .ai-message-content {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px 16px 16px 16px;
  padding: 18px 20px;
  color: #e4e4e7;
  max-width: 100%;
}

/* ============================================
   AI Response Typography Hierarchy
   ============================================ */
.ai-message-content h1,
.ai-message-content h2,
.ai-message-content h3,
.ai-message-content .ai-bold {
  color: #fafafa;
  font-weight: 600;
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.ai-message-content h1 {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.ai-message-content h2 {
  font-size: 17px;
  letter-spacing: -0.01em;
}

.ai-message-content h3 {
  font-size: 15px;
}

.ai-message-content .ai-bold {
  display: block;
  font-size: 15px;
  margin-bottom: 8px;
}

.ai-message-content strong {
  color: #fafafa;
  font-weight: 600;
}

.ai-paragraph {
  font-size: 14px;
  line-height: 1.5;
  color: #d4d4d8;
  margin: 0 0 8px 0;
}

.ai-paragraph:last-child {
  margin-bottom: 0;
}

/* ============================================
   AI Bullet Points - Professional Style
   ============================================ */
.ai-bullet-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-bullet {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #d4d4d8;
}

.ai-bullet::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  border-radius: 50%;
}

.ai-numbered-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  counter-reset: ai-counter;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-numbered {
  position: relative;
  padding-left: 28px;
  font-size: 14px;
  line-height: 1.6;
  color: #d4d4d8;
  counter-increment: ai-counter;
}

.ai-numbered::before {
  content: counter(ai-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   AI Code Block - Source Code Pro
   ============================================ */
.ai-code-block {
  background: #0c0c0e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  margin: 14px 0;
}

.ai-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-code-lang {
  font-family: 'Source Code Pro', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-code-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #a1a1aa;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ai-code-copy:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

.ai-code-copy svg {
  width: 12px;
  height: 12px;
}

.ai-code-content {
  padding: 16px;
  margin: 0;
  overflow-x: auto;
}

.ai-code-content code {
  font-family: 'Source Code Pro', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #e4e4e7;
  display: block;
  white-space: pre;
  tab-size: 2;
}

/* Inline code */
.ai-inline-code {
  font-family: 'Source Code Pro', monospace;
  font-size: 13px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ============================================
   AI Loading Animation - Unique & Smooth
   ============================================ */
.ai-loading {
  padding: 0;
}

.ai-loading-animation {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px 16px 16px 16px;
}

.ai-loading-dot {
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 50%;
  animation: aiLoadingPulse 1.4s ease-in-out infinite;
}

.ai-loading-dot:nth-child(1) {
  animation-delay: 0s;
}

.ai-loading-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.ai-loading-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes aiLoadingPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.4;
  }

  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}

.ai-loading-text {
  font-size: 13px;
  color: #71717a;
  font-weight: 500;
  animation: aiLoadingTextFade 2s ease-in-out infinite;
}

@keyframes aiLoadingTextFade {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* Alternative loading - typing indicator */
.ai-loading-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px 16px 16px 16px;
}

.ai-loading-wave span {
  display: block;
  width: 4px;
  height: 16px;
  background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 2px;
  animation: aiWave 1s ease-in-out infinite;
}

.ai-loading-wave span:nth-child(1) {
  animation-delay: 0s;
}

.ai-loading-wave span:nth-child(2) {
  animation-delay: 0.1s;
}

.ai-loading-wave span:nth-child(3) {
  animation-delay: 0.2s;
}

.ai-loading-wave span:nth-child(4) {
  animation-delay: 0.3s;
}

@keyframes aiWave {

  0%,
  100% {
    transform: scaleY(0.5);
    opacity: 0.5;
  }

  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* ============================================
   AI Input Area
   ============================================ */
.ai-sidebar-input-area {
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.ai-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.ai-input-wrapper:focus-within {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ai-sidebar-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fafafa;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  min-height: 24px;
  max-height: 120px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ai-sidebar-input::placeholder {
  color: #52525b;
}

.ai-sidebar-send {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  border: none;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ai-sidebar-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.ai-sidebar-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ai-sidebar-send svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   AI Suggestions
   ============================================ */
.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ai-suggestion-chip {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  color: #a1a1aa;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-suggestion-chip:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

/* ============================================
   DOC AI Sidebar - LEFT side, minimalistic ClickUp Brain style
   ============================================ */
.doc-ai-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 420px;
  height: 100vh;
  background: var(--card, #0a0a0b);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 3000;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

.doc-ai-sidebar.open {
  transform: translateX(0);
}

.doc-ai-sidebar .ai-drawer-topbar,
.whiteboard-ai-sidebar .ai-drawer-topbar,
.ai-sidebar-overlay .ai-drawer-topbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

/* Minimalistic AI Sidebar Header - ClickUp Brain Style */
.doc-ai-sidebar .ai-sidebar-header,
.whiteboard-ai-sidebar .ai-sidebar-header,
.ai-sidebar-overlay .ai-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.doc-ai-sidebar .ai-sidebar-brand,
.whiteboard-ai-sidebar .ai-sidebar-brand,
.ai-sidebar-overlay .ai-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Animated Brain/AI Icon */
.ai-sidebar-brain-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-sidebar-brain-icon svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
  z-index: 2;
  animation: aiIconFloat 3s ease-in-out infinite;
}

.ai-brain-pulse {
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  opacity: 0.12;
  filter: blur(8px);
  animation: aiBrainGlow 4s ease-in-out infinite;
  z-index: 1;
}

.ai-brain-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  border: 1px solid var(--primary);
  opacity: 0;
  animation: aiBrainOrbit 4s linear infinite;
}

@keyframes aiIconFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

@keyframes aiBrainGlow {

  0%,
  100% {
    opacity: 0.1;
    transform: scale(1);
    filter: blur(8px);
  }

  50% {
    opacity: 0.25;
    transform: scale(1.15);
    filter: blur(12px);
  }
}

@keyframes aiBrainOrbit {
  0% {
    transform: rotate(0deg) scale(0.8);
    opacity: 0;
  }

  10%,
  40% {
    opacity: 0.4;
  }

  100% {
    transform: rotate(360deg) scale(1.4);
    opacity: 0;
  }
}

.ai-sidebar-title-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-sidebar-title-text span {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
  opacity: 0.7;
}

/* Minimalistic Close Button */
.ai-sidebar-close-minimal {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s;
}

.ai-sidebar-close-minimal:hover {
  background: var(--muted);
  color: var(--foreground);
}

.ai-sidebar-close-minimal svg {
  width: 16px;
  height: 16px;
}

/* Minimalist Welcome Message - ClickUp Brain Style */
.ai-welcome-message {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-welcome-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ai-welcome-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, hsl(271, 91%, 65%) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-welcome-avatar svg {
  width: 16px;
  height: 16px;
  color: white;
}

.ai-welcome-content {
  flex: 1;
}

.ai-welcome-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 6px;
}

.ai-welcome-text {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* Message Bubbles - Minimalist */
.ai-message-bubble {
  padding: 16px 20px;
  margin: 0 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.ai-message-bubble.user {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.15);
  margin-left: 40px;
}

.ai-message-bubble .ai-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ai-message-bubble .ai-avatar-mini {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--primary) 0%, hsl(271, 91%, 65%) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-message-bubble .ai-avatar-mini svg {
  width: 10px;
  height: 10px;
  color: white;
}

.ai-message-bubble .ai-message-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
}

/* AI Loading Animation - Smooth Loop */
.ai-loading-loop {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  margin: 0 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

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

.ai-loading-dots-loop span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: dotLoop 1.4s ease-in-out infinite;
}

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

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

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

@keyframes dotLoop {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }

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

.ai-loading-text-loop {
  font-size: 13px;
  color: var(--muted-foreground);
  animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* Action Items Button - Like ClickUp */
.ai-action-items-btn {
  position: absolute;
  top: 56px;
  right: -100px;
  padding: 10px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.ai-action-items-btn:hover {
  background: var(--muted);
}

/* Minimalist Input Area */
.ai-sidebar-input-minimal {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.ai-input-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  transition: all 0.2s;
}

.ai-input-container:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.ai-input-container input,
.ai-input-container textarea,
.ai-input-container .ai-clean-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--foreground);
  font-size: 13px;
  line-height: 1.5;
  resize: none;
  font-family: inherit;
}

.ai-input-container input::placeholder,
.ai-input-container textarea::placeholder {
  color: var(--muted-foreground);
}

.ai-input-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-input-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s;
}

.ai-input-action-btn:hover {
  background: var(--muted);
  color: var(--foreground);
}

.ai-input-action-btn svg {
  width: 14px;
  height: 14px;
}

.ai-send-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-send-btn:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
}

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

/* Page Context Selector */
.ai-page-context {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: fit-content;
  cursor: pointer;
  transition: all 0.15s;
}

.ai-page-context:hover {
  border-color: var(--primary);
}

.ai-page-context-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  border-radius: 4px;
}

.ai-page-context-icon svg {
  width: 10px;
  height: 10px;
  color: white;
}

.ai-page-context-text {
  font-size: 11px;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-page-context-name {
  color: var(--foreground);
  font-weight: 500;
}

/* ============================================
   Whiteboard AI Sidebar - LEFT side, same minimalistic style
   ============================================ */
.whiteboard-ai-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 420px;
  height: 100vh;
  background: var(--card, #0a0a0b);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 3000;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

.whiteboard-ai-sidebar.open {
  transform: translateX(0);
}

/* AI Sidebar Overlay (unified style for all AI panels) */
.ai-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 420px;
  height: 100vh;
  background: var(--card, #0a0a0b);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 3000;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

.ai-sidebar-overlay.open {
  transform: translateX(0);
}

/* AI Sidebar Backdrop */
.ai-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 2999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.ai-sidebar-backdrop.open {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   Code Error Highlight Styles
   ============================================ */
.code-error-highlight {
  position: relative;
  display: block;
  background: rgba(239, 68, 68, 0.15);
  border-left: 3px solid #ef4444;
  margin: 0 -16px;
  padding: 0 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.code-error-highlight:hover {
  background: rgba(239, 68, 68, 0.25);
}

.code-error-highlight:hover .code-error-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.code-error-tooltip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-10px);
  width: 280px;
  background: #1c1c1e;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  z-index: 100;
  pointer-events: auto;
}

.code-error-tooltip::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: rgba(239, 68, 68, 0.3);
}

.code-error-tooltip::after {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #1c1c1e;
}

.code-error-tooltip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.code-error-tooltip-icon {
  width: 24px;
  height: 24px;
  background: rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.code-error-tooltip-icon svg {
  width: 14px;
  height: 14px;
  color: #f87171;
}

.code-error-tooltip-type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  padding: 4px 8px;
  border-radius: 4px;
}

.code-error-tooltip-message {
  font-size: 13px;
  color: #e4e4e7;
  line-height: 1.5;
  margin-bottom: 10px;
}

.code-error-tooltip-fix {
  font-size: 12px;
  color: #a1a1aa;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 6px;
  padding: 10px 12px;
  line-height: 1.5;
}

.code-error-tooltip-fix strong {
  color: #4ade80;
}

/* ============================================
   Word-by-word Animation Effect
   ============================================ */
.ai-word-reveal {
  opacity: 0;
  animation: wordFadeIn 0.08s ease forwards;
}

@keyframes wordFadeIn {
  to {
    opacity: 1;
  }
}

/* ============================================
   PROFESSIONAL AI PLATFORM STYLES
   Theme-Aware - Modern Interface
   ============================================ */

/* AI Response Cards - Platform style, not chatbot */
.ai-response-card {
  animation: cardSlideIn 0.25s ease-out;
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* User Message Card */
.ai-response-card.user-card {
  margin-bottom: 16px;
}

.ai-user-message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--ai-user-bg, rgba(59, 130, 246, 0.08));
  border: 1px solid var(--ai-user-border, rgba(59, 130, 246, 0.15));
  border-radius: 12px;
}

.ai-user-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--primary, #3b82f6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-user-avatar svg {
  width: 16px;
  height: 16px;
  color: white;
}

.ai-user-content {
  flex: 1;
  font-size: 14px;
  line-height: 1.6;
  color: var(--foreground, #fafafa);
}

/* Assistant Message Card */
.ai-response-card.assistant-card {
  margin-bottom: 20px;
}

.ai-assistant-message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ai-assistant-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--ai-avatar-bg, linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%));
  border: 1px solid var(--ai-avatar-border, rgba(99, 102, 241, 0.3));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-assistant-avatar svg {
  width: 16px;
  height: 16px;
  color: var(--primary, #818cf8);
}

.ai-assistant-content {
  flex: 1;
  padding: 16px;
  background: var(--ai-response-bg, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--ai-response-border, rgba(255, 255, 255, 0.06));
  border-radius: 12px;
}

.ai-assistant-content strong {
  color: var(--foreground, #fafafa);
  font-weight: 650;
}

/* AI Text Styles */
.ai-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted-foreground);
  margin: 0 0 8px 0;
}

.ai-text:last-child {
  margin-bottom: 0;
}

.ai-heading {
  color: #ffffff;
  font-weight: 600;
  margin: 16px 0 8px 0;
  line-height: 1.4;
}

.ai-heading:first-child {
  margin-top: 0;
}

h2.ai-heading {
  font-size: 18px;
}

h3.ai-heading {
  font-size: 16px;
}

h4.ai-heading {
  font-size: 14px;
}

/* ============================================
   AI Code Block - Professional with Copy
   ============================================ */
.ai-code-container {
  margin: 16px 0;
  background: var(--ai-code-bg, #0c0c0e);
  border: 1px solid var(--ai-code-border, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  overflow: hidden;
}

.ai-code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--ai-code-header-bg, rgba(255, 255, 255, 0.04));
  border-bottom: 1px solid var(--ai-code-border, rgba(255, 255, 255, 0.08));
}

.ai-code-language {
  font-family: 'SF Mono', 'Source Code Pro', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--ai-muted, #71717a);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-code-copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--ai-btn-bg, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--ai-btn-border, rgba(255, 255, 255, 0.1));
  border-radius: 6px;
  color: var(--ai-muted, #a1a1aa);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ai-code-copy-btn svg {
  width: 14px;
  height: 14px;
}

.ai-code-copy-btn:hover {
  background: var(--ai-btn-hover-bg, rgba(99, 102, 241, 0.15));
  border-color: var(--ai-btn-hover-border, rgba(99, 102, 241, 0.35));
  color: var(--primary, #818cf8);
}

.ai-code-copy-btn.copied {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.ai-code-pre {
  padding: 16px;
  margin: 0;
  overflow-x: auto;
}

.ai-code {
  font-family: 'SF Mono', 'Source Code Pro', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ai-code-text, #e4e4e7);
  display: block;
  white-space: pre;
  tab-size: 2;
}

/* Inline Code */
.ai-inline-code {
  font-family: 'SF Mono', 'Source Code Pro', monospace;
  font-size: 13px;
  background: var(--ai-inline-code-bg, rgba(99, 102, 241, 0.12));
  border: 1px solid var(--ai-inline-code-border, rgba(99, 102, 241, 0.2));
  color: var(--ai-inline-code-text, #a5b4fc);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ============================================
   AI Loading State - Elegant Pulse
   ============================================ */
.ai-loading-state {
  margin-bottom: 16px;
}

.ai-loading-content {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--ai-response-bg, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--ai-response-border, rgba(255, 255, 255, 0.06));
  border-radius: 12px;
}

.ai-loading-orb {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--primary, #6366f1) 0%, #8b5cf6 100%);
  border-radius: 50%;
  animation: orbPulse 1.5s ease-in-out infinite;
}

@keyframes orbPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.6;
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
    box-shadow: 0 0 20px 4px rgba(99, 102, 241, 0.2);
  }
}

.ai-loading-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ai-muted, #71717a);
  animation: labelFade 1.5s ease-in-out infinite;
}

@keyframes labelFade {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* ============================================
   AI Input Area - Clean design
   ============================================ */
.ai-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: var(--ai-input-bg, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--ai-input-border, rgba(255, 255, 255, 0.1));
  border-radius: 14px;
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.ai-input-wrapper:focus-within {
  border-color: var(--primary, rgba(99, 102, 241, 0.5));
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ai-sidebar-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  min-height: 24px;
  max-height: 120px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ai-sidebar-input::placeholder {
  color: var(--ai-muted, #52525b);
}

.ai-sidebar-send {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary, linear-gradient(135deg, #3b82f6 0%, #6366f1 100%));
  border: none;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ai-sidebar-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.ai-sidebar-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ai-sidebar-send svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   Theme Variables - Applied per theme
   ============================================ */
:root {
  --ai-panel-bg: linear-gradient(180deg, #0a0a0b 0%, #0f0f11 100%);
  --ai-border: rgba(255, 255, 255, 0.08);
  --ai-text: #d4d4d8;
  --ai-muted: #71717a;
  --ai-response-bg: rgba(255, 255, 255, 0.03);
  --ai-response-border: rgba(255, 255, 255, 0.06);
  --ai-user-bg: rgba(59, 130, 246, 0.08);
  --ai-user-border: rgba(59, 130, 246, 0.15);
  --ai-code-bg: #0c0c0e;
  --ai-code-border: rgba(255, 255, 255, 0.1);
  --ai-code-header-bg: rgba(255, 255, 255, 0.04);
  --ai-code-text: #e4e4e7;
  --ai-avatar-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  --ai-avatar-border: rgba(99, 102, 241, 0.3);
  --ai-accent-bg: rgba(99, 102, 241, 0.12);
  --ai-accent-border: rgba(99, 102, 241, 0.25);
  --ai-btn-bg: rgba(255, 255, 255, 0.06);
  --ai-btn-border: rgba(255, 255, 255, 0.1);
  --ai-btn-hover-bg: rgba(99, 102, 241, 0.15);
  --ai-btn-hover-border: rgba(99, 102, 241, 0.35);
  --ai-input-bg: rgba(255, 255, 255, 0.04);
  --ai-input-border: rgba(255, 255, 255, 0.1);
  --ai-inline-code-bg: rgba(99, 102, 241, 0.12);
  --ai-inline-code-border: rgba(99, 102, 241, 0.2);
  --ai-inline-code-text: #a5b4fc;
}

/* Light Mode */
.light {
  --ai-panel-bg: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  --ai-border: rgba(0, 0, 0, 0.08);
  --ai-text: #3f3f46;
  --ai-muted: #71717a;
  --ai-response-bg: rgba(0, 0, 0, 0.02);
  --ai-response-border: rgba(0, 0, 0, 0.06);
  --ai-user-bg: rgba(59, 130, 246, 0.06);
  --ai-user-border: rgba(59, 130, 246, 0.12);
  --ai-code-bg: #f4f4f5;
  --ai-code-border: rgba(0, 0, 0, 0.08);
  --ai-code-header-bg: rgba(0, 0, 0, 0.03);
  --ai-code-text: #27272a;
  --ai-avatar-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  --ai-avatar-border: rgba(99, 102, 241, 0.2);
  --ai-accent-bg: rgba(99, 102, 241, 0.08);
  --ai-accent-border: rgba(99, 102, 241, 0.15);
  --ai-btn-bg: rgba(0, 0, 0, 0.04);
  --ai-btn-border: rgba(0, 0, 0, 0.08);
  --ai-btn-hover-bg: rgba(99, 102, 241, 0.1);
  --ai-btn-hover-border: rgba(99, 102, 241, 0.25);
  --ai-input-bg: rgba(0, 0, 0, 0.02);
  --ai-input-border: rgba(0, 0, 0, 0.08);
  --ai-inline-code-bg: rgba(99, 102, 241, 0.08);
  --ai-inline-code-border: rgba(99, 102, 241, 0.15);
  --ai-inline-code-text: #4f46e5;
}

/* Coffee Theme */
[data-theme="coffee"] {
  --ai-panel-bg: linear-gradient(180deg, #2c221c 0%, #1a1512 100%);
  --ai-border: rgba(140, 115, 90, 0.15);
  --ai-text: #e5dcd4;
  --ai-muted: #a08a70;
  --ai-response-bg: rgba(140, 115, 90, 0.05);
  --ai-response-border: rgba(140, 115, 90, 0.12);
  --ai-user-bg: rgba(140, 115, 90, 0.1);
  --ai-user-border: rgba(140, 115, 90, 0.2);
  --ai-code-bg: #1a1512;
  --ai-code-border: rgba(140, 115, 90, 0.15);
  --ai-code-text: #e5dcd4;
  --ai-avatar-bg: linear-gradient(135deg, rgba(140, 115, 90, 0.2) 0%, rgba(160, 138, 112, 0.2) 100%);
  --ai-avatar-border: rgba(140, 115, 90, 0.3);
}

/* Pink Theme */
[data-theme="pink"] {
  --ai-panel-bg: linear-gradient(180deg, #fdf2f4 0%, #fff5f7 100%);
  --ai-border: rgba(244, 143, 177, 0.15);
  --ai-text: #4a2c3a;
  --ai-muted: #6d4c5f;
  --ai-response-bg: rgba(244, 143, 177, 0.05);
  --ai-response-border: rgba(244, 143, 177, 0.12);
  --ai-user-bg: rgba(244, 143, 177, 0.1);
  --ai-user-border: rgba(244, 143, 177, 0.2);
  --ai-code-bg: #fff5f7;
  --ai-code-border: rgba(244, 143, 177, 0.15);
  --ai-code-text: #4a2c3a;
  --ai-avatar-bg: linear-gradient(135deg, rgba(244, 143, 177, 0.2) 0%, rgba(240, 98, 146, 0.2) 100%);
  --ai-avatar-border: rgba(244, 143, 177, 0.3);
}

/* Catppuccin Theme */
[data-theme="catppuccin"] {
  --ai-panel-bg: linear-gradient(180deg, #1e1e2e 0%, #181825 100%);
  --ai-border: rgba(137, 180, 250, 0.12);
  --ai-text: #cdd6f4;
  --ai-muted: #a6adc8;
  --ai-response-bg: rgba(137, 180, 250, 0.04);
  --ai-response-border: rgba(137, 180, 250, 0.1);
  --ai-user-bg: rgba(137, 180, 250, 0.08);
  --ai-user-border: rgba(137, 180, 250, 0.15);
  --ai-code-bg: #181825;
  --ai-code-border: rgba(137, 180, 250, 0.12);
  --ai-code-text: #cdd6f4;
  --ai-avatar-bg: linear-gradient(135deg, rgba(137, 180, 250, 0.2) 0%, rgba(180, 190, 254, 0.2) 100%);
  --ai-avatar-border: rgba(137, 180, 250, 0.3);
}

/* Rosepine Theme */
[data-theme="rosepine"] {
  --ai-panel-bg: linear-gradient(180deg, #191724 0%, #1f1d2e 100%);
  --ai-border: rgba(235, 188, 186, 0.12);
  --ai-text: #e0def4;
  --ai-muted: #908caa;
  --ai-response-bg: rgba(235, 188, 186, 0.04);
  --ai-response-border: rgba(235, 188, 186, 0.1);
  --ai-code-bg: #1f1d2e;
  --ai-code-text: #e0def4;
}

/* Nord Theme */
[data-theme="nord"] {
  --ai-panel-bg: linear-gradient(180deg, #2e3440 0%, #3b4252 100%);
  --ai-border: rgba(136, 192, 208, 0.12);
  --ai-text: #eceff4;
  --ai-muted: #d8dee9;
  --ai-response-bg: rgba(136, 192, 208, 0.05);
  --ai-response-border: rgba(136, 192, 208, 0.1);
  --ai-code-bg: #2e3440;
  --ai-code-text: #eceff4;
}

/* Solarized Theme */
[data-theme="solarized"] {
  --ai-panel-bg: linear-gradient(180deg, #002b36 0%, #073642 100%);
  --ai-border: rgba(38, 139, 210, 0.15);
  --ai-text: #93a1a1;
  --ai-muted: #657b83;
  --ai-response-bg: rgba(38, 139, 210, 0.05);
  --ai-response-border: rgba(38, 139, 210, 0.12);
  --ai-code-bg: #073642;
  --ai-code-text: #93a1a1;
}

/* Gruvbox Theme */
[data-theme="gruvbox"] {
  --ai-panel-bg: linear-gradient(180deg, #1d2021 0%, #282828 100%);
  --ai-border: rgba(251, 73, 52, 0.12);
  --ai-text: #ebdbb2;
  --ai-muted: #a89984;
  --ai-response-bg: rgba(251, 73, 52, 0.04);
  --ai-response-border: rgba(251, 73, 52, 0.1);
  --ai-code-bg: #1d2021;
  --ai-code-text: #ebdbb2;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {

  .ai-sidebar,
  .doc-ai-sidebar,
  .whiteboard-ai-sidebar,
  .ai-sidebar-overlay {
    width: 100%;
  }

  .ai-assistant-content {
    padding: 12px;
  }

  .ai-code-pre {
    padding: 12px;
  }
}

/* ============================================
   AI Inline Loading - For **prompt** command
   ============================================ */
.ai-inline-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 12px;
  font-size: 13px;
  color: #a5b4fc;
  margin: 8px 0;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.1);
}

.ai-writing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-writing-icon {
  width: 18px;
  height: 18px;
  color: #818cf8;
  animation: aiWritingIconSpin 2s linear infinite;
}

@keyframes aiWritingIconSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.ai-writing-text {
  font-weight: 500;
  color: #c7d2fe;
}

.ai-writing-dots {
  display: inline-flex;
  gap: 4px;
}

.ai-writing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #818cf8;
  animation: aiWritingDotPulse 1.4s ease-in-out infinite;
}

.ai-writing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.ai-writing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-writing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes aiWritingDotPulse {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* AI Generated Content Styling */
.ai-generated-content {
  display: block;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.04) 0%, transparent 100%);
  border-left: 3px solid rgba(99, 102, 241, 0.4);
  padding: 12px 16px;
  margin: 12px 0;
  border-radius: 0 8px 8px 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.5;
}

.ai-generated-content h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--foreground);
  margin: 0 0 16px 0;
  line-height: 1.3;
}

.ai-generated-content h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  margin: 16px 0 10px 0;
  line-height: 1.35;
}

.ai-generated-content h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--foreground);
  margin: 14px 0 8px 0;
  line-height: 1.4;
}

.ai-generated-content p {
  font-size: 15px;
  line-height: 1.5;
  color: var(--foreground);
  margin: 8px 0;
}

.ai-generated-content ul,
.ai-generated-content ol {
  margin: 8px 0;
  padding-left: 20px;
}

.ai-generated-content li {
  font-size: 15px;
  line-height: 1.5;
  color: var(--foreground);
  margin: 4px 0;
}

.ai-generated-content strong {
  font-weight: 600;
  color: var(--foreground);
}

.ai-generated-content:hover {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
  border-left-color: rgba(99, 102, 241, 0.6);
}


/* ============================================
   Layer Intelligence - Enhanced AI UI/UX
   Liquid Glass Minimalistic Professional Theme
   ============================================ */

/* ============================================
   Enhanced AI Icon Animation
   ============================================ */

/* AI Nav Icon - Morphing Gradient Animation */
.nav-item[data-view="ai"] .icon,
.ai-nav-icon-wrapper {
  position: relative;
  overflow: visible;
}

.ai-nav-icon-animated {
  position: relative;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ai-nav-icon-animated svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.3));
}

.ai-nav-icon-animated .ai-icon-glasses {
  animation: aiIconPulse 4s ease-in-out infinite;
}

.nav-item[data-view="ai"]:hover .ai-nav-icon-animated {
  transform: scale(1.1) rotate(5deg);
}

.nav-item[data-view="ai"]:hover .ai-nav-icon-animated svg {
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.6));
}

@keyframes aiIconPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

/* Colorful gradient effect for AI icon */
.ai-nav-icon-gradient {
  background: linear-gradient(135deg,
      #06b6d4 0%,
      #3b82f6 25%,
      #8b5cf6 50%,
      #ec4899 75%,
      #f97316 100%);
  background-size: 200% 200%;
  animation: aiGradientShift 4s ease-in-out infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes aiGradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* Colorful gradient effect for AI icon */
.ai-nav-icon-gradient {
  background: linear-gradient(135deg,
      #06b6d4 0%,
      #3b82f6 25%,
      #8b5cf6 50%,
      #ec4899 75%,
      #f97316 100%);
  background-size: 200% 200%;
  animation: aiGradientShift 3s ease-in-out infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-item[data-view="ai"] .ai-morph-icon {
  stroke: url(#aiGradient);
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

@keyframes aiGradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* ============================================
   Liquid Glass Effect System
   ============================================ */
:root {
  --glass-blur-strong: 24px;
  --glass-blur-medium: 16px;
  --glass-blur-light: 8px;
  --glass-bg-primary: rgba(255, 255, 255, 0.03);
  --glass-bg-secondary: rgba(255, 255, 255, 0.05);
  --glass-bg-tertiary: rgba(255, 255, 255, 0.08);
  --glass-border-subtle: rgba(255, 255, 255, 0.06);
  --glass-border-normal: rgba(255, 255, 255, 0.1);
  --glass-border-strong: rgba(255, 255, 255, 0.15);
  --glass-gradient-1: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 50%, rgba(236, 72, 153, 0.1) 100%);
  --glass-gradient-2: linear-gradient(180deg, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
  --ai-accent-cyan: #06b6d4;
  --ai-accent-blue: #3b82f6;
  --ai-accent-violet: #8b5cf6;
  --ai-accent-pink: #ec4899;
  --ai-accent-orange: #f97316;
}

.light {
  --glass-bg-primary: rgba(0, 0, 0, 0.02);
  --glass-bg-secondary: rgba(0, 0, 0, 0.03);
  --glass-bg-tertiary: rgba(0, 0, 0, 0.05);
  --glass-border-subtle: rgba(0, 0, 0, 0.04);
  --glass-border-normal: rgba(0, 0, 0, 0.08);
  --glass-border-strong: rgba(0, 0, 0, 0.12);
  --glass-gradient-1: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.08) 50%, rgba(236, 72, 153, 0.08) 100%);
}

/* ============================================
   SuperAgents AI View - Ultra Premium Design
   ============================================ */
.superagents-view {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--background);
}

/* Modern Minimal Background */
.superagents-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
}

.superagents-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.08;
  will-change: transform;
}

.superagents-glow-1 {
  top: -15%;
  left: -15%;
  width: 40vw;
  height: 40vw;
  max-width: 600px;
  max-height: 600px;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
}

.superagents-glow-2 {
  bottom: -15%;
  right: -15%;
  width: 35vw;
  height: 35vw;
  max-width: 500px;
  max-height: 500px;
  background: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 100%);
}

@keyframes glowFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(2%, 2%) scale(1.02);
  }
}

@keyframes glowFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }

  25% {
    transform: translate(8%, 5%) scale(1.08) rotate(2deg);
  }

  50% {
    transform: translate(-5%, 8%) scale(0.95) rotate(-1deg);
  }

  75% {
    transform: translate(-8%, -5%) scale(1.05) rotate(1deg);
  }
}

/* Subtle grid pattern */
.superagents-grid-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.01;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 80px 80px;
}

/* Noise texture overlay for premium feel - REMOVED */
/* .superagents-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
} */

/* Content */
.superagents-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Hero Section - Ultra Premium */
.superagents-hero {
  text-align: center;
  margin-bottom: 56px;
  animation: heroFadeIn 0.8s ease-out;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.superagents-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(59, 130, 246, 0.1) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 9999px;
  color: var(--ai-accent-violet);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 32px;
  box-shadow:
    0 4px 24px rgba(139, 92, 246, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: badgeShimmer 3s ease-in-out infinite;
}

@keyframes badgeShimmer {

  0%,
  100% {
    box-shadow:
      0 4px 24px rgba(139, 92, 246, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  50% {
    box-shadow:
      0 4px 32px rgba(139, 92, 246, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }
}

.superagents-badge-icon {
  width: 18px;
  height: 18px;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(0.95);
  }
}

.superagents-title {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 800;
  line-height: 1.02;
  margin-bottom: 24px;
  letter-spacing: -0.04em;
}

.superagents-title-gradient {
  background: linear-gradient(135deg,
      #06b6d4 0%,
      #3b82f6 25%,
      #8b5cf6 50%,
      #a855f7 75%,
      #ec4899 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.superagents-subtitle {
  font-size: 18px;
  color: var(--muted-foreground);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.75;
  font-weight: 400;
  opacity: 0.9;
}

/* Input Container - Premium Glass */
.superagents-input-wrapper {
  width: 100%;
  max-width: 760px;
  margin-bottom: 64px;
  animation: inputFadeIn 0.8s ease-out 0.2s both;
}

@keyframes inputFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.superagents-input-container {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px 12px 28px;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0.04) 100%);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.05),
    0 8px 40px rgba(0, 0, 0, 0.15),
    0 0 120px rgba(139, 92, 246, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.superagents-input-container:focus-within {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow:
    0 0 0 3px rgba(139, 92, 246, 0.15),
    0 8px 40px rgba(0, 0, 0, 0.2),
    0 0 150px rgba(139, 92, 246, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.superagents-input-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

.superagents-input-icon svg {
  width: 100%;
  height: 100%;
  stroke: url(#aiInputGradient);
}

.superagents-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--foreground);
  padding: 18px 0;
  font-weight: 400;
}

.superagents-input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.6;
}

.superagents-send-btn {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,
      #3b82f6 0%,
      #8b5cf6 40%,
      #a855f7 70%,
      #ec4899 100%);
  background-size: 250% 250%;
  border: none;
  border-radius: 16px;
  color: white;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 4px 20px rgba(139, 92, 246, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: btnIdle 4s ease-in-out infinite;
}

@keyframes btnIdle {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.superagents-send-btn:hover:not(:disabled) {
  transform: scale(1.08) translateY(-2px);
  box-shadow:
    0 12px 40px rgba(139, 92, 246, 0.5),
    0 0 60px rgba(139, 92, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: none;
  background-position: 100% 100%;
}

.superagents-send-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.superagents-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  animation: none;
}

.superagents-send-btn svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Suggestions - Premium Pills */
.superagents-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  animation: suggestFadeIn 0.8s ease-out 0.4s both;
}

@keyframes suggestFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.superagents-suggestion-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.06) 0%,
      rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.superagents-suggestion-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
      rgba(139, 92, 246, 0.15) 0%,
      rgba(59, 130, 246, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.superagents-suggestion-btn:hover {
  border-color: rgba(139, 92, 246, 0.35);
  color: var(--foreground);
  transform: translateY(-3px);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.12),
    0 0 40px rgba(139, 92, 246, 0.1);
}

.superagents-suggestion-btn:hover::before {
  opacity: 1;
}

.superagents-suggestion-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
  position: relative;
  z-index: 1;
}

/* Feature Cards - Premium Glass Cards */
.superagents-features {
  width: 100%;
  animation: featuresFadeIn 0.8s ease-out 0.5s both;
}

@keyframes featuresFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.superagents-features-title {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-foreground);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 36px;
  opacity: 0.6;
}

.superagents-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.superagents-feature-card {
  position: relative;
  text-align: left;
  padding: 32px;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.07) 0%,
      rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.superagents-feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(135deg,
      rgba(139, 92, 246, 0.1) 0%,
      rgba(59, 130, 246, 0.05) 50%,
      rgba(236, 72, 153, 0.05) 100%);
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.superagents-feature-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(139, 92, 246, 0.5) 50%,
      transparent 100%);
  opacity: 0;
  transition: all 0.6s ease;
}

.superagents-feature-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 30px 60px -15px rgba(0, 0, 0, 0.25),
    0 0 80px rgba(139, 92, 246, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.superagents-feature-card:hover::before {
  opacity: 1;
}

.superagents-feature-card:hover::after {
  opacity: 1;
  left: 100%;
}

.superagents-feature-icon {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  margin-bottom: 24px;
  color: white;
  transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.superagents-feature-card:hover .superagents-feature-icon {
  transform: scale(1.12) rotate(3deg);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.25),
    0 0 40px rgba(139, 92, 246, 0.2);
}

.superagents-feature-icon svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.superagents-feature-title {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.superagents-feature-arrow {
  width: 20px;
  height: 20px;
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.superagents-feature-card:hover .superagents-feature-arrow {
  opacity: 0.8;
  transform: translateX(0);
}

.superagents-feature-desc {
  position: relative;
  z-index: 1;
  font-size: 14px;
  color: var(--muted-foreground);
  line-height: 1.7;
  margin: 0;
  opacity: 0.9;
}

/* ============================================
   AI Chat View - Ultra Premium Minimalist Design
   ============================================ */
.ai-chat-view.clickup-style {
  position: relative;
  background: var(--background);
  min-height: 100vh;
  overflow: hidden;
}

/* Premium Ambient Background */
.ai-chat-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ai-chat-ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.06;
  will-change: transform;
}

.ai-chat-orb-1 {
  top: -15%;
  left: -10%;
  width: 60vw;
  max-width: 700px;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 50%, #c084fc 100%);
  animation: chatOrbFloat1 30s ease-in-out infinite;
}

.ai-chat-orb-2 {
  bottom: -20%;
  right: -10%;
  width: 50vw;
  max-width: 600px;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 50%, #06b6d4 100%);
  animation: chatOrbFloat2 35s ease-in-out infinite;
}

.ai-chat-orb-3 {
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  max-width: 1000px;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%);
  opacity: 0.03;
  animation: chatOrbFloat3 40s ease-in-out infinite;
}

@keyframes chatOrbFloat1 {

  0%,
  100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }

  25% {
    transform: translate(5%, 3%) rotate(2deg) scale(1.05);
  }

  50% {
    transform: translate(2%, 6%) rotate(-1deg) scale(1.02);
  }

  75% {
    transform: translate(-3%, 2%) rotate(1deg) scale(0.98);
  }
}

@keyframes chatOrbFloat2 {

  0%,
  100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }

  33% {
    transform: translate(-4%, -5%) rotate(-2deg) scale(1.03);
  }

  66% {
    transform: translate(3%, -2%) rotate(1deg) scale(0.97);
  }
}

@keyframes chatOrbFloat3 {

  0%,
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.03;
  }

  50% {
    transform: translateX(-50%) scale(1.15);
    opacity: 0.05;
  }
}

/* Subtle noise texture */
.ai-chat-ambient::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Micro mesh grid */
.ai-chat-ambient::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.015;
  background-image:
    linear-gradient(var(--foreground) 1px, transparent 1px),
    linear-gradient(90deg, var(--foreground) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

.ai-chat-view.clickup-style .ai-chat-panel {
  position: relative;
  z-index: 1;
  background: transparent;
}

/* Chat Header - Ultra Minimal */
.ai-chat-header.clickup-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(var(--card-rgb, 255, 255, 255), 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.06);
  transition: all 0.3s ease;
}

.ai-chat-header.clickup-header::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ai-chat-header.clickup-header:hover::before {
  opacity: 1;
}

/* Header Left Section */
.ai-chat-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ai-chat-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.08);
  border-radius: 12px;
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-back-btn:hover {
  background: rgba(var(--foreground-rgb, 0, 0, 0), 0.04);
  border-color: rgba(var(--border-rgb, 0, 0, 0), 0.15);
  color: var(--foreground);
  transform: translateX(-2px);
}

.ai-chat-back-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.ai-chat-back-btn:hover svg {
  transform: translateX(-2px);
}

/* Model Selector - Premium Pill */
.ai-model-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.ai-model-selector:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(59, 130, 246, 0.12) 100%);
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.1);
}

.ai-model-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  border-radius: 6px;
  color: white;
  font-size: 10px;
}

.ai-model-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.01em;
}

.ai-model-badge {
  padding: 3px 8px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-model-chevron {
  width: 14px;
  height: 14px;
  color: var(--muted-foreground);
  transition: transform 0.2s ease;
}

.ai-model-selector:hover .ai-model-chevron {
  transform: rotate(180deg);
}

/* Header Right Section */
.ai-chat-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* History Button - Refined */
.ai-chat-history-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.08);
  border-radius: 12px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-history-btn:hover {
  background: rgba(var(--foreground-rgb, 0, 0, 0), 0.04);
  border-color: rgba(139, 92, 246, 0.2);
  color: var(--foreground);
}

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

.ai-chat-history-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: rgba(139, 92, 246, 0.15);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: #8b5cf6;
}

/* Header Action Buttons */
.ai-chat-action-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.08);
  border-radius: 12px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.25s ease;
}

.ai-chat-action-btn:hover {
  background: rgba(var(--foreground-rgb, 0, 0, 0), 0.04);
  border-color: rgba(var(--border-rgb, 0, 0, 0), 0.15);
  color: var(--foreground);
}

.ai-chat-action-btn svg {
  width: 18px;
  height: 18px;
}

/* Messages Container - Premium Scrolling */
.ai-chat-messages.clickup-messages {
  position: relative;
  flex: 1;
  padding: 32px 24px 160px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* Scroll fade at top */
.ai-chat-messages.clickup-messages::before {
  content: '';
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, var(--background), transparent);
  pointer-events: none;
  z-index: 10;
  display: block;
  margin-bottom: -40px;
}

/* Custom Scrollbar */
.ai-chat-messages.clickup-messages::-webkit-scrollbar {
  width: 6px;
}

.ai-chat-messages.clickup-messages::-webkit-scrollbar-track {
  background: transparent;
}

.ai-chat-messages.clickup-messages::-webkit-scrollbar-thumb {
  background: rgba(var(--foreground-rgb, 0, 0, 0), 0.1);
  border-radius: 3px;
}

.ai-chat-messages.clickup-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--foreground-rgb, 0, 0, 0), 0.2);
}

/* Message Container */
.ai-chat-message {
  margin-bottom: 32px;
  animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
  transform: translateY(16px);
}

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

/* User Message - Minimal Elegance */
.ai-chat-message-user {
  display: flex;
  justify-content: flex-end;
}

.ai-chat-bubble-user.clickup-user-bubble {
  position: relative;
  max-width: 70%;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 20px 20px 6px 20px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--foreground);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ai-chat-bubble-user.clickup-user-bubble::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), transparent, rgba(99, 102, 241, 0.1));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ai-chat-bubble-user.clickup-user-bubble:hover::before {
  opacity: 1;
}

/* Assistant Message - Premium Layout */
.ai-chat-message-assistant.clickup-assistant-msg {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

/* AI Avatar - Animated Gradient Ring */
.ai-chat-avatar {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
}

.ai-chat-avatar-ring {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #8b5cf6, #6366f1, #3b82f6, #0ea5e9, #06b6d4, #8b5cf6);
  animation: avatarRingSpin 8s linear infinite;
  opacity: 0.6;
}

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

.ai-chat-avatar-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border-radius: 50%;
  font-size: 18px;
  z-index: 1;
}

/* Agent Name with Gradient */
.ai-chat-agent-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ai-chat-agent-name.clickup-agent-name {
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.01em;
}

.ai-chat-timestamp {
  font-size: 11px;
  color: var(--muted-foreground);
  opacity: 0.6;
}

/* Response Content - Rich Typography */
.ai-chat-content.clickup-content {
  font-size: 15px;
  line-height: 1.5;
  color: var(--foreground);
}

.ai-chat-content.clickup-content p {
  margin-bottom: 10px;
  line-height: 1.5;
}

.ai-chat-content.clickup-content p:last-child {
  margin-bottom: 0;
}

/* Code Blocks - Premium Styling */
.ai-chat-content.clickup-content pre {
  position: relative;
  margin: 12px 0;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.08);
  border-radius: 10px;
  overflow-x: auto;
}

.ai-chat-content.clickup-content code {
  font-family: 'SF Mono', 'Fira Code', 'Monaco', monospace;
  font-size: 13px;
  line-height: 1.5;
}

.ai-chat-content.clickup-content pre code {
  background: transparent;
  padding: 0;
}

/* Inline Code */
.ai-chat-content.clickup-content :not(pre)>code {
  padding: 2px 6px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-radius: 5px;
  color: #8b5cf6;
  font-size: 0.9em;
}

/* Lists */
.ai-chat-content.clickup-content ul,
.ai-chat-content.clickup-content ol {
  margin: 10px 0;
  padding-left: 20px;
}

.ai-chat-content.clickup-content li {
  margin-bottom: 4px;
  line-height: 1.5;
}

.ai-chat-content.clickup-content li::marker {
  color: #8b5cf6;
}

/* Response Actions Bar */
.ai-chat-response-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.05);
}

.ai-response-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-response-action-btn:hover {
  background: rgba(var(--foreground-rgb, 0, 0, 0), 0.04);
  color: var(--foreground);
}

.ai-response-action-btn svg {
  width: 14px;
  height: 14px;
}

.ai-response-action-btn.active {
  color: #8b5cf6;
}

.ai-response-action-btn.active svg {
  fill: currentColor;
}

/* Input Area - Floating Premium Design */
.ai-chat-input-area.clickup-input-area {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 24px 28px;
  background: linear-gradient(to top,
      var(--background) 0%,
      var(--background) 50%,
      rgba(var(--background-rgb, 255, 255, 255), 0.9) 75%,
      transparent 100%);
  z-index: 50;
}

.ai-chat-input-wrapper.clickup-input-wrapper {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

/* Input Glow Effect - Animated */
.ai-chat-input-glow {
  position: absolute;
  inset: -3px;
  border-radius: 20px;
  background: conic-gradient(from 0deg, #8b5cf6, #6366f1, #3b82f6, #0ea5e9, #22c55e, #eab308, #f97316, #ef4444, #ec4899, #8b5cf6);
  background-size: 200% 200%;
  animation: inputGlowRotate 6s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

@keyframes inputGlowRotate {
  0% {
    background-position: 0% 50%;
    transform: rotate(0deg);
  }

  100% {
    background-position: 200% 50%;
    transform: rotate(360deg);
  }
}

.ai-chat-input-wrapper.clickup-input-wrapper:focus-within .ai-chat-input-glow {
  opacity: 0.5;
}

/* Input Box - Glass Morphism */
.ai-chat-input-box.clickup-input-box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  background: rgba(var(--card-rgb, 255, 255, 255), 0.85);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.1);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-input-box.clickup-input-box:focus-within {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.08),
    0 0 0 3px rgba(139, 92, 246, 0.08),
    0 0 80px rgba(139, 92, 246, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Input Field */
.ai-chat-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-chat-input.clickup-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  font-weight: 400;
  color: var(--foreground);
  resize: none;
  min-height: 24px;
  max-height: 200px;
  line-height: 1.6;
  font-family: inherit;
}

.ai-chat-input.clickup-input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.6;
}

/* Input Actions Row */
.ai-chat-input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.06);
}

.ai-chat-input-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-input-tool-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-input-tool-btn:hover {
  background: rgba(var(--foreground-rgb, 0, 0, 0), 0.04);
  color: var(--foreground);
}

.ai-input-tool-btn svg {
  width: 18px;
  height: 18px;
}

.ai-input-tool-btn.active {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

/* Keyboard Hint */
.ai-chat-keyboard-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted-foreground);
  opacity: 0.6;
}

.ai-chat-keyboard-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: rgba(var(--foreground-rgb, 0, 0, 0), 0.05);
  border: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.1);
  border-radius: 4px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
}

/* Send Button - Premium Gradient */
.ai-chat-send-btn.clickup-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
  border: none;
  border-radius: 14px;
  color: white;
  cursor: pointer;
  box-shadow:
    0 4px 16px rgba(139, 92, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-send-btn.clickup-send-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 8px 24px rgba(139, 92, 246, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.ai-chat-send-btn.clickup-send-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.ai-chat-send-btn.clickup-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.ai-chat-send-btn.clickup-send-btn svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   History Sidebar - Premium Glass Panel
   ============================================ */
.ai-history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
}

.ai-history-overlay.active {
  opacity: 1;
  visibility: visible;
}

.ai-history-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  background: rgba(var(--card-rgb, 255, 255, 255), 0.92);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-left: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.08);
  box-shadow: -20px 0 80px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 101;
  display: flex;
  flex-direction: column;
}

.ai-history-sidebar.active {
  transform: translateX(0);
}

.ai-history-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.06);
}

.ai-history-sidebar-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.01em;
}

.ai-history-sidebar-header h3 svg {
  width: 18px;
  height: 18px;
  color: #8b5cf6;
}

.ai-history-close-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.08);
  border-radius: 10px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-history-close-btn:hover {
  background: rgba(var(--foreground-rgb, 0, 0, 0), 0.04);
  color: var(--foreground);
}

.ai-history-close-btn svg {
  width: 16px;
  height: 16px;
}

/* History Search */
.ai-history-search {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.06);
}

.ai-history-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(var(--foreground-rgb, 0, 0, 0), 0.03);
  border: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.06);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.ai-history-search-box:focus-within {
  background: transparent;
  border-color: rgba(139, 92, 246, 0.25);
}

.ai-history-search-box svg {
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
}

.ai-history-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--foreground);
}

.ai-history-search-box input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.6;
}

.ai-history-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* History Items - Premium Cards */
.ai-history-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  margin-bottom: 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.ai-history-item:hover {
  background: rgba(var(--foreground-rgb, 0, 0, 0), 0.03);
  border-color: rgba(var(--border-rgb, 0, 0, 0), 0.08);
}

.ai-history-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-color: rgba(139, 92, 246, 0.15);
}

.ai-history-item-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--foreground-rgb, 0, 0, 0), 0.04);
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.2s ease;
}

.ai-history-item:hover .ai-history-item-icon {
  background: rgba(139, 92, 246, 0.1);
}

.ai-history-item-content {
  flex: 1;
  min-width: 0;
}

.ai-history-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-history-item-preview {
  font-size: 12px;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.ai-history-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted-foreground);
  opacity: 0.7;
}

.ai-history-item-delete {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted-foreground);
  opacity: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-history-item:hover .ai-history-item-delete {
  opacity: 1;
}

.ai-history-item-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.ai-history-item-delete svg {
  width: 14px;
  height: 14px;
}

/* History Footer */
.ai-history-sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.06);
}

.ai-history-new-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
  transition: all 0.25s ease;
}

.ai-history-new-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.35);
}

.ai-history-new-btn svg {
  width: 18px;
  height: 18px;
}

/* Empty State */
.ai-history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.ai-history-empty-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.08);
  border-radius: 20px;
  margin-bottom: 20px;
}

.ai-history-empty-icon svg {
  width: 28px;
  height: 28px;
  color: #8b5cf6;
  opacity: 0.6;
}

.ai-history-empty p {
  font-size: 15px;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 6px;
}

.ai-history-empty span {
  font-size: 13px;
  color: var(--muted-foreground);
}

/* ============================================
   Loading Animation - Premium Dots
   ============================================ */
.ai-chat-loading {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 0;
}

.ai-loading-dot {
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  border-radius: 50%;
  animation: loadingDotBounce 1.4s ease-in-out infinite;
}

.ai-loading-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.ai-loading-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes loadingDotBounce {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }

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

/* Typing Indicator Text */
.ai-typing-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(139, 92, 246, 0.06);
  border-radius: 12px;
}

.ai-typing-indicator-text {
  font-size: 13px;
  color: var(--muted-foreground);
  font-style: italic;
}

/* ============================================
   Follow-up Suggestions - Premium Pills
   ============================================ */
.ai-chat-followups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.ai-chat-followup-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.1);
  border-radius: 20px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-followup-btn:hover {
  background: rgba(139, 92, 246, 0.06);
  border-color: rgba(139, 92, 246, 0.2);
  color: var(--foreground);
  transform: translateY(-2px);
}

.ai-chat-followup-btn svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

.ai-chat-followup-btn:hover svg {
  opacity: 1;
  color: #8b5cf6;
}

/* ============================================
   Context Menu - Floating Actions
   ============================================ */
.ai-context-menu {
  position: absolute;
  min-width: 180px;
  background: rgba(var(--card-rgb, 255, 255, 255), 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(var(--border-rgb, 0, 0, 0), 0.1);
  border-radius: 14px;
  padding: 6px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 200;
  animation: contextMenuIn 0.2s ease;
}

@keyframes contextMenuIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.ai-context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.ai-context-menu-item:hover {
  background: rgba(139, 92, 246, 0.08);
}

.ai-context-menu-item svg {
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
}

.ai-context-menu-item.destructive:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

.ai-context-menu-item.destructive:hover svg {
  color: #ef4444;
}

.ai-context-menu-divider {
  height: 1px;
  background: rgba(var(--border-rgb, 0, 0, 0), 0.08);
  margin: 6px 0;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
  .ai-chat-header.clickup-header {
    padding: 12px 16px;
  }

  .ai-model-selector {
    display: none;
  }

  .ai-chat-messages.clickup-messages {
    padding: 24px 16px 140px;
  }

  .ai-chat-bubble-user.clickup-user-bubble {
    max-width: 85%;
  }

  .ai-chat-input-area.clickup-input-area {
    padding: 0 16px 20px;
  }

  .ai-chat-input-box.clickup-input-box {
    padding: 12px 16px;
    border-radius: 14px;
  }

  .ai-chat-input-actions {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .ai-chat-input-tools {
    justify-content: center;
  }

  .ai-chat-keyboard-hint {
    display: none;
  }

  .ai-history-sidebar {
    width: 100%;
  }
}

/* ============================================
   Light Theme Refinements
   ============================================ */
.light .ai-chat-input-box.clickup-input-box {
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.04),
    0 1px 3px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.light .ai-history-sidebar {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.06);
}

.light .ai-chat-bubble-user.clickup-user-bubble {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(99, 102, 241, 0.05) 100%);
}

/* Dark Theme Enhancements */
.dark .ai-chat-ambient-orb {
  opacity: 0.08;
}

.dark .ai-chat-input-box.clickup-input-box {
  background: rgba(30, 30, 40, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
}

.dark .ai-chat-header.clickup-header {
  background: rgba(20, 20, 30, 0.8);
}

.dark .ai-history-sidebar {
  background: rgba(20, 20, 30, 0.95);
}

/* ============================================
   Light Theme Refinements
   ============================================ */
.light .superagents-input-container {
  box-shadow:
    0 0 0 1px var(--glass-border-subtle),
    0 4px 32px rgba(0, 0, 0, 0.06),
    0 0 80px rgba(139, 92, 246, 0.05);
}

.light .superagents-feature-card {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.light .superagents-feature-card:hover {
  box-shadow:
    0 20px 50px -10px rgba(0, 0, 0, 0.1),
    0 0 60px rgba(139, 92, 246, 0.05);
}

.light .ai-history-sidebar {
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.08);
}

.light .ai-chat-input-area.clickup-input-area {
  background: linear-gradient(to top,
      var(--background) 0%,
      var(--background) 60%,
      transparent 100%);
}

/* ============================================
   Enhanced AI View - Professional Styling
   ============================================ */

/* Title Sub Line */
.superagents-title-sub {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  opacity: 0.6;
  margin-bottom: 16px;
}

/* Stats Mini Badge */
.ai-stats-mini {
  display: inline-flex;
  align-items: center;
  margin-right: 12px;
}

.ai-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--glass-bg-secondary);
  border: 1px solid var(--glass-border-subtle);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.ai-stat-badge svg {
  color: var(--ai-accent-violet);
}

/* Badge Pulse Animation */
.superagents-badge-pulse {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--ai-accent-violet);
  border-radius: 50%;
  left: 12px;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }
}

.superagents-badge {
  position: relative;
  padding-left: 28px;
}

/* Feature Badge */
.superagents-feature-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--ai-accent-violet), var(--ai-accent-pink));
  border-radius: 12px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: white;
  text-transform: uppercase;
  z-index: 2;
}

/* Input Glow Effect */
.superagents-input-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110%;
  height: 120%;
  background: radial-gradient(ellipse at center,
      rgba(139, 92, 246, 0.15) 0%,
      transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.superagents-input-wrapper:focus-within .superagents-input-glow {
  opacity: 1;
}

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

/* Voice Button */
.superagents-voice-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--glass-border-subtle);
  border-radius: 10px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.2s ease;
}

.superagents-voice-btn:hover {
  background: var(--glass-bg-secondary);
  border-color: var(--ai-accent-violet);
  color: var(--ai-accent-violet);
}

.superagents-voice-btn svg {
  width: 18px;
  height: 18px;
}

/* Capabilities Footer */
.superagents-capabilities {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--glass-border-subtle);
}

.superagents-capability {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted-foreground);
  opacity: 0.7;
}

.superagents-capability svg {
  width: 16px;
  height: 16px;
  color: var(--ai-accent-violet);
}

/* Enhanced Suggestions */
.superagents-suggestions {
  margin-top: 16px;
}

.superagents-suggestion-btn {
  padding: 10px 16px;
  font-size: 12.5px;
  border-radius: 20px;
  background: var(--glass-bg-primary);
  border: 1px solid var(--glass-border-subtle);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.superagents-suggestion-btn:hover {
  background: var(--glass-bg-tertiary);
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--foreground);
  transform: translateY(-2px);
}

/* Top Actions Layout */
.superagents-top-actions {
  display: flex;
  align-items: center;
}

/* Particles Background (placeholder) */
.superagents-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  .superagents-capabilities {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }

  .ai-stats-mini {
    display: none;
  }

  .superagents-title-sub {
    font-size: 11px;
  }
}


.kanban-column.kanban-done .kanban-column-header {
  border-left: 3px solid #22c55e;
  padding-left: 12px;
  margin-left: -12px;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.kanban-column-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.kanban-column-count {
  padding: 4px 10px;
  background: var(--surface);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
}

.kanban-column-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100px;
}

.kanban-card {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kanban-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kanban-card.completed {
  opacity: 0.6;
}

.kanban-card.overdue {
  border-left: 3px solid #ef4444;
}

.kanban-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 8px;
  line-height: 1.4;
}

.kanban-card-subject {
  font-size: 12px;
  color: #818cf8;
  margin-bottom: 10px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.priority-dot.priority-high {
  background: #ef4444;
}

.priority-dot.priority-medium {
  background: #fbbf24;
}

.priority-dot.priority-low {
  background: #22c55e;
}

.kanban-card-due {
  font-size: 11px;
  color: var(--muted-foreground);
}

/* ============================================
   Right Sidebar - Upcoming Panel
   ============================================ */
.assignments-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.assignments-upcoming-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  position: sticky;
  top: 24px;
}

.upcoming-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.upcoming-header svg {
  width: 18px;
  height: 18px;
  color: #fbbf24;
}

.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upcoming-item {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upcoming-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateX(4px);
}

.upcoming-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 6px;
}

.upcoming-item-due {
  font-size: 12px;
  color: var(--muted-foreground);
}

/* ============================================
   Quick Stats Widget
   ============================================ */
.quick-stats-widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.quick-stats-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.quick-stats-header svg {
  width: 18px;
  height: 18px;
  color: #3b82f6;
}

.quick-stats-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 80px;
  gap: 8px;
}

.chart-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.chart-bar {
  width: 100%;
  max-width: 32px;
  background: linear-gradient(180deg, #3b82f6, #6366f1);
  border-radius: 4px 4px 0 0;
  transition: height 0.4s ease;
}

.chart-bar.muted {
  background: var(--foreground);
}

.chart-label {
  font-size: 10px;
  color: var(--muted-foreground);
  font-weight: 500;
}


/* ============================================
   Calendar Integration Widget
   ============================================ */
.calendar-widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.calendar-nav {
  display: flex;
  gap: 4px;
}

.calendar-nav-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

.calendar-nav-btn:hover {
  background: var(--surface);
  color: var(--foreground);
}

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

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day-header {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted-foreground);
  padding: 8px 0;
  text-transform: uppercase;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.calendar-day:hover {
  background: var(--surface);
  color: var(--foreground);
}

.calendar-day.today {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kanban-card {
  animation: fadeInUp 0.3s ease forwards;
}

/* Scrollbar Styles */
.kanban-column-content::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.kanban-column-content::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 4px;
}

.kanban-column-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.kanban-column-content::-webkit-scrollbar-thumb:hover {
  background: var(--muted-foreground);
}

/* Form Styles for Modal */
.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group.flex-1 {
  flex: 1;
}

.form-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--foreground);
  resize: vertical;
  font-family: inherit;
}

.form-textarea:focus {
  border-color: rgba(99, 102, 241, 0.5);
  outline: none;
}

.form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--foreground);
  cursor: pointer;
}

.existing-files {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: 6px;
}

.existing-files-label {
  font-size: 12px;
  color: var(--muted-foreground);
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  z-index: 9999;
  animation: toastSlideIn 0.3s ease forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast-notification.success {
  border-left: 3px solid #22c55e;
}

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

/* ============================================
   Professional Mini Calendar - Assignments
   ============================================ */
.mini-calendar-pro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.mini-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.mini-cal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.01em;
}

.mini-cal-nav {
  display: flex;
  gap: 2px;
}

.mini-cal-nav-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mini-cal-nav-btn:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.mini-cal-nav-btn svg {
  width: 14px;
  height: 14px;
}

.mini-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: 8px;
}

.mini-cal-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.mini-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.mini-cal-day:hover:not(.prev-month):not(.next-month) {
  background: var(--surface-hover);
}

.mini-cal-day.prev-month,
.mini-cal-day.next-month {
  color: var(--muted-foreground);
  opacity: 0.4;
  pointer-events: none;
}

.mini-cal-day.weekend:not(.today) {
  color: #ef4444;
  opacity: 0.7;
}

.mini-cal-day.today {
  background: #5c5cf7;
  color: var(--primary-foreground);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.mini-cal-day.today:hover {
  background: var(--primary);
  opacity: 0.9;
}

.mini-cal-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: #3b82f6;
  border-radius: 50%;
}

.mini-cal-day.today.has-event::after {
  background: var(--primary-foreground);
}

.mini-cal-day.overdue::after {
  background: #ef4444;
}

/* ============================================
   SuperAgents V2 - Advanced UIUX
   ============================================ */
.superagents-v2 {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  overflow-x: hidden;
}

/* Ambient Background System */
.sa-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sa-ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.08;
  will-change: transform;
}

.sa-orb-1 {
  top: -20%;
  left: 5%;
  width: 50vw;
  max-width: 600px;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  animation: orbFloat1 25s ease-in-out infinite;
}

.sa-orb-2 {
  bottom: -20%;
  right: 5%;
  width: 45vw;
  max-width: 550px;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  animation: orbFloat2 30s ease-in-out infinite;
}

.sa-orb-3 {
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  width: 60vw;
  max-width: 800px;
  aspect-ratio: 1;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  opacity: 0.04;
  animation: orbFloat3 35s ease-in-out infinite;
}

@keyframes orbFloat1 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(3%, 5%) scale(1.05);
  }

  66% {
    transform: translate(-3%, 2%) scale(0.95);
  }
}

@keyframes orbFloat2 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(-4%, -3%) scale(0.98);
  }

  66% {
    transform: translate(5%, -2%) scale(1.03);
  }
}

@keyframes orbFloat3 {

  0%,
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.04;
  }

  50% {
    transform: translateX(-50%) scale(1.1);
    opacity: 0.06;
  }
}

.sa-noise-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.sa-mesh-grid {
  position: absolute;
  inset: 0;
  opacity: 0.02;
  background-image:
    linear-gradient(var(--foreground) 1px, transparent 1px),
    linear-gradient(90deg, var(--foreground) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* History Panel */
.sa-history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
}

.sa-history-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sa-history-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  background: var(--card);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 101;
  display: flex;
  flex-direction: column;
}

.sa-history-panel.open {
  transform: translateX(0);
}

.sa-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.sa-history-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
}

.sa-history-title svg {
  width: 18px;
  height: 18px;
  color: var(--muted-foreground);
}

.sa-panel-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s;
}

.sa-panel-close:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.sa-panel-close svg {
  width: 18px;
  height: 18px;
}

.sa-history-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.sa-history-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.sa-new-chat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.sa-new-chat-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

/* Top Navigation Bar */
.sa-topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.sa-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sa-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 20px;
}

.sa-status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }

  50% {
    opacity: 0.8;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
  }
}

.sa-status-text {
  font-size: 12px;
  font-weight: 500;
  color: #22c55e;
}

.sa-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sa-stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--muted-foreground);
}

.sa-stat-chip svg {
  width: 14px;
  height: 14px;
  color: #f59e0b;
}

.sa-topbar-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s;
}

.sa-topbar-btn:hover {
  background: var(--surface-hover);
  color: var(--foreground);
  border-color: var(--muted-foreground);
}

.sa-topbar-btn svg {
  width: 18px;
  height: 18px;
}

/* Main Content */
.sa-main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px 48px;
}

.sa-container {
  width: 100%;
  max-width: 900px;
}

/* Hero Section */
.sa-hero {
  text-align: center;
  padding: 40px 0 48px;
}

.sa-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 24px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.sa-badge-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.15), transparent);
  animation: badgeShine 3s ease-in-out infinite;
}

@keyframes badgeShine {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.sa-hero-badge svg {
  width: 16px;
  height: 16px;
  color: #8b5cf6;
  position: relative;
}

.sa-hero-badge span {
  font-size: 13px;
  font-weight: 500;
  color: #a78bfa;
  position: relative;
}

.sa-badge-divider {
  width: 1px;
  height: 12px;
  background: rgba(139, 92, 246, 0.3);
}

.sa-badge-status {
  color: #22c55e !important;
}

.sa-hero-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.sa-greeting {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 500;
  color: var(--muted-foreground);
}

.sa-title-main {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--foreground) 0%, var(--muted-foreground) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.sa-hero-subtitle {
  font-size: 16px;
  color: var(--muted-foreground);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Command Input System */
.sa-command-section {
  margin-bottom: 48px;
}

.sa-command-wrapper {
  position: relative;
}

.sa-command-glow {
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.sa-command-wrapper:focus-within .sa-command-glow {
  opacity: 1;
}

.sa-command-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sa-command-box:focus-within {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow:
    0 4px 32px rgba(0, 0, 0, 0.08),
    0 0 0 3px rgba(139, 92, 246, 0.1),
    0 0 60px rgba(139, 92, 246, 0.06);
}

.sa-command-prefix {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--muted-foreground);
}

.sa-command-prefix svg {
  width: 100%;
  height: 100%;
}

.sa-command-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--foreground);
  padding: 14px 0;
  font-weight: 400;
}

.sa-command-input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.7;
}

.sa-command-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sa-cmd-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sa-voice-btn {
  background: transparent;
  color: var(--muted-foreground);
}

.sa-voice-btn:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.sa-send-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
}

.sa-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.35);
}

.sa-cmd-btn svg {
  width: 20px;
  height: 20px;
}

/* Quick Command Pills */
.sa-quick-commands {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.sa-quick-cmd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sa-quick-cmd:hover {
  background: var(--surface-hover);
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--foreground);
  transform: translateY(-2px);
}

.sa-quick-cmd svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

/* Capabilities Section */
.sa-capabilities {
  margin-bottom: 48px;
}

.sa-section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.sa-section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.sa-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.sa-caps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.sa-cap-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  animation: capCardIn 0.4s ease forwards;
  animation-delay: var(--delay);
  opacity: 0;
  transform: translateY(10px);
}

@keyframes capCardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sa-cap-card:hover {
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.sa-cap-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 12px;
  color: var(--accent);
  transition: transform 0.25s ease;
}

.sa-cap-card:hover .sa-cap-icon {
  transform: scale(1.08);
}

.sa-cap-icon svg {
  width: 22px;
  height: 22px;
}

.sa-cap-content {
  flex: 1;
  min-width: 0;
}

.sa-cap-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 4px;
}

.sa-cap-desc {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sa-cap-arrow {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--muted-foreground);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.2s ease;
}

.sa-cap-card:hover .sa-cap-arrow {
  opacity: 1;
  transform: translateX(0);
}

.sa-cap-badge {
  position: absolute;
  top: -8px;
  right: 12px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: white;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 20px;
}

/* Suggestions */
.sa-suggestions {
  text-align: center;
  margin-bottom: 48px;
}

.sa-suggestions-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 16px;
}

.sa-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.sa-suggestion {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted-foreground);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sa-suggestion:hover {
  background: var(--surface);
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--foreground);
}

.sa-suggestion svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  transition: all 0.2s ease;
}

.sa-suggestion:hover svg {
  opacity: 0.6;
}

/* Footer */
.sa-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.sa-footer-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted-foreground);
}

.sa-footer-stat svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

/* Light mode adjustments */
.light .sa-command-box {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
}

.light .sa-quick-cmd,
.light .sa-cap-card {
  background: rgba(255, 255, 255, 0.8);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .sa-topbar {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .sa-stat-chip {
    display: none;
  }

  .sa-hero {
    padding: 24px 0 32px;
  }

  .sa-hero-badge {
    padding: 6px 12px;
  }

  .sa-hero-badge span {
    font-size: 12px;
  }

  .sa-main {
    padding: 0 16px 32px;
  }

  .sa-command-box {
    padding: 6px 8px 6px 16px;
  }

  .sa-command-input {
    font-size: 15px;
    padding: 12px 0;
  }

  .sa-cmd-btn {
    width: 38px;
    height: 38px;
  }

  .sa-quick-commands {
    gap: 6px;
  }

  .sa-quick-cmd {
    padding: 8px 12px;
    font-size: 12px;
  }

  .sa-caps-grid {
    grid-template-columns: 1fr;
  }

  .sa-suggestions-list {
    flex-direction: column;
    align-items: center;
  }

  .sa-footer {
    gap: 16px;
  }

  .sa-history-panel {
    width: 100%;
  }
}

/* ============================================
   Google Calendar Style Time Picker
   ============================================ */
.time-picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.time-picker-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  min-width: 40px;
}

.time-picker-select-wrapper {
  position: relative;
  flex: 1;
}

.time-picker-select {
  width: 100%;
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--foreground);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.time-picker-select:hover {
  border-color: var(--muted-foreground);
}

.time-picker-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px hsla(217, 91%, 60%, 0.15);
}

.time-picker-select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--muted-foreground);
  pointer-events: none;
}

.time-picker-divider {
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 500;
}

.time-duration-hint {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 8px;
  padding-left: 52px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-duration-hint svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

/* All Day Toggle */
.all-day-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.all-day-toggle:hover {
  background: var(--surface-hover);
}

.all-day-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.all-day-toggle label {
  font-size: 14px;
  color: var(--foreground);
  cursor: pointer;
  user-select: none;
}

/* Time picker dropdown scrollable */
.time-picker-select option {
  padding: 8px 12px;
}

/* Time group container */
.time-picker-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.time-picker-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
}

.time-picker-group-header svg {
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
}

/* Quick duration buttons */
.quick-duration-btns {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.quick-duration-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s;
}

.quick-duration-btn:hover {
  background: var(--accent);
  color: var(--foreground);
  border-color: var(--muted-foreground);
}

.quick-duration-btn.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* ============================================
   Collapsible Form Sections
   ============================================ */
.form-group-collapsible {
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.form-collapsible-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.form-collapsible-header:hover {
  background: var(--muted);
}

.form-collapsible-header:not(.collapsed) {
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}

.form-collapsible-header svg:first-child {
  color: var(--muted-foreground);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.form-collapsible-header span {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--foreground);
}

.form-collapsible-chevron {
  width: 12px;
  height: 12px;
  color: var(--muted-foreground);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.form-collapsible-header:not(.collapsed) .form-collapsible-chevron {
  transform: rotate(180deg);
}

.form-collapsible-content {
  padding: 12px;
}

.form-collapsible-content.collapsed {
  display: none;
}

/* Repeat Section Specific Styles */
.repeat-summary-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 10px;
  margin-left: auto;
  margin-right: 8px;
}

.repeat-options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.repeat-custom-days {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.repeat-days-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.repeat-day-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
}

.repeat-day-chip input {
  display: none;
}

.repeat-day-chip:hover {
  background: var(--accent);
  border-color: var(--muted-foreground);
}

.repeat-day-chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

.repeat-end-options {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.form-group-inline {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group-inline label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.form-select-sm {
  padding: 8px 12px;
  font-size: 13px;
}

.form-input-sm {
  padding: 8px 12px;
  font-size: 13px;
}

.form-row-triple {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.form-row-triple > * {
  min-width: 0;
}

@media (max-width: 500px) {
  .form-row-triple {
    grid-template-columns: 1fr;
  }

  .repeat-days-grid {
    justify-content: center;
  }
}

/* ============================================
   Time Display Info (for drag-created events)
   ============================================ */
.time-display-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--surface), var(--muted));
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
}

.time-display-info svg {
  color: var(--primary);
  flex-shrink: 0;
}

.time-display-range {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.01em;
}

.time-display-duration {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-left: auto;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.time-hint-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted-foreground);
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.time-hint-text svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* ============================================
   Drag-to-Create Preview (Google Calendar Style)
   ============================================ */
.drag-create-preview {
  position: absolute;
  left: 4px;
  right: 4px;
  min-height: 40px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.85), rgba(99, 102, 241, 0.85));
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  animation: dragPreviewPulse 1.5s ease-in-out infinite;
  overflow: hidden;
}

@keyframes dragPreviewPulse {

  0%,
  100% {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  }

  50% {
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.6);
  }
}

.drag-preview-content {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  height: 100%;
}

.drag-preview-time {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.drag-preview-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 2px;
}

/* Week/Day Column Drag Cursor */
.week-day-column,
.day-events-column {
  cursor: crosshair;
}

.week-day-column:active,
.day-events-column:active {
  cursor: grabbing;
}

/* Prevent text selection during drag */
.week-day-column.dragging,
.day-events-column.dragging {
  user-select: none;
  -webkit-user-select: none;
}

/* Hover hint for empty slots */
.week-day-column::before,
.day-events-column::before {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
  transition: background 0.15s ease;
}

.week-day-column:hover::before,
.day-events-column:hover::before {
  background: rgba(59, 130, 246, 0.03);
}

/* ============================================
   Drag Move Preview (Moving existing events)
   ============================================ */
.drag-move-preview {
  position: absolute;
  left: 4px;
  right: 4px;
  min-height: 40px;
  background: #3b82f6;
  border: 2px dashed rgba(255, 255, 255, 0.5);
  border-left: 4px solid #2563eb;
  border-radius: 6px;
  z-index: 150;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  display: flex;
  overflow: hidden;
  opacity: 0.9;
  animation: dragMoveFadeIn 0.15s ease-out;
}

@keyframes dragMoveFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 0.9;
    transform: scale(1);
  }
}

.drag-move-preview-bar {
  display: none;
  /* Hide bar, using full background now */
}

.drag-move-preview-content {
  flex: 1;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drag-move-preview-title {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.drag-move-preview-time {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

/* Dragging state for event cards - Google Calendar style */
.week-event-card.dragging {
  opacity: 0.35;
  transform: scale(0.96);
  box-shadow: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Column highlight when dragging over */
.week-day-column.drag-over,
.day-events-column.drag-over {
  background: rgba(59, 130, 246, 0.08) !important;
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.2);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

/* Time slot highlight lines when dragging */
.week-day-column.drag-over::after,
.day-events-column.drag-over::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(to bottom,
      transparent,
      transparent 19px,
      rgba(59, 130, 246, 0.1) 19px,
      rgba(59, 130, 246, 0.1) 20px);
  pointer-events: none;
  z-index: 1;
}


/* Smooth transitions for week event cards */
.week-event-card {
  transition: box-shadow 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}


/* ============================================
   Current Time Indicator (Google Calendar style)
   ============================================ */
.current-time-indicator {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #ea4335;
  z-index: 20;
  pointer-events: none;
}

.current-time-indicator::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: #ea4335;
  border-radius: 50%;
}

/* Light mode adjustment */
.light .current-time-indicator {
  background: #d93025;
}

.light .current-time-indicator::before {
  background: #d93025;
}

/* ============================================
   Color Picker Buttons for Calendar Tasks
   ============================================ */
.color-picker-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.color-picker-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.color-picker-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.color-picker-btn.selected {
  border-color: var(--foreground);
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.color-picker-btn.selected::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Light mode adjustments */
.light .color-picker-btn.selected {
  border-color: var(--foreground);
}

.light .color-picker-btn[data-color="yellow"].selected::after {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ============================================
   AGENDA VIEW - Professional List View
   ============================================ */
.agenda-view-container {
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.agenda-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.agenda-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.agenda-summary-count {
  font-size: 32px;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.02em;
}

.agenda-summary-text {
  font-size: 14px;
  color: var(--muted-foreground);
}

.agenda-search-input {
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--foreground);
  width: 240px;
  transition: all 0.2s;
}

.agenda-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.agenda-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.agenda-day-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.agenda-day-group.is-today {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 4px 20px rgba(59, 130, 246, 0.1);
}

.agenda-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.agenda-day-group.is-today .agenda-day-header {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.08));
}

.agenda-date-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.agenda-day-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.agenda-day-group.is-today .agenda-day-name {
  color: var(--primary);
}

.agenda-full-date {
  font-size: 12px;
  color: var(--muted-foreground);
}

.agenda-event-count {
  font-size: 12px;
  color: var(--muted-foreground);
  padding: 4px 10px;
  background: var(--muted);
  border-radius: 999px;
}

.agenda-events-list {
  display: flex;
  flex-direction: column;
}

.agenda-event-card {
  display: flex;
  align-items: stretch;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}

.agenda-event-card:last-child {
  border-bottom: none;
}

.agenda-event-card:hover {
  background: var(--surface);
}

.agenda-event-time-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 80px;
  flex-shrink: 0;
}

.agenda-event-time {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.agenda-event-duration {
  font-size: 12px;
  color: var(--muted-foreground);
}

.agenda-event-color-bar {
  width: 4px;
  border-radius: 4px;
  flex-shrink: 0;
}

.agenda-event-content {
  flex: 1;
  min-width: 0;
}

.agenda-event-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 4px;
}

.agenda-event-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted-foreground);
  margin-bottom: 4px;
}

.agenda-event-location svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.agenda-event-description {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.4;
}

.agenda-event-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}

.agenda-event-card:hover .agenda-event-actions {
  opacity: 1;
}

.agenda-action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s;
}

.agenda-action-btn:hover {
  background: var(--card);
  color: var(--foreground);
  border-color: var(--muted-foreground);
}

.agenda-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

.agenda-action-btn svg {
  width: 16px;
  height: 16px;
}

.agenda-empty-state {
  text-align: center;
  padding: 80px 40px;
}

.agenda-empty-state svg {
  width: 80px;
  height: 80px;
  color: var(--muted-foreground);
  opacity: 0.4;
  margin-bottom: 24px;
}

.agenda-empty-state h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 8px;
}

.agenda-empty-state p {
  font-size: 14px;
  color: var(--muted-foreground);
  margin-bottom: 24px;
}

/* ============================================
   YEAR VIEW - 12-Month Overview Grid
   ============================================ */
.year-view-container {
  padding: 24px;
}

.year-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
}

.year-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.02em;
  min-width: 120px;
  text-align: center;
}

.year-nav-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s;
}

.year-nav-btn:hover {
  background: var(--card);
  color: var(--foreground);
  border-color: var(--muted-foreground);
}

.year-nav-btn svg {
  width: 20px;
  height: 20px;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1200px) {
  .year-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .year-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .year-grid {
    grid-template-columns: 1fr;
  }
}

.year-month-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.year-month-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.year-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.year-month-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
}

.year-month-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(59, 130, 246, 0.1);
  padding: 3px 8px;
  border-radius: 999px;
}

.year-month-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.year-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.year-weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted-foreground);
  padding: 4px 0;
}

.year-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.year-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--foreground);
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  transition: all 0.15s;
}

.year-day:hover:not(.empty) {
  background: var(--surface);
}

.year-day.empty {
  cursor: default;
}

.year-day.today {
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
}

.year-day.has-events::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--primary);
  border-radius: 50%;
}

.year-day.today.has-events::after {
  background: var(--primary-foreground);
}

.year-day-dots {
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1px;
}

.year-day-dots span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
}

/* ============================================
   ADVANCED EVENT MODAL
   ============================================ */
.modal-large .modal-content {
  max-width: 560px;
}

.advanced-event-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group-large {
  margin-bottom: 8px;
}

.form-input-title {
  font-size: 22px;
  font-weight: 600;
  padding: 12px 0;
  border: none;
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  background: transparent;
  transition: border-color 0.2s;
}

.form-input-title:focus {
  border-bottom-color: var(--primary);
  outline: none;
  box-shadow: none;
}

.form-input-title::placeholder {
  color: var(--muted-foreground);
  font-weight: 400;
}

.event-type-tabs {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: var(--surface);
  border-radius: 10px;
  margin-bottom: 8px;
}

.event-type-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s;
}

.event-type-tab:hover {
  color: var(--foreground);
  background: var(--card);
}

.event-type-tab.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.event-type-tab svg {
  width: 16px;
  height: 16px;
}

.form-section {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.form-section-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.form-section-icon svg {
  width: 20px;
  height: 20px;
}

.form-section-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-section-expanded .form-section-content {
  margin-top: 4px;
}

.all-day-toggle-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.all-day-toggle-inline input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.all-day-toggle-inline span {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.date-time-grid {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.datetime-inputs {
  display: flex;
  gap: 8px;
}

.form-input-date {
  padding: 10px 12px;
  font-size: 14px;
}

.form-select-time {
  min-width: 100px;
}

.datetime-separator {
  color: var(--muted-foreground);
  padding: 10px 0;
}

.datetime-separator svg {
  width: 16px;
  height: 16px;
}

.form-label-mini {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  display: block;
}

.quick-duration-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.quick-dur-chip {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s;
}

.quick-dur-chip:hover {
  background: var(--surface);
  color: var(--foreground);
  border-color: var(--muted-foreground);
}

.quick-dur-chip.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.form-select-recurrence {
  max-width: 200px;
}

.category-color-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.form-select-category {
  flex: 1;
  min-width: 140px;
}

.color-picker-row {
  display: flex;
  gap: 6px;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.color-dot:hover {
  transform: scale(1.15);
}

.color-dot.selected {
  border-color: var(--foreground);
  box-shadow: 0 0 0 2px var(--background), 0 2px 6px rgba(0, 0, 0, 0.2);
}

.form-actions-advanced {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.form-actions-right {
  display: flex;
  gap: 10px;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  font-size: 14px;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 8px;
  transition: all 0.15s;
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--foreground);
}

/* ============================================
   SCHEDULE HEADER ACTIONS
   ============================================ */
.schedule-header-actions {
  display: flex;
  gap: 6px;
  margin-left: 12px;
}

.schedule-search-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s;
}

.schedule-search-btn:hover {
  background: var(--card);
  color: var(--foreground);
  border-color: var(--muted-foreground);
}

.schedule-search-btn svg,
.schedule-shortcuts-btn svg {
  width: 18px;
  height: 18px;
}

/* View Toggle - Extended for 5 views */
.schedule-view-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  overflow: hidden;
}

.view-toggle-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.view-toggle-btn:hover {
  color: var(--foreground);
}

.view-toggle-btn.active {
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Light mode adjustments */
.light .agenda-day-group.is-today {
  box-shadow: 0 0 0 1px var(--primary), 0 4px 20px rgba(59, 130, 246, 0.15);
}

.light .year-month-card:hover {
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
}

/* Mobile responsive for new views */
@media (max-width: 768px) {
  .agenda-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .agenda-search-input {
    width: 100%;
  }

  .agenda-event-card {
    flex-wrap: wrap;
  }

  .agenda-event-time-block {
    width: 100%;
    align-items: flex-start;
    margin-bottom: 8px;
  }

  .year-header {
    gap: 16px;
  }

  .year-title {
    font-size: 24px;
  }

  .keyboard-shortcuts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .schedule-header-actions {
    display: none;
  }

  .schedule-view-toggle {
    flex-wrap: wrap;
    justify-content: center;
  }

  .view-toggle-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .event-type-tabs {
    flex-wrap: wrap;
  }

  .date-time-grid {
    flex-direction: column;
    align-items: stretch;
  }

  .datetime-separator {
    display: none;
  }
}

/* ============================================
   Timeline V4 - ClickUp-Inspired Professional Gantt
   With Dependencies, Avatars, Week Ranges & Premium UX
   ============================================ */

/* ====== Container ====== */
.timeline-linear {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 500px;
  max-height: calc(100vh - 200px);
  background: var(--background);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

/* Premium glass backdrop */
.timeline-linear::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Wrapper for timeline + kanban layout */
.timeline-kanban-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  gap: 16px;
  overflow: hidden;
}

/* ====== Week Range Indicator ====== */
.tl-week-range-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted-foreground);
}

.tl-week-range-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
}

.tl-week-range-indicator svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

.tl-week-range-text {
  font-weight: 600;
  color: var(--foreground);
}

.tl-week-range-days {
  color: var(--muted-foreground);
  font-size: 11px;
}

/* ====== Polished Header ====== */
.tl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-shrink: 0;
  z-index: 100;
}

.tl-header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.tl-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

.tl-title svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

/* Enhanced View Tabs - ClickUp Style */
.tl-view-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.tl-view-tab {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.tl-view-tab:hover {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.03);
}

.tl-view-tab.active {
  color: var(--foreground);
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

/* Filter/Dependencies Buttons */
.tl-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tl-filter-btn:hover {
  background: var(--accent);
  color: var(--foreground);
}

.tl-filter-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

/* Navigation Controls - Enhanced */
.tl-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
}


.tl-today-btn {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--foreground);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tl-today-btn:hover {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* Zoom Controls - Premium Feel */
.tl-zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.tl-zoom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.12s ease;
}

.tl-zoom-btn:hover {
  background: var(--accent);
  color: var(--foreground);
}

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

.tl-zoom-level {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  min-width: 42px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}


/* ====== Enhanced Stats Bar ====== */
.tl-stats-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tl-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tl-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.tl-stat-label {
  font-size: 12px;
  color: var(--muted-foreground);
  font-weight: 500;
}

.tl-stat-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

/* Progress Mini Chart in Stats */
.tl-stat-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
}

.tl-stat-chart-bar {
  width: 4px;
  background: var(--primary);
  border-radius: 2px;
  transition: height 0.3s ease;
}

/* ====== Body Layout ====== */
.tl-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ====== Enhanced Left Panel ====== */
.tl-left-panel {
  width: 280px;
  min-width: 240px;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
}

.tl-left-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  height: 52px;
  flex-shrink: 0;
  background: var(--card);
}

.tl-left-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tl-left-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin: 12px;
}

.tl-left-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 12px;
  color: var(--foreground);
}

.tl-left-search input::placeholder {
  color: var(--muted-foreground);
}

.tl-left-search svg {
  width: 14px;
  height: 14px;
  color: var(--muted-foreground);
}

.tl-task-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Enhanced Task Items - ClickUp Style */
.tl-task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  height: 48px;
  background: transparent;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.12s ease;
  border-left: 2px solid transparent;
  position: relative;
}

.tl-task-item:hover {
  background: var(--surface-hover);
}

.tl-task-item.selected {
  background: rgba(96, 165, 250, 0.06);
  border-left-color: #60a5fa;
}

.tl-task-item.dragging {
  opacity: 0.5;
  background: var(--accent);
}

.tl-task-status {
  flex-shrink: 0;
}

.tl-task-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.tl-task-icon.complete {
  color: #22c55e !important;
}

.tl-task-content {
  flex: 1;
  min-width: 0;
}

.tl-task-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.tl-task-title.completed {
  text-decoration: line-through;
  opacity: 0.6;
}

.tl-task-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--muted-foreground);
}

.tl-task-dates {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tl-task-dates svg {
  width: 11px;
  height: 11px;
  opacity: 0.7;
}

.tl-task-count {
  font-weight: 600;
}

.tl-task-assignee {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, hsl(from var(--primary) h s calc(l - 15)) 100%);
  color: var(--primary-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Priority Dots */
.tl-priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.tl-priority-dot.high {
  background: #ef4444;
}

.tl-priority-dot.medium {
  background: #f59e0b;
}

.tl-priority-dot.low {
  background: #22c55e;
}

/* ====== Right Panel ====== */
.tl-right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--background);
  position: relative;
}

/* ====== Enhanced Date Header ====== */
.tl-date-header {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  flex-shrink: 0;
  z-index: 50;
  position: sticky;
  top: 0;
}

.tl-date-header-scroll {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.tl-month-row {
  display: flex;
  height: 32px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.tl-month-cell {
  flex-shrink: 0;
  padding: 0 16px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  border-right: 1px solid transparent;
}

.tl-day-row {
  display: flex;
  height: 36px;
  background: var(--card);
}

.tl-date-col {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-right: 1px solid var(--border);
  position: relative;
  transition: all 0.2s ease;
  background: transparent;
}

.tl-date-col.weekend {
  background: rgba(0, 0, 0, 0.15);
}

.tl-date-col.today {
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.08) 0%, rgba(96, 165, 250, 0.04) 100%);
  position: relative;
}

.tl-date-col.today::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 2px;
  background: #60a5fa;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}

.tl-date-day {
  font-size: 9px;
  font-weight: 500;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tl-date-num {
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  opacity: 0.7;
}

.tl-date-col.today .tl-date-num {
  color: #ffffff;
  background: #60a5fa;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.4);
}

/* ====== Enhanced Gantt Grid ====== */
.tl-gantt-wrapper {
  flex: 1;
  overflow: auto;
  position: relative;
  scroll-behavior: smooth;
  background: var(--background);
}

.tl-gantt-wrapper::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.tl-gantt-wrapper::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 4px;
}

.tl-gantt-wrapper::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
  border: none;
}

.tl-gantt-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

.tl-gantt-wrapper::-webkit-scrollbar-corner {
  background: var(--surface);
}

.tl-gantt-grid {
  position: relative;
  min-height: 100%;
  background: var(--background);
}

/* Gantt Rows */
.tl-gantt-row {
  display: flex;
  position: relative;
  height: 48px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
  background: transparent;
}

.tl-gantt-row:hover {
  background: var(--surface-hover);
}

.tl-gantt-row.selected {
  background: rgba(59, 130, 246, 0.05);
}

.tl-gantt-cell {
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  height: 100%;
  background: transparent;
}

.tl-gantt-cell.weekend {
  background: rgba(0, 0, 0, 0.15);
}

.tl-gantt-cell.today {
  background: rgba(96, 165, 250, 0.04);
  border-left: 1px solid rgba(96, 165, 250, 0.15);
  border-right: 1px solid rgba(96, 165, 250, 0.15);
  position: relative;
}

.tl-gantt-cell.today::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

/* ====== Linear-Style Premium Task Bars ====== */
.tl-task-bar {
  position: absolute;
  height: 32px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 5px;
  cursor: grab;
  display: flex;
  align-items: center;
  padding: 0 12px;
  overflow: visible;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  background: linear-gradient(180deg, rgba(50, 50, 60, 0.92) 0%, rgba(38, 38, 48, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
}

.tl-task-bar:active {
  cursor: grabbing;
}

.tl-task-bar:hover {
  z-index: 10;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: translateY(-50%) translateY(-1px);
  border-color: rgba(255, 255, 255, 0.12);
}

.tl-task-bar.dragging {
  cursor: grabbing;
  z-index: 100;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(99, 102, 241, 0.5);
  transform: translateY(-50%) scale(1.02);
  opacity: 0.95;
}

.tl-task-bar.resizing {
  cursor: ew-resize;
  z-index: 100;
}

.tl-task-bar.selected {
  box-shadow:
    0 0 0 2px rgba(99, 102, 241, 0.7),
    0 4px 20px rgba(99, 102, 241, 0.3);
}

/* Linear-style Overdue Bar - Gradient fade to red */
.tl-task-bar.linear-overdue {
  background: linear-gradient(90deg,
      rgba(55, 55, 65, 0.95) 0%,
      rgba(55, 55, 65, 0.95) 40%,
      rgba(127, 29, 29, 0.95) 70%,
      rgba(153, 27, 27, 0.98) 100%) !important;
  border-color: rgba(239, 68, 68, 0.4);
}

.tl-task-bar.linear-overdue:hover {
  box-shadow:
    0 4px 16px rgba(239, 68, 68, 0.3),
    0 0 20px rgba(239, 68, 68, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Linear-style bar with custom color that fades to overdue */
.tl-task-bar.linear-bar {
  background: linear-gradient(180deg, var(--bar-color-light, rgba(55, 55, 65, 0.95)) 0%, var(--bar-color, rgba(42, 42, 52, 0.95)) 100%);
}

.tl-task-bar.linear-bar:hover {
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 12px var(--bar-glow, rgba(99, 102, 241, 0.2)),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Column Bars - Premium Design */
.tl-task-bar.column-bar {
  height: 34px;
  background: linear-gradient(180deg, rgba(70, 70, 80, 0.9) 0%, rgba(55, 55, 65, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
}

.tl-task-bar.column-bar.no-dates {
  border-style: dashed;
  opacity: 0.7;
}

.tl-task-bar.column-bar.no-dates:hover {
  opacity: 1;
}

/* Color Variants for Bars */
.tl-task-bar.color-blue {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-color: rgba(255, 255, 255, 0.2);
}

.tl-task-bar.color-green {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  border-color: rgba(255, 255, 255, 0.2);
}

.tl-task-bar.color-purple {
  background: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 100%);
  border-color: rgba(255, 255, 255, 0.2);
}

.tl-task-bar.color-orange {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  border-color: rgba(255, 255, 255, 0.2);
}

.tl-task-bar.color-red {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  border-color: rgba(255, 255, 255, 0.2);
}

.tl-task-bar.color-pink {
  background: linear-gradient(180deg, #ec4899 0%, #db2777 100%);
  border-color: rgba(255, 255, 255, 0.2);
}

.tl-task-bar.color-cyan {
  background: linear-gradient(180deg, #06b6d4 0%, #0891b2 100%);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Completed Status */
.tl-task-bar.status-done {
  opacity: 0.6;
  background: linear-gradient(180deg, #52525b 0%, #3f3f46 100%) !important;
}

.tl-task-bar.status-done::before {
  content: '✓';
  position: absolute;
  left: 10px;
  font-size: 12px;
  font-weight: bold;
  color: #22c55e;
}

/* Floating Header Above Bar - Linear Style */
.tl-bar-header {
  position: absolute;
  top: -28px;
  left: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tl-gantt-row:hover .tl-bar-header {
  opacity: 1;
}

.tl-bar-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tl-status-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.tl-priority-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.8;
}

.tl-bar-header-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-bar-header-count {
  font-size: 11px;
  color: var(--muted-foreground);
  margin-left: 2px;
}

/* Bar Content */
.tl-bar-icon {
  margin-right: 8px;
  font-size: 14px;
  flex-shrink: 0;
}

.tl-bar-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Progress bar inside task bar */
.tl-bar-progress {
  position: absolute;
  bottom: 4px;
  left: 8px;
  right: 8px;
  height: 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.tl-bar-progress-fill {
  height: 100%;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Resize Handles - Enhanced */
.tl-bar-resize {
  position: absolute;
  top: 0;
  width: 12px;
  height: 100%;
  cursor: ew-resize;
  background: transparent;
  z-index: 5;
  opacity: 0;
  transition: all 0.12s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tl-task-bar:hover .tl-bar-resize {
  opacity: 1;
}

.tl-bar-resize.left {
  left: -4px;
  border-radius: 8px 0 0 8px;
}

.tl-bar-resize.right {
  right: -4px;
  border-radius: 0 8px 8px 0;
}

.tl-bar-resize::before {
  content: '';
  width: 4px;
  height: 16px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
}

.tl-bar-resize:hover {
  background: rgba(59, 130, 246, 0.3);
}

.tl-bar-resize:hover::before {
  background: white;
}

/* Quick Actions - Enhanced */
.tl-column-bar-actions {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  z-index: 20;
  background: var(--card);
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.tl-task-bar:hover .tl-column-bar-actions {
  opacity: 1;
  visibility: visible;
}

.tl-bar-quick-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

.tl-bar-quick-btn svg {
  width: 14px;
  height: 14px;
}

.tl-bar-quick-btn:hover {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* ====== Enhanced Today Line ====== */
.tl-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #3b82f6 0%, #60a5fa 50%, #3b82f6 100%);
  z-index: 30;
  pointer-events: none;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5), 0 0 40px rgba(59, 130, 246, 0.3);
}

.tl-today-line::before {
  content: 'TODAY';
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  padding: 3px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
  letter-spacing: 0.05em;
}

/* Milestone and dependency styles removed */

/* ====== Task Bar Avatars - ClickUp Style ====== */
.tl-bar-avatars {
  display: flex;
  align-items: center;
  margin-left: auto;
  padding-left: 8px;
}

.tl-bar-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(135deg, var(--primary) 0%, hsl(from var(--primary) h s calc(l - 15)) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
  margin-left: -8px;
  position: relative;
  z-index: 1;
  transition: transform 0.15s ease, z-index 0.15s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.tl-bar-avatar:first-child {
  margin-left: 0;
}

.tl-bar-avatar:hover {
  transform: scale(1.15);
  z-index: 10;
}

.tl-bar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tl-bar-avatar-more {
  background: var(--surface);
  color: var(--muted-foreground);
  font-size: 9px;
  border-color: var(--border);
}

/* ====== Enhanced Tooltip - ClickUp Style ====== */
.tl-bar-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  min-width: 280px;
  max-width: 360px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.tl-task-bar:hover .tl-bar-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

.tl-bar-tooltip::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: var(--card);
  border-bottom: 0;
}

.tl-tooltip-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.tl-tooltip-status {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tl-tooltip-status.todo {
  background: rgba(113, 113, 122, 0.2);
}

.tl-tooltip-status.in-progress {
  background: rgba(245, 158, 11, 0.2);
}

.tl-tooltip-status.review {
  background: rgba(139, 92, 246, 0.2);
}

.tl-tooltip-status.done {
  background: rgba(34, 197, 94, 0.2);
}

.tl-tooltip-status svg {
  width: 18px;
  height: 18px;
}

.tl-tooltip-title {
  flex: 1;
}

.tl-tooltip-title h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.tl-tooltip-title span {
  font-size: 12px;
  color: var(--muted-foreground);
}

.tl-tooltip-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.tl-tooltip-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tl-tooltip-meta-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.tl-tooltip-meta-value {
  font-size: 12px;
  font-weight: 500;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tl-tooltip-meta-value svg {
  width: 12px;
  height: 12px;
  color: var(--muted-foreground);
}

.tl-tooltip-progress {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.tl-tooltip-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.tl-tooltip-progress-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
}

.tl-tooltip-progress-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--foreground);
}

.tl-tooltip-progress-bar {
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
}

.tl-tooltip-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.tl-tooltip-dependencies {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tl-tooltip-dep-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 4px;
  font-size: 10px;
  color: #818cf8;
}

.tl-tooltip-dep-tag svg {
  width: 10px;
  height: 10px;
}


/* ====== Empty State ====== */
.tl-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted-foreground);
}

.tl-empty-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.tl-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 8px;
}

.tl-empty-desc {
  font-size: 13px;
}

/* ====== Milestone Modal ====== */
.tl-milestone-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tl-milestone-modal-overlay.show {
  opacity: 1;
}

.tl-milestone-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.tl-milestone-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.tl-milestone-modal-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-radius: 8px;
  color: white;
}

.tl-milestone-modal-icon svg {
  width: 20px;
  height: 20px;
}

.tl-milestone-modal-icon.completed {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.tl-milestone-modal-title {
  flex: 1;
}

.tl-milestone-modal-title h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.tl-milestone-modal-title span {
  font-size: 12px;
  color: var(--muted-foreground);
}

.tl-milestone-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tl-milestone-modal-close:hover {
  background: var(--surface);
  color: var(--foreground);
}

.tl-milestone-modal-body {
  padding: 20px;
}

.tl-milestone-progress-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.tl-milestone-progress-label {
  font-size: 12px;
  color: var(--muted-foreground);
  min-width: 60px;
}

.tl-milestone-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}

.tl-milestone-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.tl-milestone-progress-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--foreground);
  min-width: 40px;
  text-align: right;
}

.tl-milestone-desc {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.tl-milestone-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* ====== Responsive ====== */
@media (max-width: 768px) {
  .tl-left-panel {
    width: 200px;
    min-width: 180px;
  }

  .tl-header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
  }

  .tl-view-tabs {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .tl-shortcuts-hint {
    display: none;
  }

  .tl-stats-bar {
    overflow-x: auto;
  }
}

/* ====== Color Picker Popover ====== */
.tlv2-color-picker {
  position: fixed;
  z-index: 10000;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
  padding: 16px;
  min-width: 220px;
  animation: tlv2-picker-in 0.15s ease-out;
}

@keyframes tlv2-picker-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-4px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tlv2-color-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.tlv2-color-picker-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--foreground);
}

.tlv2-color-picker-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.12s ease;
}

.tlv2-color-picker-close:hover {
  background: var(--surface);
  color: var(--foreground);
}

.tlv2-color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.tlv2-color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.12s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tlv2-color-swatch:hover {
  transform: scale(1.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.tlv2-color-swatch.active {
  border-color: white;
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px currentColor;
}

.tlv2-color-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.tlv2-color-custom-label {
  font-size: 12px;
  color: var(--muted-foreground);
  flex: 1;
}

.tlv2-color-custom-input {
  width: 36px;
  height: 30px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.tlv2-color-custom-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.tlv2-color-custom-input::-webkit-color-swatch {
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ====== Kanban Section Below Timeline ====== */
.tl-kanban-section {
  flex: 1;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  background: var(--background);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.tl-kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tl-kanban-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tl-kanban-title svg {
  opacity: 0.6;
}

.tl-kanban-columns {
  display: flex;
  flex: 1;
  gap: 16px;
  padding: 20px;
  overflow-x: auto;
  overflow-y: hidden;
}

.tl-kanban-column {
  display: flex;
  flex-direction: column;
  min-width: 300px;
  max-width: 340px;
  flex: 1;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.tl-kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.tl-kanban-column-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--foreground);
}

.tl-kanban-column-count {
  font-size: 11px;
  color: var(--muted-foreground);
  background: var(--background);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.tl-kanban-column-body {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tl-kanban-card {
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tl-kanban-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.tl-kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 10px;
}

.tl-kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--muted-foreground);
}

.tl-kanban-card.done .tl-kanban-card-title {
  text-decoration: line-through;
  opacity: 0.6;
}

/* ============================================
   TIMELINE V5 - ClickUp-Inspired Premium Gantt
   Advanced UX with Curved Dependencies
   ============================================ */

/* Enhanced Container */
.timeline-linear.clickup-enhanced {
  background: linear-gradient(180deg, var(--background) 0%, hsl(from var(--background) h s calc(l - 3)) 100%);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2), 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* ClickUp Header Style */
.tl-header.tl-header-clickup {
  background: linear-gradient(180deg, rgba(30, 30, 35, 0.95) 0%, rgba(24, 24, 28, 0.98) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 16px;
  gap: 12px;
}

.tl-header-clickup .tl-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.tl-gantt-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tl-gantt-icon svg {
  width: 16px;
  height: 16px;
  color: white;
}

/* ClickUp Toolbar Buttons */
.tl-clickup-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tl-toolbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tl-toolbar-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.tl-toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--foreground);
  border-color: rgba(255, 255, 255, 0.15);
}

.tl-toolbar-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.tl-toolbar-btn-icon {
  padding: 7px 10px;
}

.tl-toolbar-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 6px;
}

/* ClickUp View Tabs */
.tl-view-tabs-clickup {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px;
  gap: 1px;
}

.tl-view-tabs-clickup .tl-view-tab {
  padding: 5px 12px;
  font-size: 11px;
  border-radius: 4px;
}

.tl-view-tabs-clickup .tl-view-tab.active {
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}


/* ClickUp Zoom */
.tl-zoom-clickup {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tl-zoom-clickup .tl-zoom-level {
  min-width: 60px;
  font-size: 11px;
  text-align: center;
}

/* Zoom Dropdown */
.tl-zoom-dropdown-wrapper {
  position: relative;
}

.tl-zoom-level-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.tl-zoom-level-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--foreground);
}

.tl-zoom-chevron {
  width: 12px;
  height: 12px;
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.tl-zoom-dropdown.show+.tl-zoom-level-btn .tl-zoom-chevron,
.tl-zoom-level-btn:focus .tl-zoom-chevron {
  transform: rotate(180deg);
}

.tl-zoom-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 6px;
  min-width: 120px;
  background: rgba(20, 20, 25, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  padding: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-8px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.tl-zoom-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.tl-zoom-preset {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.tl-zoom-preset:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--foreground);
}

.tl-zoom-preset.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(99, 102, 241, 0.3));
  color: #a78bfa;
  font-weight: 500;
}


/* Week Ranges Header - ClickUp Style */
.tl-week-ranges-header {
  display: flex;
  height: 36px;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.tl-week-range-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.tl-week-range-dates {
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
}

.tl-week-range-week {
  font-size: 10px;
  font-weight: 700;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Dependency Banner */
.tl-dep-banner {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  background: rgba(99, 102, 241, 0.05);
  border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.tl-dep-banner.active {
  background: rgba(99, 102, 241, 0.1);
}

.tl-dep-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 6px;
  color: #818cf8;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tl-dep-toggle svg {
  width: 12px;
  height: 12px;
}

.tl-dep-toggle:hover {
  background: rgba(99, 102, 241, 0.15);
}

/* ClickUp Body */
.tl-body-clickup {
  background: var(--background);
}

/* ClickUp Left Panel */
.tl-left-panel-clickup {
  width: 140px;
  min-width: 100px;
  max-width: 400px;
  resize: horizontal;
  overflow: auto;
  background: linear-gradient(180deg, var(--card) 0%, hsl(from var(--card) h s calc(l - 2)) 100%);
}

/* Custom resize handle styling */
.tl-left-panel-clickup::-webkit-resizer {
  background: linear-gradient(135deg, transparent 50%, var(--muted-foreground) 50%);
  border-radius: 0 0 4px 0;
}

.tl-left-panel-clickup::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: transparent;
  cursor: ew-resize;
  transition: background 0.2s;
}

.tl-left-panel-clickup:hover::after {
  background: var(--primary);
}

.tl-left-panel-clickup .tl-left-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  height: 44px;
}

.tl-task-count-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-foreground);
  background: var(--surface);
  padding: 2px 7px;
  border-radius: 10px;
}

.tl-expand-all-btn {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.tl-expand-all-btn:hover {
  background: var(--surface);
  color: var(--foreground);
}

.tl-expand-all-btn svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   ULTRA-MINIMALISTIC TIMELINE LIST - Premium Clean
   Complete Redesign - Overrides All Legacy Styles
   ============================================ */

/* Force hide ALL legacy task items */
.tl-task-list .tl-task-item,
.tl-task-list .tl-task-item-clickup,
.tl-task-list .tl-task-item-child {
  display: none !important;
}

/* ============================================
   NEW COLUMN ROWS - Super Clean
   ============================================ */
.tl-column-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
  background: transparent;
}

.tl-column-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

/* Color Indicator - Thin Bar */
.tl-column-indicator {
  width: 3px;
  height: 20px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Expand Chevron */
.tl-column-expand {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  opacity: 0.35;
  transition: transform 0.2s ease, opacity 0.15s ease;
  flex-shrink: 0;
}

.tl-column-row:hover .tl-column-expand {
  opacity: 0.6;
}

.tl-column-row.expanded .tl-column-expand {
  transform: rotate(90deg);
  opacity: 0.7;
}

.tl-column-expand svg {
  width: 10px;
  height: 10px;
}

/* Column Info */
.tl-column-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.tl-column-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-column-count {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted-foreground);
  opacity: 0.5;
  flex-shrink: 0;
}

/* ============================================
   NEW TASK ROWS - Minimal Nested
   ============================================ */
.tl-task-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 42px;
  cursor: pointer;
  transition: background 0.12s ease;
  position: relative;
  background: transparent;
}

.tl-task-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Connector Line */
.tl-task-connector {
  position: absolute;
  left: 25px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.04);
}

.tl-task-row:last-of-type .tl-task-connector {
  bottom: 50%;
}

/* Checkbox */
.tl-task-check {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
  flex-shrink: 0;
  background: transparent;
}

.tl-task-check:hover {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.05);
}

.tl-task-check.checked {
  background: #22c55e;
  border-color: #22c55e;
}

.tl-task-check svg {
  width: 8px;
  height: 8px;
  color: white;
}

/* Task Name */
.tl-task-name {
  font-size: 12px;
  font-weight: 400;
  color: var(--foreground);
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.tl-task-name.done {
  opacity: 0.35;
  text-decoration: line-through;
}

/* ============================================
   LIGHT MODE OVERRIDES
   ============================================ */
.light .tl-column-row,
[data-theme="pink"] .tl-column-row {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.light .tl-column-row:hover,
[data-theme="pink"] .tl-column-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

.light .tl-task-row:hover,
[data-theme="pink"] .tl-task-row:hover {
  background: rgba(0, 0, 0, 0.015);
}

.light .tl-task-connector,
[data-theme="pink"] .tl-task-connector {
  background: rgba(0, 0, 0, 0.06);
}

.light .tl-task-check,
[data-theme="pink"] .tl-task-check {
  border-color: rgba(0, 0, 0, 0.15);
}

/* ClickUp Right Panel */
.tl-right-panel-clickup {
  background: var(--background);
}

/* ClickUp Date Header */
.tl-date-header-clickup {
  background: linear-gradient(180deg, var(--card) 0%, hsl(from var(--card) h s calc(l - 1)) 100%);
}

.tl-day-row-clickup {
  height: 44px;
}

.tl-date-col-clickup {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.tl-date-col-clickup .tl-date-day {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted-foreground);
}

.tl-date-num-wrapper {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tl-date-num-wrapper.today {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.tl-date-num-wrapper.today .tl-date-num {
  color: white;
  font-weight: 700;
}

.tl-date-col-clickup .tl-date-num {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.tl-date-col-clickup.weekend {
  background: rgba(0, 0, 0, 0.06);
}

.tl-date-col-clickup.today {
  background: rgba(59, 130, 246, 0.08);
}

/* ClickUp Gantt Rows */
.tl-gantt-row-clickup {
  height: 52px;
  transition: background 0.1s ease;
}

.tl-gantt-row-clickup:hover {
  background: rgba(255, 255, 255, 0.02);
}

.tl-gantt-row-child {
  height: 44px;
}

/* ClickUp Task Bars - Premium */
.tl-task-bar-clickup {
  height: 32px;
  border-radius: 16px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  padding: 0 8px 0 0;
  overflow: visible;
}

.tl-task-bar-clickup:hover {
  transform: translateY(-50%) scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tl-task-bar-clickup.completed {
  opacity: 0.6;
  filter: grayscale(0.3);
}

.tl-task-bar-child {
  height: 26px;
  border-radius: 13px;
}

/* Bar Avatar Wrapper */
.tl-bar-avatar-wrapper {
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
}

.tl-bar-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.tl-task-bar-child .tl-bar-avatar-wrapper {
  left: -3px;
}

.tl-task-bar-child .tl-bar-avatar-circle {
  width: 24px;
  height: 24px;
  border-width: 2px;
  font-size: 9px;
}

.tl-bar-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Bar Label */
.tl-task-bar-clickup .tl-bar-label {
  margin-left: 28px;
  font-size: 11px;
  font-weight: 600;
}

.tl-task-bar-child .tl-bar-label {
  margin-left: 22px;
  font-size: 10px;
}

/* Progress inside bar */
.tl-bar-progress-clickup {
  position: absolute;
  bottom: 3px;
  left: 28px;
  right: 8px;
  height: 3px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 2px;
  overflow: hidden;
}

.tl-bar-progress-fill-clickup {
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 2px;
}

/* Connection Dots - ClickUp Style */
.tl-bar-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  background: white;
  border: 2px solid var(--bar-color, #6366f1);
  border-radius: 50%;
  cursor: crosshair;
  opacity: 0;
  transition: all 0.15s ease;
  z-index: 10;
}

.tl-task-bar:hover .tl-bar-dot {
  opacity: 1;
}

.tl-bar-dot-left {
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
}

.tl-bar-dot-right {
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
}

.tl-bar-dot:hover {
  transform: translateY(-50%) scale(1.3);
  background: var(--bar-color, #6366f1);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3);
}

/* Resize Handles - ClickUp */
.tl-bar-resize-left {
  left: 0;
  border-radius: 16px 0 0 16px;
}

.tl-bar-resize-right {
  right: 0;
  border-radius: 0 16px 16px 0;
}

/* Today Line - ClickUp */
.tl-today-line-clickup {
  width: 2px;
  background: linear-gradient(180deg, #ef4444 0%, #f87171 50%, #ef4444 100%);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
}

.tl-today-line-clickup::before {
  display: none;
}

.tl-today-label {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* Dependency Paths */
.tl-dep-path {
  stroke: #6366f1;
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 6, 3;
}

.tl-dep-dot-start {
  fill: #6366f1;
}

.tl-dep-arrow {
  fill: #6366f1;
}

/* Bottom Stats Bar */
.tl-bottom-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--card) 100%);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.tl-stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.tl-stat-chip-icon {
  font-size: 12px;
}

.tl-stat-chip-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--foreground);
}

.tl-stat-chip-label {
  font-size: 11px;
  color: var(--muted-foreground);
}

.tl-stat-chip-green .tl-stat-chip-value {
  color: #22c55e;
}

.tl-stat-chip-yellow .tl-stat-chip-value {
  color: #f59e0b;
}

.tl-stat-chip-red .tl-stat-chip-value {
  color: #ef4444;
}

.tl-progress-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.tl-progress-bar-mini {
  width: 80px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.tl-progress-fill-mini {
  height: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.tl-progress-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--foreground);
}

/* ============================================
   TIMELINE V6 - PREMIUM ADVANCED FEATURES
   Swimlanes, Critical Path, Mini Calendar,
   Task Inspector, Workload Heatmap, Baseline
   ============================================ */

/* === Advanced Toolbar === */
.tl-advanced-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tl-adv-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.tl-adv-btn:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--foreground);
}

.tl-adv-btn.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  border-color: rgba(139, 92, 246, 0.4);
  color: #a78bfa;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}

.tl-adv-btn .btn-badge {
  font-size: 9px;
  padding: 1px 5px;
  background: rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  color: #c4b5fd;
}

.tl-adv-separator {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
}

/* === Swimlanes View === */
.tl-swimlanes-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: auto;
}

.tl-swimlane {
  border-bottom: 2px solid var(--border);
  min-height: 100px;
}

.tl-swimlane-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}

.tl-swimlane-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
}

.tl-swimlane-icon.priority-high {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.tl-swimlane-icon.priority-medium {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.tl-swimlane-icon.priority-low {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.tl-swimlane-icon.assignee {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.tl-swimlane-info {
  flex: 1;
}

.tl-swimlane-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 2px;
}

.tl-swimlane-meta {
  font-size: 11px;
  color: var(--muted-foreground);
}

.tl-swimlane-stats {
  display: flex;
  gap: 16px;
}

.tl-swimlane-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tl-swimlane-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--foreground);
}

.tl-swimlane-stat-label {
  font-size: 9px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tl-swimlane-expand {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.tl-swimlane-expand:hover {
  background: var(--accent);
  color: var(--foreground);
}

.tl-swimlane-expand svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.tl-swimlane.collapsed .tl-swimlane-expand svg {
  transform: rotate(-90deg);
}

.tl-swimlane-body {
  display: flex;
}

.tl-swimlane.collapsed .tl-swimlane-body {
  display: none;
}

/* === Critical Path Highlighting === */
.tl-task-bar.critical-path {
  box-shadow: 0 0 0 2px #ef4444, 0 4px 20px rgba(239, 68, 68, 0.4);
  animation: criticalPulse 2s ease-in-out infinite;
}

@keyframes criticalPulse {

  0%,
  100% {
    box-shadow: 0 0 0 2px #ef4444, 0 4px 20px rgba(239, 68, 68, 0.4);
  }

  50% {
    box-shadow: 0 0 0 3px #ef4444, 0 6px 28px rgba(239, 68, 68, 0.6);
  }
}

.tl-critical-path-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  font-size: 11px;
  color: #fca5a5;
}

.tl-critical-path-legend::before {
  content: '';
  width: 12px;
  height: 12px;
  background: #ef4444;
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* === Mini Calendar Navigator === */
.tl-mini-calendar {
  position: fixed;
  z-index: 1000;
  background: rgba(20, 20, 25, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  padding: 16px;
  width: 300px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.25s ease;
}

.tl-mini-calendar.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tl-mini-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tl-mini-calendar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
}

.tl-mini-calendar-nav {
  display: flex;
  gap: 4px;
}

.tl-mini-calendar-nav button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.tl-mini-calendar-nav button:hover {
  background: var(--accent);
  color: var(--foreground);
}

.tl-mini-calendar-nav button svg {
  width: 14px;
  height: 14px;
}

.tl-mini-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 12px;
}

.tl-mini-calendar-day-label {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted-foreground);
  padding: 8px 0;
}

.tl-mini-calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.tl-mini-calendar-day:hover {
  background: rgba(139, 92, 246, 0.2);
  color: var(--foreground);
}

.tl-mini-calendar-day.today {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  font-weight: 700;
}

.tl-mini-calendar-day.selected {
  box-shadow: 0 0 0 2px #8b5cf6;
}

.tl-mini-calendar-day.other-month {
  opacity: 0.3;
}

.tl-mini-calendar-day.has-tasks::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: #8b5cf6;
  border-radius: 50%;
}

.tl-mini-calendar-day.has-overdue::after {
  background: #ef4444;
}

.tl-mini-calendar-shortcuts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tl-mini-calendar-shortcut {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tl-mini-calendar-shortcut:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--foreground);
}

/* === Task Inspector Popover === */
.tl-task-inspector {
  position: fixed;
  z-index: 2000;
  background: rgba(18, 18, 22, 0.98);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  width: 360px;
  max-height: 480px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tl-task-inspector.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.tl-inspector-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
}

.tl-inspector-status {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tl-inspector-status svg {
  width: 18px;
  height: 18px;
}

.tl-inspector-status.todo {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: white;
}

.tl-inspector-status.in-progress {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.tl-inspector-status.done {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
}

.tl-inspector-title-wrap {
  flex: 1;
  min-width: 0;
}

.tl-inspector-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tl-inspector-subtitle {
  font-size: 11px;
  color: var(--muted-foreground);
}

.tl-inspector-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.tl-inspector-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--foreground);
}

.tl-inspector-close svg {
  width: 16px;
  height: 16px;
}

.tl-inspector-body {
  padding: 16px;
  overflow-y: auto;
  max-height: 320px;
}

.tl-inspector-section {
  margin-bottom: 16px;
}

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

.tl-inspector-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.tl-inspector-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  margin-bottom: 6px;
}

.tl-inspector-row:last-child {
  margin-bottom: 0;
}

.tl-inspector-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.tl-inspector-icon svg {
  width: 14px;
  height: 14px;
}

.tl-inspector-row-content {
  flex: 1;
  min-width: 0;
}

.tl-inspector-label {
  font-size: 10px;
  color: var(--muted-foreground);
  margin-bottom: 2px;
}

.tl-inspector-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

.tl-inspector-value.overdue {
  color: #ef4444;
}

.tl-inspector-value.due-soon {
  color: #f59e0b;
}

.tl-inspector-progress {
  margin-top: 4px;
}

.tl-inspector-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.tl-inspector-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
  transition: width 0.3s ease;
}

.tl-inspector-progress-text {
  font-size: 11px;
  color: var(--muted-foreground);
}

.tl-inspector-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tl-inspector-tag {
  padding: 4px 10px;
  background: rgba(139, 92, 246, 0.15);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #c4b5fd;
}

.tl-inspector-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.tl-inspector-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tl-inspector-action:hover {
  background: var(--accent);
  color: var(--foreground);
}

.tl-inspector-action.primary {
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  border-color: transparent;
  color: white;
}

.tl-inspector-action.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.tl-inspector-action svg {
  width: 14px;
  height: 14px;
}

/* === Workload Heatmap View === */
.tl-workload-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tl-workload-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.tl-workload-legend-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
}

.tl-workload-legend-items {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tl-workload-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted-foreground);
}

.tl-workload-legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.tl-workload-legend-color.light {
  background: rgba(34, 197, 94, 0.3);
}

.tl-workload-legend-color.medium {
  background: rgba(245, 158, 11, 0.5);
}

.tl-workload-legend-color.heavy {
  background: rgba(239, 68, 68, 0.7);
}

.tl-workload-legend-color.overloaded {
  background: #ef4444;
}

.tl-workload-rows {
  flex: 1;
  overflow: auto;
}

.tl-workload-row {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.tl-workload-assignee {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.tl-workload-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.tl-workload-name {
  flex: 1;
  min-width: 0;
}

.tl-workload-name-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-workload-capacity {
  font-size: 11px;
  color: var(--muted-foreground);
}

.tl-workload-cells {
  flex: 1;
  display: flex;
}

.tl-workload-cell {
  flex-shrink: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.tl-workload-cell:hover {
  transform: scale(1.05);
  z-index: 10;
}

.tl-workload-cell::after {
  content: attr(data-hours);
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tl-workload-cell:hover::after {
  opacity: 1;
}

.tl-workload-cell.level-0 {
  background: transparent;
  color: var(--muted-foreground);
}

.tl-workload-cell.level-1 {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.tl-workload-cell.level-2 {
  background: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

.tl-workload-cell.level-3 {
  background: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.tl-workload-cell.level-4 {
  background: rgba(245, 158, 11, 0.6);
  color: #f59e0b;
}

.tl-workload-cell.level-5 {
  background: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.tl-workload-cell.level-6 {
  background: rgba(239, 68, 68, 0.7);
  color: white;
}

.tl-workload-cell.overloaded {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  animation: overloadPulse 1.5s ease-in-out infinite;
}

@keyframes overloadPulse {

  0%,
  100% {
    box-shadow: inset 0 0 0 0 rgba(239, 68, 68, 0);
  }

  50% {
    box-shadow: inset 0 0 20px rgba(239, 68, 68, 0.5);
  }
}

/* === Baseline Comparison === */
.tl-baseline-bar {
  position: absolute;
  height: 8px;
  bottom: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px dashed rgba(255, 255, 255, 0.3);
  pointer-events: none;
  z-index: 0;
}

.tl-task-bar.has-baseline {
  z-index: 2;
}

.tl-baseline-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  top: -20px;
  left: 0;
  font-size: 9px;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tl-task-bar:hover .tl-baseline-indicator {
  opacity: 1;
}

.tl-baseline-indicator.ahead {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.tl-baseline-indicator.behind {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* === Overdue Task Styling === */
.tl-task-bar.overdue {
  border: 2px solid #ef4444 !important;
  animation: overduePulse 2s ease-in-out infinite;
}

@keyframes overduePulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }

  50% {
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
  }
}

.tl-task-bar.overdue .tl-bar-label::after {
  content: '⚠';
  margin-left: 6px;
  font-size: 10px;
}

/* ====== Linear-Style Diamond Milestones on Bars ====== */
.tl-bar-milestone {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(99, 102, 241, 0.8);
  transform: translateY(-50%) translateX(-50%) rotate(45deg);
  cursor: pointer;
  z-index: 15;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tl-bar-milestone:hover {
  transform: translateY(-50%) translateX(-50%) rotate(45deg) scale(1.2);
  background: rgba(99, 102, 241, 1);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.tl-bar-milestone.dragging {
  transform: translateY(-50%) translateX(-50%) rotate(45deg) scale(1.3);
  background: rgba(99, 102, 241, 1);
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.8);
}

.tl-bar-milestone.filled {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  border-color: rgba(255, 255, 255, 0.6);
}

.tl-bar-milestone.completed {
  background: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
  border-color: rgba(255, 255, 255, 0.6);
}

.tl-bar-milestone-label {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) rotate(-45deg);
  white-space: nowrap;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted-foreground);
  background: var(--card);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tl-bar-milestone:hover .tl-bar-milestone-label,
.tl-gantt-row:hover .tl-bar-milestone-label {
  opacity: 1;
}

/* Milestone editing inline input */
.tl-bar-milestone-edit {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(24, 24, 28, 0.98);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  padding: 10px;
  min-width: 140px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
}

.tl-bar-milestone-edit input {
  width: 100%;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--foreground);
  font-size: 12px;
  outline: none;
}

.tl-bar-milestone-edit input:focus {
  border-color: rgba(99, 102, 241, 0.5);
}

/* Bar icons/badges container */
.tl-bar-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  flex-shrink: 0;
}

.tl-bar-badge {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.tl-bar-emoji {
  font-size: 12px;
  margin-right: 6px;
}

/* ====== Linear-Style Right-Click Context Menu ====== */
.tl-bar-context-menu {
  position: fixed;
  z-index: 10000;
  min-width: 180px;
  background: rgba(24, 24, 28, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 6px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  animation: contextMenuIn 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes contextMenuIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-4px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tl-bar-context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.1s ease;
}

.tl-bar-context-menu-item:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.tl-bar-context-menu-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.tl-bar-context-menu-item.danger {
  color: #f87171;
}

.tl-bar-context-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.tl-bar-context-menu-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

/* Milestone input popup */
.tl-milestone-input-popup {
  position: fixed;
  z-index: 10001;
  background: rgba(24, 24, 28, 0.98);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  padding: 16px;
  min-width: 220px;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(99, 102, 241, 0.1);
  backdrop-filter: blur(16px);
  animation: contextMenuIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tl-milestone-input-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.tl-milestone-input-field {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--foreground);
  font-size: 13px;
  outline: none;
  transition: all 0.15s ease;
}

.tl-milestone-input-field:focus {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.tl-milestone-input-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.tl-milestone-input-btn {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tl-milestone-input-btn.cancel {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted-foreground);
}

.tl-milestone-input-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--foreground);
}

.tl-milestone-input-btn.save {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  color: white;
}

.tl-milestone-input-btn.save:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* === Keyboard Shortcuts Overlay === */
.tl-shortcuts-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.tl-shortcuts-overlay.show {
  opacity: 1;
  visibility: visible;
}

.tl-shortcuts-panel {
  background: rgba(24, 24, 28, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px;
  width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.tl-shortcuts-overlay.show .tl-shortcuts-panel {
  transform: scale(1);
}

.tl-shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.tl-shortcuts-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--foreground);
}

.tl-shortcuts-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: var(--muted-foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.tl-shortcuts-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--foreground);
}

.tl-shortcuts-close svg {
  width: 18px;
  height: 18px;
}

.tl-shortcuts-group {
  margin-bottom: 20px;
}

.tl-shortcuts-group:last-child {
  margin-bottom: 0;
}

.tl-shortcuts-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.tl-shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tl-shortcut-item:last-child {
  border-bottom: none;
}

.tl-shortcut-desc {
  font-size: 13px;
  color: var(--foreground);
}

.tl-shortcut-keys {
  display: flex;
  gap: 4px;
}

.tl-shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--foreground);
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* === Progress Animation === */
.tl-task-bar .tl-bar-progress-fill-clickup {
  position: relative;
  overflow: hidden;
}

.tl-task-bar .tl-bar-progress-fill-clickup::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

/* === Date Range Selection === */
.tl-date-range-select {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.tl-date-range-select input[type="date"] {
  background: transparent;
  border: none;
  color: var(--foreground);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.tl-date-range-select input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.6;
  cursor: pointer;
}

.tl-date-range-divider {
  color: var(--muted-foreground);
  font-size: 12px;
}

/* === Responsive Adjustments === */
@media (max-width: 1200px) {
  .tl-advanced-toolbar {
    overflow-x: auto;
    padding-bottom: 12px;
  }

  .tl-mini-calendar {
    width: 280px;
  }

  .tl-task-inspector {
    width: 320px;
  }
}

@media (max-width: 768px) {
  .tl-advanced-toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }

  .tl-adv-btn {
    padding: 5px 10px;
    font-size: 10px;
  }

  .tl-mini-calendar {
    width: calc(100vw - 32px);
    max-width: 300px;
  }

  .tl-task-inspector {
    width: calc(100vw - 32px);
    max-width: 360px;
  }
}

/* ============================================
   TIMELINE PREMIUM ENHANCEMENTS V7
   Clean Linear/Height-inspired Premium Aesthetic
   ============================================ */

/* ====== Thinner, Lower Opacity Grid Lines ====== */
.tl-gantt-row-clickup,
.tl-gantt-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.tl-gantt-cell {
  border-right: 1px solid rgba(255, 255, 255, 0.015);
}

.tl-date-col-clickup,
.tl-date-col {
  border-right: 1px solid rgba(255, 255, 255, 0.03);
}

/* Weekend cells - very subtle */
.tl-gantt-cell.weekend {
  background: rgba(0, 0, 0, 0.03);
}

/* ====== Premium Thick Task Bars - Linear/Height Style ====== */
/* ====== PREMIUM THICK BARS - 1.5-2x height with generous rounded corners ====== */
.tl-task-bar-clickup {
  height: 44px;
  border-radius: 12px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.2),
    0 4px 20px rgba(0, 0, 0, 0.15),
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  overflow: visible;
  position: relative;
  padding-left: 0;
  display: flex;
  align-items: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tl-task-bar-child {
  height: 38px;
  border-radius: 10px;
}

/* Bar hover - premium lift effect */
.tl-task-bar-clickup:hover {
  transform: translateY(-50%) translateY(-2px);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.25),
    0 16px 48px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  filter: brightness(1.05);
}

/* ====== Compact Emoji Icon on Bar ====== */
.tl-bar-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 13px;
  flex-shrink: 0;
  margin-left: 12px;
  margin-right: 6px;
  opacity: 0.95;
  z-index: 5;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.tl-task-bar-child .tl-bar-emoji {
  width: 16px;
  height: 16px;
  font-size: 11px;
  margin-left: 10px;
  margin-right: 5px;
}

/* Bar label - bold, centered vertically */
.tl-task-bar-clickup.has-emoji .tl-bar-label {
  padding-left: 0;
  margin-left: 0;
  font-weight: 650;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.98);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  z-index: 5;
}

/* Custom milestone bar styles removed */

/* ====== Bar Context Menu ====== */
.tl-bar-context-menu {
  position: fixed;
  background: rgba(20, 20, 25, 0.98);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  min-width: 180px;
  z-index: 9999;
  padding: 6px;
  animation: contextMenuIn 0.15s ease-out;
}

@keyframes contextMenuIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-5px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tl-bar-context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.12s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.tl-bar-context-menu-item:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.tl-bar-context-menu-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  flex-shrink: 0;
}

.tl-bar-context-menu-item:hover svg {
  opacity: 1;
}

.tl-bar-context-menu-item.danger {
  color: #f87171;
}

.tl-bar-context-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.tl-bar-context-menu-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

/* ====== Milestone Name Input Popup ====== */
.tl-milestone-input-popup {
  position: fixed;
  background: rgba(20, 20, 25, 0.98);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(99, 102, 241, 0.15);
  padding: 16px;
  z-index: 10000;
  min-width: 260px;
  animation: milestonePopupIn 0.2s ease-out;
}

@keyframes milestonePopupIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tl-milestone-input-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.tl-milestone-input-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tl-milestone-input-icon svg {
  width: 14px;
  height: 14px;
  color: white;
}

.tl-milestone-input-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--foreground);
}

.tl-milestone-input-field {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}

.tl-milestone-input-field:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.tl-milestone-input-field::placeholder {
  color: var(--muted-foreground);
}

.tl-milestone-input-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.tl-milestone-input-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.tl-milestone-input-btn.cancel {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted-foreground);
}

.tl-milestone-input-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--foreground);
}

.tl-milestone-input-btn.confirm {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: white;
}

.tl-milestone-input-btn.confirm:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ====== PREMIUM Milestone Diamond Markers - Sharp & Professional ====== */
.tl-bar-milestone-start,
.tl-bar-milestone-end {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 9px;
  height: 9px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(235, 235, 240, 0.95) 100%);
  border: 1.5px solid currentColor;
  border-radius: 1px;
  z-index: 25;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.3),
    0 0 0 2px rgba(255, 255, 255, 0.12),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.6);
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tl-bar-milestone-start {
  left: -5px;
}

.tl-bar-milestone-end {
  right: -5px;
}

/* Milestone diamond hover - dramatic scale effect */
.tl-bar-milestone-start:hover,
.tl-bar-milestone-end:hover {
  transform: translateY(-50%) rotate(45deg) scale(1.6);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 12px currentColor,
    0 0 0 3px rgba(255, 255, 255, 0.2);
  filter: brightness(1.15);
  z-index: 50;
}

/* Subtle reveal on bar hover */
.tl-task-bar-clickup:hover .tl-bar-milestone-start,
.tl-task-bar-clickup:hover .tl-bar-milestone-end {
  transform: translateY(-50%) rotate(45deg) scale(1.2);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.35),
    0 0 6px currentColor;
}

/* Pulse animation on milestone hover */
@keyframes milestone-pulse {

  0%,
  100% {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 0 currentColor;
  }

  50% {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 6px transparent;
  }
}

.tl-bar-milestone-start:hover,
.tl-bar-milestone-end:hover {
  animation: milestone-pulse 1.2s ease-in-out infinite;
}

/* ====== Fade-out Gradient for Future/Overdue Bars ====== */
.tl-bar-fade-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40%;
  min-width: 30px;
  max-width: 100px;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.25) 60%, rgba(0, 0, 0, 0.4) 100%);
  border-radius: 0 12px 12px 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.6;
}

.tl-task-bar-child .tl-bar-fade-overlay {
  border-radius: 0 10px 10px 0;
}

/* Progress incomplete indicator */
.tl-bar-progress-incomplete {
  position: absolute;
  bottom: 6px;
  left: 10px;
  right: 10px;
  height: 3px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 2px;
  overflow: hidden;
}

.tl-bar-progress-incomplete-fill {
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ====== Emoji/Icon Before Task Names in Sidebar ====== */
.tl-task-emoji-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 12px;
  flex-shrink: 0;
  margin-right: 6px;
  opacity: 0.85;
}

/* Status bullet before task name */
.tl-task-status-bullet {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 8px;
  box-shadow: 0 0 4px currentColor;
}

.tl-task-status-bullet.status-todo {
  background: #71717a;
  box-shadow: none;
}

.tl-task-status-bullet.status-in-progress {
  background: #3b82f6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}

.tl-task-status-bullet.status-done {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

/* Sidebar task title bolder */
.tl-task-item-clickup .tl-task-title,
.tl-task-item .tl-task-title {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.tl-task-item-child .tl-task-title {
  font-weight: 550;
}

/* ====== Premium Today Line ====== */
.tl-today-line-clickup,
.tl-today-line {
  width: 1.5px;
  background: linear-gradient(180deg,
      rgba(59, 130, 246, 0) 0%,
      rgba(59, 130, 246, 0.9) 5%,
      rgba(96, 165, 250, 1) 50%,
      rgba(59, 130, 246, 0.9) 95%,
      rgba(59, 130, 246, 0) 100%);
  box-shadow:
    0 0 12px rgba(59, 130, 246, 0.6),
    0 0 24px rgba(59, 130, 246, 0.3),
    0 0 40px rgba(59, 130, 246, 0.15);
  z-index: 50;
}

/* Premium today label */
.tl-today-line-clickup .tl-today-label,
.tl-today-line::before {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: white;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.5);
  white-space: nowrap;
  z-index: 51;
}

/* Today label with date */
.tl-today-date-label {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  padding: 4px 10px 5px;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.5);
  z-index: 51;
  pointer-events: none;
}

.tl-today-date-label-text {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
}

.tl-today-date-label-date {
  font-size: 11px;
  font-weight: 700;
  color: white;
}

/* ====== Premium Row Spacing - Aligned heights ====== */
.tl-gantt-row-clickup {
  height: 58px;
}

.tl-gantt-row-child {
  height: 44px;
}

/* Legacy task items - hidden by ultra-minimal design */
/* .tl-task-item-clickup and .tl-task-item-child now hidden via !important above */

/* ====== Overall Premium Spacing & Polish ====== */
.timeline-linear {
  border-radius: 14px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 12px 40px rgba(0, 0, 0, 0.1);
}

/* Left panel premium styling */
.tl-left-panel-clickup {
  background: var(--card);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  resize: horizontal;
  overflow: auto;
  min-width: 100px;
  max-width: 400px;
}

.tl-left-panel-clickup .tl-left-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tl-left-panel-clickup .tl-left-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tl-task-count-badge {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted-foreground);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 10px;
  opacity: 0.7;
}

/* Smooth scroll - Premium */
.tl-gantt-wrapper {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.tl-gantt-wrapper::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.tl-gantt-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.tl-gantt-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.tl-gantt-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Task list scroll - Premium */
.tl-task-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.04) transparent;
  padding: 4px 0;
}

.tl-task-list::-webkit-scrollbar {
  width: 5px;
}

.tl-task-list::-webkit-scrollbar-track {
  background: transparent;
}

.tl-task-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
}

.tl-task-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Bar label positioning - premium typography */
.tl-task-bar-clickup .tl-bar-label {
  padding-left: 4px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.015em;
  z-index: 5;
  position: relative;
  color: rgba(255, 255, 255, 0.98);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-task-bar-child .tl-bar-label {
  padding-left: 2px;
  font-size: 12px;
  font-weight: 600;
}

/* Avatar on bar adjustments */
.tl-task-bar-clickup .tl-bar-avatar-wrapper {
  left: 6px;
}

.tl-task-bar-clickup .tl-bar-avatar-circle {
  width: 32px;
  height: 32px;
  border-width: 2.5px;
  font-size: 11px;
}

.tl-task-bar-child .tl-bar-avatar-circle {
  width: 26px;
  height: 26px;
  border-width: 2px;
  font-size: 10px;
}

/* Progress bar inside thick task bar - refined */
.tl-bar-progress-clickup {
  position: absolute;
  bottom: 5px;
  left: 38px;
  right: 10px;
  height: 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 3px;
  overflow: hidden;
  z-index: 3;
}

.tl-bar-progress-fill-clickup {
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.7) 100%);
  border-radius: 3px;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

/* Premium Resize handles for thick bars */
.tl-bar-resize-left,
.tl-bar-resize-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 32px;
  cursor: ew-resize;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.tl-bar-resize-left {
  left: 0;
  border-radius: 12px 0 0 12px;
}

.tl-bar-resize-right {
  right: 0;
  border-radius: 0 12px 12px 0;
}

.tl-bar-resize-right {
  right: 0;
  border-radius: 0 12px 12px 0;
}

.tl-task-bar-clickup:hover .tl-bar-resize-left,
.tl-task-bar-clickup:hover .tl-bar-resize-right {
  opacity: 1;
}

.tl-bar-resize-left::after,
.tl-bar-resize-right::after {
  content: '';
  width: 3px;
  height: 14px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  transition: background 0.15s ease;
}

.tl-bar-resize-left:hover::after,
.tl-bar-resize-right:hover::after {
  background: rgba(255, 255, 255, 0.6);
}

/* Connection dots */
.tl-bar-dot {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid currentColor;
  opacity: 0;
  cursor: crosshair;
  transition: all 0.15s ease;
  z-index: 20;
}

.tl-bar-dot-left {
  left: -5px;
}

.tl-bar-dot-right {
  right: -5px;
}

.tl-task-bar-clickup:hover .tl-bar-dot {
  opacity: 1;
}

.tl-bar-dot:hover {
  transform: translateY(-50%) scale(1.3);
  box-shadow: 0 0 8px currentColor;
}

/* ====== Enhanced Header Date Display ====== */
.tl-date-col-clickup.today {
  background: rgba(59, 130, 246, 0.06);
}

.tl-date-col-clickup.today::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #3b82f6, transparent);
}

/* ====== Light Theme Adjustments ====== */
.light .tl-gantt-row-clickup,
.light .tl-gantt-row {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.light .tl-gantt-cell {
  border-right: 1px solid rgba(0, 0, 0, 0.03);
}

.light .tl-gantt-cell.weekend {
  background: rgba(0, 0, 0, 0.02);
}

/* Light Mode ClickUp-style task bars - Enhanced */
.light .tl-task-bar-clickup {
  box-shadow:
    0 2px 8px hsla(217, 80%, 40%, 0.18),
    0 4px 20px hsla(217, 80%, 40%, 0.12),
    inset 0 1px 0 hsla(0, 0%, 100%, 0.2);
  border: 1px solid hsla(217, 80%, 45%, 0.6);
}

.light .tl-task-bar-clickup .tl-bar-label {
  color: #ffffff;
  text-shadow: 0 1px 2px hsla(0, 0%, 0%, 0.2);
  font-weight: 600;
}

.light .tl-today-line-clickup,
.light .tl-today-line {
  box-shadow:
    0 0 12px rgba(59, 130, 246, 0.4),
    0 0 24px rgba(59, 130, 246, 0.2);
}

.light .tl-bar-milestone-start,
.light .tl-bar-milestone-end {
  background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(245, 245, 250, 0.98) 100%);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.12),
    0 0 0 2px rgba(0, 0, 0, 0.06),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.8);
}

.light .tl-bar-custom-milestone {
  background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 248, 252, 0.98) 100%);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.12),
    0 0 0 2px rgba(0, 0, 0, 0.05);
}

/* ====== Milestone Tooltip Styles ====== */
.tl-milestone-tooltip {
  position: fixed;
  z-index: 10000;
  background: linear-gradient(145deg, rgba(30, 30, 40, 0.98) 0%, rgba(20, 20, 28, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0;
  min-width: 200px;
  max-width: 280px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}

.tl-milestone-tooltip-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tl-milestone-tooltip-below .tl-milestone-tooltip-arrow {
  top: -6px;
  bottom: auto;
  transform: translateX(-50%) rotate(180deg);
}

.tl-milestone-tooltip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 2px solid;
  background: rgba(255, 255, 255, 0.03);
}

.tl-milestone-tooltip-icon {
  font-size: 16px;
}

.tl-milestone-tooltip-type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.7);
}

.tl-milestone-tooltip-content {
  padding: 12px 14px;
}

.tl-milestone-tooltip-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.3;
  word-break: break-word;
}

.tl-milestone-tooltip-date-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tl-milestone-tooltip-date-display svg {
  opacity: 0.6;
  flex-shrink: 0;
}

.tl-milestone-date-text {
  font-weight: 500;
}

/* Edit Section Styles */
.tl-milestone-tooltip-edit-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tl-milestone-edit-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
}

.tl-milestone-date-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tl-milestone-date-input {
  flex: 1;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  outline: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.tl-milestone-date-input:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.tl-milestone-date-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.tl-milestone-date-input.tl-milestone-date-changed {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.1);
}

.tl-milestone-date-input::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.6);
  cursor: pointer;
}

.tl-milestone-save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.tl-milestone-save-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.tl-milestone-save-btn:active {
  transform: scale(0.98);
}

.tl-milestone-save-btn.tl-milestone-save-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  animation: save-success-pulse 0.4s ease;
}

@keyframes save-success-pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

.tl-milestone-tooltip-arrow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid rgba(20, 20, 28, 0.98);
}

/* Light theme tooltip */
.light .tl-milestone-tooltip {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.1);
}

.light .tl-milestone-tooltip-type {
  color: rgba(0, 0, 0, 0.6);
}

.light .tl-milestone-tooltip-title {
  color: #1a1a1a;
}

.light .tl-milestone-tooltip-date-display {
  color: rgba(0, 0, 0, 0.5);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.light .tl-milestone-edit-label {
  color: rgba(0, 0, 0, 0.4);
}

.light .tl-milestone-date-input {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: #1a1a1a;
}

.light .tl-milestone-date-input:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.2);
}

.light .tl-milestone-date-input:focus {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(99, 102, 241, 0.5);
}

.light .tl-milestone-date-input::-webkit-calendar-picker-indicator {
  filter: opacity(0.5);
}

.light .tl-milestone-tooltip-arrow {
  border-top-color: rgba(248, 250, 252, 0.98);
}

/* Light theme for context menu */
.light .tl-bar-context-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.05);
}

.light .tl-bar-context-menu-item {
  color: #1a1a1a;
}

.light .tl-bar-context-menu-item:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.light .tl-bar-context-menu-item.danger {
  color: #dc2626;
}

.light .tl-bar-context-menu-item.danger:hover {
  background: rgba(220, 38, 38, 0.1);
}

.light .tl-bar-context-menu-separator {
  background: rgba(0, 0, 0, 0.08);
}

/* Light theme for milestone input popup */
.light .tl-milestone-input-popup {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(99, 102, 241, 0.1);
}

.light .tl-milestone-input-title {
  color: #1a1a1a;
}

.light .tl-milestone-input-field {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
  color: #1a1a1a;
}

.light .tl-milestone-input-field:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.light .tl-milestone-input-btn.cancel {
  background: rgba(0, 0, 0, 0.04);
  color: #6b7280;
}

.light .tl-milestone-input-btn.cancel:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #1a1a1a;
}

/* Light theme for bar milestones */
.light .tl-bar-milestone {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.6);
}

.light .tl-bar-milestone:hover {
  background: rgba(99, 102, 241, 1);
  border-color: rgba(255, 255, 255, 0.9);
}

.light .tl-bar-milestone.filled {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
}

.light .tl-bar-milestone.completed {
  background: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
}

.light .tl-bar-milestone-label {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
}

.light .tl-bar-milestone-edit {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(99, 102, 241, 0.2);
}

.light .tl-bar-milestone-edit input {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
}

/* Light theme for Linear-style task bars - Enhanced Visibility */
.light .tl-task-bar {
  background: linear-gradient(180deg, hsl(217, 85%, 55%) 0%, hsl(217, 80%, 48%) 100%);
  border: 1px solid hsl(217, 75%, 45%);
  box-shadow:
    0 2px 6px hsla(217, 80%, 40%, 0.25),
    0 1px 2px hsla(217, 80%, 40%, 0.15),
    inset 0 1px 0 hsla(0, 0%, 100%, 0.2);
}

.light .tl-task-bar:hover {
  box-shadow:
    0 6px 20px hsla(217, 80%, 40%, 0.35),
    0 2px 6px hsla(217, 80%, 40%, 0.2),
    inset 0 1px 0 hsla(0, 0%, 100%, 0.25);
  border-color: hsl(217, 80%, 40%);
  transform: translateY(-50%) translateY(-1px);
}

.light .tl-task-bar.linear-overdue {
  background: linear-gradient(90deg,
      hsl(217, 85%, 55%) 0%,
      hsl(217, 80%, 50%) 40%,
      hsl(0, 75%, 55%) 70%,
      hsl(0, 80%, 50%) 100%) !important;
  border-color: hsl(0, 75%, 50%);
}

.light .tl-bar-label {
  color: #ffffff;
  text-shadow: 0 1px 2px hsla(0, 0%, 0%, 0.2);
  font-weight: 600;
}

/* Light mode color variants for task bars */
.light .tl-task-bar.color-blue {
  background: linear-gradient(180deg, hsl(217, 90%, 55%) 0%, hsl(217, 85%, 48%) 100%);
  border-color: hsl(217, 80%, 45%);
}

.light .tl-task-bar.color-green {
  background: linear-gradient(180deg, hsl(142, 75%, 42%) 0%, hsl(142, 70%, 35%) 100%);
  border-color: hsl(142, 70%, 32%);
}

.light .tl-task-bar.color-purple {
  background: linear-gradient(180deg, hsl(262, 80%, 58%) 0%, hsl(262, 75%, 50%) 100%);
  border-color: hsl(262, 70%, 48%);
}

.light .tl-task-bar.color-orange {
  background: linear-gradient(180deg, hsl(35, 95%, 55%) 0%, hsl(35, 90%, 48%) 100%);
  border-color: hsl(35, 85%, 45%);
}

.light .tl-task-bar.color-red {
  background: linear-gradient(180deg, hsl(0, 80%, 55%) 0%, hsl(0, 75%, 48%) 100%);
  border-color: hsl(0, 70%, 45%);
}

.light .tl-task-bar.color-pink {
  background: linear-gradient(180deg, hsl(330, 80%, 55%) 0%, hsl(330, 75%, 48%) 100%);
  border-color: hsl(330, 70%, 45%);
}

.light .tl-task-bar.color-cyan {
  background: linear-gradient(180deg, hsl(187, 80%, 45%) 0%, hsl(187, 75%, 38%) 100%);
  border-color: hsl(187, 70%, 35%);
}

/* Light mode status colors for bars */
.light .tl-task-bar.status-todo,
.light .tl-bar-wrapper.todo .tl-bar-body {
  background: linear-gradient(180deg, hsl(220, 15%, 50%) 0%, hsl(220, 15%, 42%) 100%);
  border-color: hsl(220, 15%, 38%);
}

.light .tl-task-bar.status-in-progress,
.light .tl-bar-wrapper.in-progress .tl-bar-body,
.light .tl-bar-wrapper.in_progress .tl-bar-body {
  background: linear-gradient(180deg, hsl(217, 90%, 55%) 0%, hsl(217, 85%, 48%) 100%);
  border-color: hsl(217, 80%, 45%);
}

.light .tl-task-bar.status-done,
.light .tl-bar-wrapper.done .tl-bar-body,
.light .tl-bar-wrapper.completed .tl-bar-body {
  background: linear-gradient(180deg, hsl(142, 75%, 42%) 0%, hsl(142, 70%, 35%) 100%);
  border-color: hsl(142, 70%, 32%);
  opacity: 0.85;
}

.light .tl-task-bar.status-done .tl-bar-label,
.light .tl-bar-wrapper.done .tl-bar-label,
.light .tl-bar-wrapper.completed .tl-bar-label {
  color: #ffffff;
}

/* Light theme for custom milestones */
.light .tl-bar-custom-milestone {
  background: linear-gradient(135deg, hsl(262, 80%, 60%) 0%, hsl(262, 75%, 52%) 100%);
  box-shadow:
    0 3px 8px hsla(262, 80%, 40%, 0.3),
    0 1px 3px hsla(262, 80%, 40%, 0.2);
  border: 1px solid hsl(262, 70%, 48%);
}

.light .tl-bar-custom-milestone-label {
  background: hsl(262, 80%, 58%);
  border-color: hsl(262, 70%, 50%);
  color: #ffffff;
  font-weight: 600;
}

/* ============================================
   LIGHT MODE & THEME FIXES
   Task count badges, column counts, progress bars
   ============================================ */

/* Task Count Badge - Light Mode Fix */
.light .tl-task-count-badge,
[data-mode="light"] .tl-task-count-badge,
[data-theme="pink"] .tl-task-count-badge,
[data-theme="purple"].light .tl-task-count-badge,
[data-theme="ocean"] .tl-task-count-badge,
[data-theme="forest"] .tl-task-count-badge,
[data-theme="sunset"] .tl-task-count-badge,
[data-theme="midnight"] .tl-task-count-badge {
  background: var(--secondary) !important;
  color: var(--secondary-foreground) !important;
  border: 1px solid var(--border) !important;
  opacity: 1;
}

/* Kanban Column Count - Light Mode Fix */
.light .tl-kanban-column-count,
[data-mode="light"] .tl-kanban-column-count,
[data-theme="pink"] .tl-kanban-column-count,
[data-theme="light"] .tl-kanban-column-count {
  background: var(--secondary) !important;
  color: var(--secondary-foreground) !important;
  border: 1px solid var(--border) !important;
}

.light .tl-kanban-col-count,
[data-mode="light"] .tl-kanban-col-count,
[data-theme="pink"] .tl-kanban-col-count,
[data-theme="light"] .tl-kanban-col-count {
  background: var(--secondary) !important;
  color: var(--secondary-foreground) !important;
  border: 1px solid var(--border) !important;
}

.light .kanban-column-count,
[data-mode="light"] .kanban-column-count,
[data-theme="pink"] .kanban-column-count,
[data-theme="light"] .kanban-column-count {
  background: var(--secondary) !important;
  color: var(--secondary-foreground) !important;
}

/* Progress Bar Mini - Light Mode Fix */
.light .tl-progress-mini,
[data-mode="light"] .tl-progress-mini,
[data-theme="pink"] .tl-progress-mini,
[data-theme="light"] .tl-progress-mini {
  background: var(--border) !important;
}

.light .tl-progress-bar-mini,
[data-mode="light"] .tl-progress-bar-mini,
[data-theme="pink"] .tl-progress-bar-mini,
[data-theme="light"] .tl-progress-bar-mini {
  background: var(--border) !important;
}

.light .tl-kanban-col-progress,
[data-mode="light"] .tl-kanban-col-progress,
[data-theme="pink"] .tl-kanban-col-progress,
[data-theme="light"] .tl-kanban-col-progress {
  background: var(--border) !important;
}

/* Legacy task-item-clickup styles removed - using new ultra-minimal design */

/* Section Header - Light Mode Fix */
.light .tl-section-header-clickup,
[data-mode="light"] .tl-section-header-clickup,
[data-theme="pink"] .tl-section-header-clickup,
[data-theme="light"] .tl-section-header-clickup {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

/* Progress Chip - Light Mode Fix */
.light .tl-progress-chip,
[data-mode="light"] .tl-progress-chip,
[data-theme="pink"] .tl-progress-chip,
[data-theme="light"] .tl-progress-chip {
  background: var(--card);
  border: 1px solid var(--border);
}

/* Advanced Toolbar Buttons - Light Mode Fix */
.light .tl-adv-btn,
[data-mode="light"] .tl-adv-btn,
[data-theme="pink"] .tl-adv-btn,
[data-theme="light"] .tl-adv-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}

.light .tl-adv-btn:hover,
[data-mode="light"] .tl-adv-btn:hover,
[data-theme="pink"] .tl-adv-btn:hover,
[data-theme="light"] .tl-adv-btn:hover {
  background: var(--accent);
  color: var(--foreground);
}

.light .tl-adv-btn .btn-badge,
[data-mode="light"] .tl-adv-btn .btn-badge,
[data-theme="pink"] .tl-adv-btn .btn-badge,
[data-theme="light"] .tl-adv-btn .btn-badge {
  background: var(--primary);
  color: var(--primary-foreground);
}

/* Stat Chips - Light Mode Fix */
.light .tl-stat-chip,
[data-mode="light"] .tl-stat-chip,
[data-theme="pink"] .tl-stat-chip,
[data-theme="light"] .tl-stat-chip {
  background: var(--card);
  border: 1px solid var(--border);
}

/* Task Badge Small - Light Mode Fix */
.light .tl-task-badge,
[data-mode="light"] .tl-task-badge,
[data-theme="pink"] .tl-task-badge,
[data-theme="light"] .tl-task-badge {
  color: var(--foreground);
  opacity: 0.8;
}

/* Scrollbar - Light Mode Fix */
.light .tl-gantt-wrapper::-webkit-scrollbar-thumb,
[data-mode="light"] .tl-gantt-wrapper::-webkit-scrollbar-thumb,
[data-theme="pink"] .tl-gantt-wrapper::-webkit-scrollbar-thumb,
[data-theme="light"] .tl-gantt-wrapper::-webkit-scrollbar-thumb {
  background: var(--border);
}

/* Inspector Progress Bar - Light Mode Fix */
.light .tl-inspector-progress-bar,
[data-mode="light"] .tl-inspector-progress-bar,
[data-theme="pink"] .tl-inspector-progress-bar,
[data-theme="light"] .tl-inspector-progress-bar {
  background: var(--border);
}

/* Timeline Header - Light Mode Fix */
.light .tl-header.tl-header-clickup,
[data-mode="light"] .tl-header.tl-header-clickup,
[data-theme="pink"] .tl-header.tl-header-clickup,
[data-theme="light"] .tl-header.tl-header-clickup {
  background: linear-gradient(180deg, var(--card) 0%, var(--background) 100%);
  border-bottom: 1px solid var(--border);
}

/* Kanban Card - Light Mode Fix */
.light .tl-kanban-card,
[data-mode="light"] .tl-kanban-card,
[data-theme="pink"] .tl-kanban-card,
[data-theme="light"] .tl-kanban-card {
  background: var(--card);
  border: 1px solid var(--border);
}

/* Kanban Column - Light Mode Fix */
.light .tl-kanban-column,
[data-mode="light"] .tl-kanban-column,
[data-theme="pink"] .tl-kanban-column,
[data-theme="light"] .tl-kanban-column {
  background: var(--card);
  border: 1px solid var(--border);
}

/* Kanban Task - Light Mode Fix */
.light .tl-kanban-task,
[data-mode="light"] .tl-kanban-task,
[data-theme="pink"] .tl-kanban-task,
[data-theme="light"] .tl-kanban-task {
  background: var(--card);
  border: 1px solid var(--border);
}

/* Expand Button - Light Mode Fix */
.light .tl-expand-all-btn:hover,
[data-mode="light"] .tl-expand-all-btn:hover,
[data-theme="pink"] .tl-expand-all-btn:hover,
[data-theme="light"] .tl-expand-all-btn:hover {
  background: var(--accent);
}

/* Timeline Container - Light Mode Fix */
.light .timeline-linear.clickup-enhanced,
[data-mode="light"] .timeline-linear.clickup-enhanced,
[data-theme="pink"] .timeline-linear.clickup-enhanced,
[data-theme="light"] .timeline-linear.clickup-enhanced {
  background: linear-gradient(180deg, var(--background) 0%, var(--card) 100%);
  box-shadow: 0 8px 40px hsla(0, 0%, 0%, 0.06);
}

/* Separator - Light Mode Fix */
.light .tl-adv-separator,
[data-mode="light"] .tl-adv-separator,
[data-theme="pink"] .tl-adv-separator,
[data-theme="light"] .tl-adv-separator {
  background: var(--border);
}

/* ============================================
   COMPREHENSIVE LIGHT MODE & THEME FIXES
   Premium Clean Finish - All Timeline Elements
   ============================================ */

/* === ClickUp Header - Light Mode === */
.light .tl-header.tl-header-clickup,
[data-mode="light"] .tl-header.tl-header-clickup,
[data-theme="pink"] .tl-header.tl-header-clickup,
[data-theme="purple"].light .tl-header.tl-header-clickup,
[data-theme="ocean"] .tl-header.tl-header-clickup,
[data-theme="forest"] .tl-header.tl-header-clickup,
[data-theme="sunset"] .tl-header.tl-header-clickup {
  background: linear-gradient(180deg, var(--card) 0%, var(--background) 100%) !important;
  border-bottom: 1px solid var(--border) !important;
}

/* === Toolbar Buttons - Light Mode === */
.light .tl-toolbar-btn,
[data-mode="light"] .tl-toolbar-btn,
[data-theme="pink"] .tl-toolbar-btn,
[data-theme="light"] .tl-toolbar-btn {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  color: var(--muted-foreground) !important;
}

.light .tl-toolbar-btn:hover,
[data-mode="light"] .tl-toolbar-btn:hover,
[data-theme="pink"] .tl-toolbar-btn:hover,
[data-theme="light"] .tl-toolbar-btn:hover {
  background: var(--accent) !important;
  color: var(--foreground) !important;
  border-color: var(--primary) !important;
}

.light .tl-toolbar-btn.active,
[data-mode="light"] .tl-toolbar-btn.active,
[data-theme="pink"] .tl-toolbar-btn.active,
[data-theme="light"] .tl-toolbar-btn.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--primary-foreground) !important;
}

/* === Toolbar Divider - Light Mode === */
.light .tl-toolbar-divider,
[data-mode="light"] .tl-toolbar-divider,
[data-theme="pink"] .tl-toolbar-divider,
[data-theme="light"] .tl-toolbar-divider {
  background: var(--border) !important;
}

/* === View Tabs - Light Mode === */
.light .tl-view-tabs-clickup,
[data-mode="light"] .tl-view-tabs-clickup,
[data-theme="pink"] .tl-view-tabs-clickup,
[data-theme="light"] .tl-view-tabs-clickup {
  background: var(--secondary) !important;
  border: 1px solid var(--border) !important;
}

.light .tl-view-tabs-clickup .tl-view-tab,
[data-mode="light"] .tl-view-tabs-clickup .tl-view-tab,
[data-theme="pink"] .tl-view-tabs-clickup .tl-view-tab,
[data-theme="light"] .tl-view-tabs-clickup .tl-view-tab {
  color: var(--muted-foreground) !important;
}

.light .tl-view-tabs-clickup .tl-view-tab:hover,
[data-mode="light"] .tl-view-tabs-clickup .tl-view-tab:hover,
[data-theme="pink"] .tl-view-tabs-clickup .tl-view-tab:hover,
[data-theme="light"] .tl-view-tabs-clickup .tl-view-tab:hover {
  color: var(--foreground) !important;
}

.light .tl-view-tabs-clickup .tl-view-tab.active,
[data-mode="light"] .tl-view-tabs-clickup .tl-view-tab.active,
[data-theme="pink"] .tl-view-tabs-clickup .tl-view-tab.active,
[data-theme="light"] .tl-view-tabs-clickup .tl-view-tab.active {
  background: var(--primary) !important;
  color: var(--primary-foreground) !important;
  box-shadow: 0 2px 8px hsla(var(--primary), 0.3) !important;
}

/* === Zoom Control - Light Mode === */
.light .tl-zoom-clickup,
[data-mode="light"] .tl-zoom-clickup,
[data-theme="pink"] .tl-zoom-clickup,
[data-theme="light"] .tl-zoom-clickup {
  background: var(--secondary) !important;
  border: 1px solid var(--border) !important;
}

.light .tl-zoom-clickup .tl-zoom-level,
[data-mode="light"] .tl-zoom-clickup .tl-zoom-level,
[data-theme="pink"] .tl-zoom-clickup .tl-zoom-level,
[data-theme="light"] .tl-zoom-clickup .tl-zoom-level {
  color: var(--foreground) !important;
}

.light .tl-zoom-dropdown,
[data-mode="light"] .tl-zoom-dropdown,
[data-theme="pink"] .tl-zoom-dropdown,
[data-theme="light"] .tl-zoom-dropdown {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 8px 32px hsla(0, 0%, 0%, 0.15) !important;
}

.light .tl-zoom-preset,
[data-mode="light"] .tl-zoom-preset,
[data-theme="pink"] .tl-zoom-preset,
[data-theme="light"] .tl-zoom-preset {
  color: var(--muted-foreground) !important;
}

.light .tl-zoom-preset:hover,
[data-mode="light"] .tl-zoom-preset:hover,
[data-theme="pink"] .tl-zoom-preset:hover,
[data-theme="light"] .tl-zoom-preset:hover {
  background: var(--accent) !important;
  color: var(--foreground) !important;
}

.light .tl-zoom-preset.active,
[data-mode="light"] .tl-zoom-preset.active,
[data-theme="pink"] .tl-zoom-preset.active,
[data-theme="light"] .tl-zoom-preset.active {
  background: var(--primary) !important;
  color: var(--primary-foreground) !important;
}

/* === Week Ranges Header - Light Mode === */
.light .tl-week-ranges-header,
[data-mode="light"] .tl-week-ranges-header,
[data-theme="pink"] .tl-week-ranges-header,
[data-theme="light"] .tl-week-ranges-header {
  background: linear-gradient(90deg, hsla(var(--primary), 0.03) 0%, hsla(var(--accent), 0.03) 100%) !important;
  border-bottom: 1px solid var(--border) !important;
}

.light .tl-week-range-block,
[data-mode="light"] .tl-week-range-block,
[data-theme="pink"] .tl-week-range-block,
[data-theme="light"] .tl-week-range-block {
  border-right: 1px solid var(--border) !important;
}

.light .tl-week-range-week,
[data-mode="light"] .tl-week-range-week,
[data-theme="pink"] .tl-week-range-week,
[data-theme="light"] .tl-week-range-week {
  color: var(--primary) !important;
  background: hsla(var(--primary), 0.1) !important;
}

/* === Dependency Banner - Light Mode === */
.light .tl-dep-banner,
[data-mode="light"] .tl-dep-banner,
[data-theme="pink"] .tl-dep-banner,
[data-theme="light"] .tl-dep-banner {
  background: hsla(var(--primary), 0.03) !important;
  border-bottom: 1px solid var(--border) !important;
}

.light .tl-dep-toggle,
[data-mode="light"] .tl-dep-toggle,
[data-theme="pink"] .tl-dep-toggle,
[data-theme="light"] .tl-dep-toggle {
  border: 1px solid var(--border) !important;
  color: var(--primary) !important;
}

.light .tl-dep-toggle:hover,
[data-mode="light"] .tl-dep-toggle:hover,
[data-theme="pink"] .tl-dep-toggle:hover,
[data-theme="light"] .tl-dep-toggle:hover {
  background: var(--accent) !important;
}

/* === Left Panel - Light Mode === */
.light .tl-left-panel-clickup,
[data-mode="light"] .tl-left-panel-clickup,
[data-theme="pink"] .tl-left-panel-clickup,
[data-theme="light"] .tl-left-panel-clickup {
  background: linear-gradient(180deg, var(--card) 0%, var(--background) 100%) !important;
  border-right: 1px solid var(--border) !important;
}

/* === Progress Bar Mini - Light Mode === */
.light .tl-progress-bar-mini,
[data-mode="light"] .tl-progress-bar-mini,
[data-theme="pink"] .tl-progress-bar-mini,
[data-theme="light"] .tl-progress-bar-mini {
  background: var(--border) !important;
}

/* === Advanced Toolbar - Light Mode === */
.light .tl-advanced-toolbar,
[data-mode="light"] .tl-advanced-toolbar,
[data-theme="pink"] .tl-advanced-toolbar,
[data-theme="light"] .tl-advanced-toolbar {
  background: linear-gradient(90deg, hsla(var(--primary), 0.03) 0%, var(--card) 100%) !important;
  border-bottom: 1px solid var(--border) !important;
}

/* === Mini Calendar - Light Mode === */
.light .tl-mini-calendar,
[data-mode="light"] .tl-mini-calendar,
[data-theme="pink"] .tl-mini-calendar,
[data-theme="light"] .tl-mini-calendar {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 20px 60px hsla(0, 0%, 0%, 0.12) !important;
}

/* === Critical Path Legend - Light Mode === */
.light .tl-critical-path-legend,
[data-mode="light"] .tl-critical-path-legend,
[data-theme="pink"] .tl-critical-path-legend,
[data-theme="light"] .tl-critical-path-legend {
  background: hsla(0, 75%, 55%, 0.08) !important;
  border: 1px solid hsla(0, 75%, 55%, 0.2) !important;
  color: hsl(0, 75%, 45%) !important;
}

/* === Swimlanes - Light Mode === */
.light .tl-swimlane-header,
[data-mode="light"] .tl-swimlane-header,
[data-theme="pink"] .tl-swimlane-header,
[data-theme="light"] .tl-swimlane-header {
  background: var(--secondary) !important;
  border-bottom: 1px solid var(--border) !important;
}

/* === Bottom Stats Bar - Light Mode === */
.light .tl-bottom-stats,
[data-mode="light"] .tl-bottom-stats,
[data-theme="pink"] .tl-bottom-stats,
[data-theme="light"] .tl-bottom-stats {
  background: linear-gradient(180deg, var(--card) 0%, var(--background) 100%) !important;
  border-top: 1px solid var(--border) !important;
}

/* === Stat Chips - Light Mode === */
.light .tl-stat-chip,
[data-mode="light"] .tl-stat-chip,
[data-theme="pink"] .tl-stat-chip,
[data-theme="light"] .tl-stat-chip {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
}

.light .tl-progress-chip,
[data-mode="light"] .tl-progress-chip,
[data-theme="pink"] .tl-progress-chip,
[data-theme="light"] .tl-progress-chip {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
}

/* === Task Bar Progress Inside - Light Mode === */
.light .tl-bar-progress-clickup,
[data-mode="light"] .tl-bar-progress-clickup,
[data-theme="pink"] .tl-bar-progress-clickup,
[data-theme="light"] .tl-bar-progress-clickup {
  background: hsla(0, 0%, 0%, 0.15) !important;
}

.light .tl-bar-progress-fill-clickup,
[data-mode="light"] .tl-bar-progress-fill-clickup,
[data-theme="pink"] .tl-bar-progress-fill-clickup,
[data-theme="light"] .tl-bar-progress-fill-clickup {
  background: hsla(0, 0%, 100%, 0.7) !important;
}

/* === Connection Dots - Light Mode === */
.light .tl-bar-dot,
[data-mode="light"] .tl-bar-dot,
[data-theme="pink"] .tl-bar-dot,
[data-theme="light"] .tl-bar-dot {
  background: var(--card) !important;
  border: 2px solid var(--primary) !important;
}

/* === Gantt Grid Cells - Light Mode === */
.light .tl-gantt-cell,
[data-mode="light"] .tl-gantt-cell,
[data-theme="pink"] .tl-gantt-cell,
[data-theme="light"] .tl-gantt-cell {
  border-right: 1px solid var(--border) !important;
}

.light .tl-gantt-cell.weekend,
[data-mode="light"] .tl-gantt-cell.weekend,
[data-theme="pink"] .tl-gantt-cell.weekend,
[data-theme="light"] .tl-gantt-cell.weekend {
  background: hsla(var(--muted), 0.3) !important;
}

.light .tl-gantt-cell.today,
[data-mode="light"] .tl-gantt-cell.today,
[data-theme="pink"] .tl-gantt-cell.today,
[data-theme="light"] .tl-gantt-cell.today {
  background: hsla(var(--primary), 0.06) !important;
  box-shadow: inset 0 0 0 1px hsla(var(--primary), 0.15) !important;
}

/* === Gantt Rows - Light Mode === */
.light .tl-gantt-row,
[data-mode="light"] .tl-gantt-row,
[data-theme="pink"] .tl-gantt-row,
[data-theme="light"] .tl-gantt-row {
  border-bottom: 1px solid var(--border) !important;
}

.light .tl-gantt-row:nth-child(even),
[data-mode="light"] .tl-gantt-row:nth-child(even),
[data-theme="pink"] .tl-gantt-row:nth-child(even),
[data-theme="light"] .tl-gantt-row:nth-child(even) {
  background: hsla(var(--muted), 0.2) !important;
}

.light .tl-gantt-row:hover,
[data-mode="light"] .tl-gantt-row:hover,
[data-theme="pink"] .tl-gantt-row:hover,
[data-theme="light"] .tl-gantt-row:hover {
  background: hsla(var(--primary), 0.03) !important;
}

/* === Timeline Date Cells - Light Mode === */
.light .tl-timeline-date-cell,
[data-mode="light"] .tl-timeline-date-cell,
[data-theme="pink"] .tl-timeline-date-cell,
[data-theme="light"] .tl-timeline-date-cell {
  border-right: 1px solid var(--border) !important;
  color: var(--muted-foreground) !important;
}

.light .tl-timeline-date-cell.today,
[data-mode="light"] .tl-timeline-date-cell.today,
[data-theme="pink"] .tl-timeline-date-cell.today,
[data-theme="light"] .tl-timeline-date-cell.today {
  background: hsla(var(--primary), 0.08) !important;
  color: var(--primary) !important;
  font-weight: 700 !important;
}

/* === Scrollbars - Light Mode === */
.light .tl-gantt-wrapper::-webkit-scrollbar-thumb,
[data-mode="light"] .tl-gantt-wrapper::-webkit-scrollbar-thumb,
[data-theme="pink"] .tl-gantt-wrapper::-webkit-scrollbar-thumb,
[data-theme="light"] .tl-gantt-wrapper::-webkit-scrollbar-thumb {
  background: var(--border) !important;
}

.light .tl-gantt-wrapper::-webkit-scrollbar-track,
[data-mode="light"] .tl-gantt-wrapper::-webkit-scrollbar-track,
[data-theme="pink"] .tl-gantt-wrapper::-webkit-scrollbar-track,
[data-theme="light"] .tl-gantt-wrapper::-webkit-scrollbar-track {
  background: var(--background) !important;
}

/* === Inspector Panel - Light Mode === */
.light .tl-inspector,
[data-mode="light"] .tl-inspector,
[data-theme="pink"] .tl-inspector,
[data-theme="light"] .tl-inspector {
  background: var(--card) !important;
  border-left: 1px solid var(--border) !important;
  box-shadow: -8px 0 32px hsla(0, 0%, 0%, 0.06) !important;
}

.light .tl-inspector-header,
[data-mode="light"] .tl-inspector-header,
[data-theme="pink"] .tl-inspector-header,
[data-theme="light"] .tl-inspector-header {
  border-bottom: 1px solid var(--border) !important;
}

.light .tl-inspector-progress-bar,
[data-mode="light"] .tl-inspector-progress-bar,
[data-theme="pink"] .tl-inspector-progress-bar,
[data-theme="light"] .tl-inspector-progress-bar {
  background: var(--border) !important;
}

/* === Section Headers - Light Mode === */
.light .tl-section-header,
[data-mode="light"] .tl-section-header,
[data-theme="pink"] .tl-section-header,
[data-theme="light"] .tl-section-header {
  background: var(--secondary) !important;
  border-bottom: 1px solid var(--border) !important;
}

.light .tl-section-header-clickup,
[data-mode="light"] .tl-section-header-clickup,
[data-theme="pink"] .tl-section-header-clickup,
[data-theme="light"] .tl-section-header-clickup {
  background: var(--card) !important;
  border-bottom: 1px solid var(--border) !important;
}

/* === Kanban Section - Light Mode Premium === */
.light .tl-kanban-section,
[data-mode="light"] .tl-kanban-section,
[data-theme="pink"] .tl-kanban-section,
[data-theme="light"] .tl-kanban-section {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 4px 20px hsla(0, 0%, 0%, 0.04) !important;
}

.light .tl-kanban-header,
[data-mode="light"] .tl-kanban-header,
[data-theme="pink"] .tl-kanban-header,
[data-theme="light"] .tl-kanban-header {
  border-bottom: 1px solid var(--border) !important;
}

.light .tl-kanban-board,
[data-mode="light"] .tl-kanban-board,
[data-theme="pink"] .tl-kanban-board,
[data-theme="light"] .tl-kanban-board {
  background: var(--background) !important;
}

.light .tl-kanban-column,
[data-mode="light"] .tl-kanban-column,
[data-theme="pink"] .tl-kanban-column,
[data-theme="light"] .tl-kanban-column {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
}

.light .tl-kanban-column:hover,
[data-mode="light"] .tl-kanban-column:hover,
[data-theme="pink"] .tl-kanban-column:hover,
[data-theme="light"] .tl-kanban-column:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 4px 16px hsla(var(--primary), 0.08) !important;
}

.light .tl-kanban-col-header,
[data-mode="light"] .tl-kanban-col-header,
[data-theme="pink"] .tl-kanban-col-header,
[data-theme="light"] .tl-kanban-col-header {
  border-bottom: 1px solid var(--border) !important;
}

.light .tl-kanban-col-count,
[data-mode="light"] .tl-kanban-col-count,
[data-theme="pink"] .tl-kanban-col-count,
[data-theme="light"] .tl-kanban-col-count {
  background: var(--secondary) !important;
  color: var(--secondary-foreground) !important;
  border: 1px solid var(--border) !important;
}

.light .tl-kanban-col-progress,
[data-mode="light"] .tl-kanban-col-progress,
[data-theme="pink"] .tl-kanban-col-progress,
[data-theme="light"] .tl-kanban-col-progress {
  background: var(--border) !important;
}

.light .tl-kanban-task,
[data-mode="light"] .tl-kanban-task,
[data-theme="pink"] .tl-kanban-task,
[data-theme="light"] .tl-kanban-task {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
}

.light .tl-kanban-task:hover,
[data-mode="light"] .tl-kanban-task:hover,
[data-theme="pink"] .tl-kanban-task:hover,
[data-theme="light"] .tl-kanban-task:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 4px 12px hsla(var(--primary), 0.06) !important;
}

.light .tl-kanban-add-task,
[data-mode="light"] .tl-kanban-add-task,
[data-theme="pink"] .tl-kanban-add-task,
[data-theme="light"] .tl-kanban-add-task {
  color: var(--muted-foreground) !important;
}

.light .tl-kanban-add-task:hover,
[data-mode="light"] .tl-kanban-add-task:hover,
[data-theme="pink"] .tl-kanban-add-task:hover,
[data-theme="light"] .tl-kanban-add-task:hover {
  background: var(--accent) !important;
  color: var(--foreground) !important;
}

/* Legacy task-item-clickup premium styles removed - using new ultra-minimal design */

/* === Progress Mini Bar - Light Mode === */
.light .tl-progress-mini,
[data-mode="light"] .tl-progress-mini,
[data-theme="pink"] .tl-progress-mini,
[data-theme="light"] .tl-progress-mini {
  background: var(--border) !important;
}

/* === Task Count Badge - Light Mode Premium === */
.light .tl-task-count-badge,
[data-mode="light"] .tl-task-count-badge,
[data-theme="pink"] .tl-task-count-badge,
[data-theme="light"] .tl-task-count-badge {
  background: var(--secondary) !important;
  color: var(--secondary-foreground) !important;
  border: 1px solid var(--border) !important;
  opacity: 1 !important;
}

.light .tl-task-badge,
[data-mode="light"] .tl-task-badge,
[data-theme="pink"] .tl-task-badge,
[data-theme="light"] .tl-task-badge {
  color: var(--foreground) !important;
  opacity: 0.85 !important;
}

/* === Expand Button - Light Mode === */
.light .tl-expand-all-btn,
[data-mode="light"] .tl-expand-all-btn,
[data-theme="pink"] .tl-expand-all-btn,
[data-theme="light"] .tl-expand-all-btn {
  color: var(--muted-foreground) !important;
}

.light .tl-expand-all-btn:hover,
[data-mode="light"] .tl-expand-all-btn:hover,
[data-theme="pink"] .tl-expand-all-btn:hover,
[data-theme="light"] .tl-expand-all-btn:hover {
  background: var(--accent) !important;
  color: var(--foreground) !important;
}

/* === Advanced Button Badge - Light Mode === */
.light .tl-adv-btn,
[data-mode="light"] .tl-adv-btn,
[data-theme="pink"] .tl-adv-btn,
[data-theme="light"] .tl-adv-btn {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  color: var(--muted-foreground) !important;
}

.light .tl-adv-btn:hover,
[data-mode="light"] .tl-adv-btn:hover,
[data-theme="pink"] .tl-adv-btn:hover,
[data-theme="light"] .tl-adv-btn:hover {
  background: var(--accent) !important;
  border-color: var(--primary) !important;
  color: var(--foreground) !important;
}

.light .tl-adv-btn.active,
[data-mode="light"] .tl-adv-btn.active,
[data-theme="pink"] .tl-adv-btn.active,
[data-theme="light"] .tl-adv-btn.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--primary-foreground) !important;
}

.light .tl-adv-btn .btn-badge,
[data-mode="light"] .tl-adv-btn .btn-badge,
[data-theme="pink"] .tl-adv-btn .btn-badge,
[data-theme="light"] .tl-adv-btn .btn-badge {
  background: var(--primary) !important;
  color: var(--primary-foreground) !important;
}

/* === Container Shadow - Light Mode === */
.light .timeline-linear.clickup-enhanced,
[data-mode="light"] .timeline-linear.clickup-enhanced,
[data-theme="pink"] .timeline-linear.clickup-enhanced,
[data-theme="light"] .timeline-linear.clickup-enhanced {
  background: linear-gradient(180deg, var(--background) 0%, var(--card) 100%) !important;
  box-shadow: 0 8px 40px hsla(0, 0%, 0%, 0.06), 0 2px 12px hsla(0, 0%, 0%, 0.03) !important;
}

/* === Gantt Icon - Light Mode === */
.light .tl-gantt-icon,
[data-mode="light"] .tl-gantt-icon,
[data-theme="pink"] .tl-gantt-icon,
[data-theme="light"] .tl-gantt-icon {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%) !important;
}

/* === Body Background - Light Mode === */
.light .tl-body-clickup,
[data-mode="light"] .tl-body-clickup,
[data-theme="pink"] .tl-body-clickup,
[data-theme="light"] .tl-body-clickup {
  background: var(--background) !important;
}

/* === Kanban Column Count Badge - Premium Fix === */
.light .kanban-column-count,
[data-mode="light"] .kanban-column-count,
[data-theme="pink"] .kanban-column-count,
[data-theme="light"] .kanban-column-count {
  background: var(--secondary) !important;
  color: var(--secondary-foreground) !important;
  border: 1px solid var(--border) !important;
}

/* === Task Board Header - Light Mode === */
.light .task-count-badge,
[data-mode="light"] .task-count-badge,
[data-theme="pink"] .task-count-badge,
[data-theme="light"] .task-count-badge {
  background: var(--secondary) !important;
  color: var(--secondary-foreground) !important;
  border: 1px solid var(--border) !important;
}

/* === Tooltip - Light Mode === */
.light .tl-tooltip,
[data-mode="light"] .tl-tooltip,
[data-theme="pink"] .tl-tooltip,
[data-theme="light"] .tl-tooltip {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 8px 32px hsla(0, 0%, 0%, 0.12) !important;
  color: var(--foreground) !important;
}

/* === Tooltip Progress Bar - Light Mode === */
.light .tl-tooltip-progress-bar,
[data-mode="light"] .tl-tooltip-progress-bar,
[data-theme="pink"] .tl-tooltip-progress-bar,
[data-theme="light"] .tl-tooltip-progress-bar {
  background: var(--border) !important;
}

/* === Milestone Progress - Light Mode === */
.light .tl-milestone-progress-bar,
[data-mode="light"] .tl-milestone-progress-bar,
[data-theme="pink"] .tl-milestone-progress-bar,
[data-theme="light"] .tl-milestone-progress-bar {
  background: var(--border) !important;
}

/* ============================================
   Layer Intelligence - Dashboard AI Sidebar
   Enhanced UI/UX Liquid Glass Theme
   ============================================ */

.dashboard-ai-sidebar {
  width: 320px;
  background: var(--glass-bg);
  backdrop-filter: blur(35px);
  -webkit-backdrop-filter: blur(35px);
  border-left: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0);
  opacity: 1;
}

.dashboard-ai-sidebar.collapsed {
  width: 0;
  min-width: 0;
  opacity: 0;
  transform: translateX(100%);
  border-left: none;
  pointer-events: none;
}

.dashboard-ai-sidebar::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, hsla(263, 70%, 50%, 0.12) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.dashboard-ai-sidebar.collapsed::before {
  opacity: 0;
}

.ai-sidebar-header {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.015);
  z-index: 1;
}

.ai-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-sparkle-container {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, hsla(263, 70%, 50%, 0.15), hsla(217, 91%, 60%, 0.15));
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ai-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.01em;
  text-transform: none !important;
  /* Override legacy uppercase */
  font-family: inherit !important;
}

.ai-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-left: 46px;
  opacity: 0.8;
}

.ai-content-area {
  flex: 1;
  padding: 24px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 1;
}

.ai-content-area::-webkit-scrollbar {
  width: 4px;
}

.ai-content-area::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 10px;
}

.ai-summary-card {
  background: hsla(0, 0%, 100%, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
  animation: aiCardFadeIn 0.6s ease-out;
}

@keyframes aiCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-message {
  font-family: inherit !important;
  font-size: 14px;
  line-height: 1.65;
  color: var(--foreground);
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
}

.ai-typing-text {
  display: inline;
  white-space: pre-wrap;
  color: var(--foreground);
  opacity: 0.95;
}

.ai-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--primary);
  margin-left: 3px;
  vertical-align: middle;
  animation: aiCursorPulse 0.8s ease-in-out infinite;
  box-shadow: 0 0 8px var(--primary);
}

@keyframes aiCursorPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.ai-sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.01);
  z-index: 1;
}

.ai-history-btn {
  width: 100%;
  padding: 12px;
  background: hsla(0, 0%, 100%, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-history-btn:hover {
  background: var(--surface-hover);
  color: var(--foreground);
  border-color: var(--primary);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ai-history-btn svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.ai-history-btn:hover svg {
  opacity: 1;
}

/* Insight Tag Styling within AI Message */
.ai-insight-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  background: hsla(263, 70%, 50%, 0.12);
  border: 1px solid hsla(263, 70%, 50%, 0.25);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--foreground);
  margin-right: 6px;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ============================================
   Project Chat (Per-Project Chat Tab)
   ============================================ */
.project-chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px);
  max-height: 700px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--glass-bg-primary);
  backdrop-filter: blur(var(--glass-blur-medium));
  -webkit-backdrop-filter: blur(var(--glass-blur-medium));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.project-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: transparent;
}

.project-chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 48px 32px;
  opacity: 0.9;
  background: linear-gradient(135deg, var(--glass-bg-secondary) 0%, transparent 100%);
  border-radius: 12px;
  margin: 0 8px;
}

.project-chat-date-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 0 16px;
  position: relative;
}

.project-chat-date-sep span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  background: var(--glass-bg-tertiary);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--glass-border-normal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(var(--glass-blur-light));
  -webkit-backdrop-filter: blur(var(--glass-blur-light));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.project-chat-msg {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.project-chat-msg.own {
  flex-direction: row-reverse;
  margin-left: 40px;
}

.project-chat-msg.own .project-chat-msg-avatar {
  background: linear-gradient(135deg, var(--ai-accent-blue), var(--ai-accent-violet));
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.project-chat-msg.own .project-chat-msg-text {
  background: linear-gradient(135deg, var(--ai-accent-blue), var(--ai-accent-violet));
  color: white;
  border: none;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.project-chat-input:focus {
  border-color: var(--ai-accent-blue);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
  background: var(--glass-bg-tertiary);
}

.project-chat-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.project-chat-msg-body {
  flex: 1;
  min-width: 0;
  max-width: 80%;
}

.project-chat-msg-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}

.project-chat-msg-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  background: linear-gradient(135deg, var(--ai-accent-blue), var(--ai-accent-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.project-chat-msg-time {
  font-size: 12px;
  color: var(--muted-foreground);
  opacity: 0.7;
}

.project-chat-msg-text {
  font-size: 15px;
  color: var(--foreground);
  line-height: 1.6;
  word-wrap: break-word;
  padding: 12px 16px;
  background: var(--glass-bg-secondary);
  border: 1px solid var(--glass-border-normal);
  border-radius: 18px;
  backdrop-filter: blur(var(--glass-blur-light));
  -webkit-backdrop-filter: blur(var(--glass-blur-light));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.project-chat-input-area {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border-normal);
  background: var(--glass-bg-primary);
  backdrop-filter: blur(var(--glass-blur-light));
  -webkit-backdrop-filter: blur(var(--glass-blur-light));
}

.project-chat-input {
  flex: 1;
  background: var(--glass-bg-secondary);
  border: 1px solid var(--glass-border-normal);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--foreground);
  outline: none;
  transition: all 0.2s ease;
  backdrop-filter: blur(var(--glass-blur-light));
  -webkit-backdrop-filter: blur(var(--glass-blur-light));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.project-chat-input:focus {
  border-color: var(--ai-accent-blue);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
  background: var(--glass-bg-tertiary);
}

.project-chat-input::placeholder {
  color: var(--muted-foreground);
}

.project-chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

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

.project-chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================
   AI Clean Redesign - Minimalistic
   ============================================ */

/* Hide old superagents view when new clean is used */
.superagents-view {
  display: none !important;
}

.ai-chat-view.ai-clean-landing {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 24px;
}

.ai-top-bar {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  z-index: 60;
}

.ai-history-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.ai-history-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.ai-history-btn svg {
  opacity: 0.7;
}

/* AI History Sidebar */
.ai-history-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--glass-border);
  z-index: 1000;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
}

.ai-history-sidebar.open {
  right: 0;
}

.ai-history-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-history-sidebar-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.ai-history-sidebar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-history-clear-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  color: #ef4444;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-history-clear-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

.ai-history-close-btn {
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-history-close-btn:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.ai-history-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-history-item {
  padding: 12px;
  background: var(--glass-bg-secondary);
  border: 1px solid var(--glass-border-normal);
  border-radius: 10px;
  font-size: 13px;
}

.ai-history-item.user {
  border-left: 3px solid var(--ai-accent-blue);
}

.ai-history-item.assistant {
  border-left: 3px solid var(--ai-accent-violet);
}

.ai-history-item-role {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: 0.6;
}

.ai-history-item-text {
  line-height: 1.5;
  color: var(--foreground);
}

.ai-history-item-time {
  font-size: 10px;
  color: var(--muted-foreground);
  margin-top: 8px;
  text-align: right;
}

.ai-history-empty {
  text-align: center;
  color: var(--muted-foreground);
  margin-top: 40px;
  font-size: 14px;
}

.ai-history-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ai-history-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Landing Page ---- */
.ai-clean-landing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 24px;
}

.ai-clean-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: 120px;
}

.ai-clean-greeting {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 400;
  color: var(--foreground);
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.ai-clean-greeting-sub {
  opacity: 0.45;
}

.ai-clean-hint {
  font-size: 14px;
  color: var(--muted-foreground);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* Prompt Cards */
.ai-clean-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
}

.ai-clean-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  min-height: 110px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  color: var(--foreground);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400;
  transition: border-color 0.2s ease, background 0.2s ease;
}

/* Dark mode: 60% opacity for glass background */
[data-mode="dark"] .ai-clean-card {
  background: color-mix(in hsl, var(--glass-bg) 60%, transparent);
}

.ai-clean-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.ai-clean-card-text {
  flex: 1;
}

.ai-clean-card-icon {
  display: flex;
  width: 24px;
  height: 24px;
  color: var(--muted-foreground);
  opacity: 0.5;
}

.ai-clean-card-icon svg {
  width: 20px;
  height: 20px;
}

/* Input Area */
.ai-clean-input-area {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 24px;
  z-index: 10;
}

.ai-clean-input-box {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(var(--surface-rgb, 20, 20, 30), 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid transparent;
  border-radius: 18px;
  transition: box-shadow 0.18s ease;
  position: relative;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

/* Dark mode: 60% opacity for glass background */
[data-mode="dark"] .ai-clean-input-box {
  background: rgba(var(--surface-rgb, 20, 20, 30), 0.86);
}

.ai-clean-input-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 19px;
  padding: 1px;
  margin: -1px;
  background: linear-gradient(90deg, rgba(255, 107, 107, 0.55), rgba(168, 85, 247, 0.55), rgba(59, 130, 246, 0.45));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.55;
  z-index: -1;
}

.ai-clean-input-box:focus-within {
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.32),
    0 0 0 3px rgba(var(--primary-rgb), 0.16);
}

.ai-clean-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--foreground);
  font-family: inherit;
  line-height: 1.5;
}

.ai-clean-input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.6;
}

.ai-clean-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--foreground);
  color: var(--background);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.ai-clean-send-btn:hover:not(:disabled) {
  opacity: 0.8;
}

.ai-clean-send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.ai-chat-drawer {
  position: fixed;
  top: var(--sidebar-inset);
  right: var(--sidebar-inset);
  bottom: var(--sidebar-inset);
  width: min(420px, 92vw);
  transform: translateX(calc(100% + var(--sidebar-inset) + 20px));
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.ai-chat-drawer.open {
  transform: translateX(0);
}

body.ai-chat-drawer-open .main-content {
  margin-right: calc(min(420px, 92vw) + (var(--sidebar-inset) * 2));
  transition: margin-right 0.28s cubic-bezier(0.22, 1, 0.36, 1), margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-drawer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}

.ai-drawer-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(var(--border-rgb, 255, 255, 255), 0.14);
  background: rgba(var(--surface-rgb, 20, 20, 30), 0.32);
  color: var(--foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ai-drawer-icon-btn:hover {
  background: rgba(var(--surface-rgb, 20, 20, 30), 0.45);
  border-color: rgba(var(--border-rgb, 255, 255, 255), 0.22);
  transform: translateY(-1px);
}

/* Use ai-launch styles for drawer */
.ai-clean-chat.ai-clean-chat-drawer .ai-launch-composer {
  max-width: none;
  margin: 0;
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-composer-hint {
  font-size: 11.5px;
  color: var(--muted-foreground);
  letter-spacing: 0.01em;
  margin-bottom: 8px;
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--foreground);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  resize: none;
  font-family: 'Inter', sans-serif;
  padding: 0 2px 8px;
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-textarea::placeholder {
  color: var(--muted-foreground);
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0 0;
  border-top: 1px solid var(--border);
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-composer-left,
.ai-clean-chat.ai-clean-chat-drawer .ai-launch-composer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-icon-btn:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-chip-static {
  cursor: default;
  color: var(--muted-foreground);
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-chip-static:hover {
  background: transparent;
  color: var(--muted-foreground);
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-send:hover {
  transform: translateY(-1px);
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ai-drawer-model-pill {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(var(--border-rgb, 255, 255, 255), 0.18);
  background: rgba(var(--surface-rgb, 20, 20, 30), 0.35);
  color: var(--foreground);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ai-drawer-model-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffedd5 0%, #fb7185 35%, #a855f7 70%, #3b82f6 100%);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.ai-drawer-model-text {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-clean-chat.ai-clean-chat-drawer .ai-clean-messages {
  padding: 40px 20px 200px;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
}

.ai-clean-chat.ai-clean-chat-drawer .ai-clean-empty {
  padding: 20px 0;
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-title {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--foreground);
  margin: 0 0 6px 0;
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-subtitle {
  font-size: 20px;
  font-weight: 400;
  color: var(--muted-foreground);
  margin: 0 0 28px 0;
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.ai-clean-chat.ai-clean-chat-drawer .ai-clean-chat-input-area {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  padding: 0 20px;
  background: transparent;
  border: none;
}

.ai-clean-chat.ai-clean-chat-drawer .ai-launch-composer {
  max-width: none;
  margin: 0;
}
  color: var(--foreground);
}

.ai-clean-chat.ai-clean-chat-drawer .ai-clean-send-btn:hover:not(:disabled) {
  opacity: 1;
  background: rgba(var(--surface-rgb, 20, 20, 30), 0.52);
}

.ai-chat-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(var(--border-rgb, 255, 255, 255), 0.12);
}

.ai-chat-drawer-title {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--foreground);
}

.ai-chat-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(var(--border-rgb, 255, 255, 255), 0.18);
  background: rgba(var(--surface-rgb, 20, 20, 30), 0.35);
  color: var(--foreground);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.ai-chat-drawer-close:hover {
  transform: translateY(-1px);
  background: rgba(var(--surface-rgb, 20, 20, 30), 0.55);
  border-color: rgba(var(--border-rgb, 255, 255, 255), 0.26);
}

.ai-chat-drawer-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

body.ai-chat-drawer-open {
  overflow: hidden;
}

body.ai-chat-drawer-open .main-content {
  margin-right: calc(min(420px, 92vw) + (var(--sidebar-inset) * 2));
  transition: margin-right 0.28s cubic-bezier(0.22, 1, 0.36, 1), margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 768px) {
  body.ai-chat-drawer-open .main-content {
    margin-right: 0;
  }
}

body.ai-chat-drawer-open .ai-clean-chat {
  padding: 0;
  height: 100%;
}

body.ai-chat-drawer-open .ai-clean-chat-inner {
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ---- Chat View - Glassmorphism Floating Container ---- */
.ai-clean-chat {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: transparent;
  position: relative;
  font-family: 'Inter', sans-serif;
  padding: var(--sidebar-inset);
}

.ai-clean-chat-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  animation: containerFadeIn 0.4s ease-out;
}

.ai-clean-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--glass-border);
  z-index: 10;
}

.ai-clean-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============================================
   Project Context Button - Pill-shaped
   ============================================ */
.ai-project-context-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-foreground);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.ai-project-context-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.ai-project-context-btn.active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.12) 0%, rgba(244, 114, 182, 0.08) 100%);
  border-color: rgba(236, 72, 153, 0.35);
  color: #ec4899;
}

.ai-project-context-btn.active:hover {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.18) 0%, rgba(244, 114, 182, 0.12) 100%);
  border-color: rgba(236, 72, 153, 0.5);
}

.ai-project-context-text {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-project-context-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  margin-left: 2px;
  background: rgba(236, 72, 153, 0.15);
  border: none;
  border-radius: 50%;
  color: #ec4899;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-project-context-clear:hover {
  background: rgba(236, 72, 153, 0.25);
  transform: scale(1.1);
}

/* ============================================
   Project Selector Modal
   ============================================ */
.project-selector-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.project-selector-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.project-selector-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: modalSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
  from { 
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.project-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.project-selector-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.project-selector-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

.project-selector-close:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.project-selector-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
}

.project-selector-search svg {
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.project-selector-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--foreground);
}

.project-selector-search input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.6;
}

.project-selector-list {
  padding: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.project-selector-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.project-selector-item:hover {
  background: var(--surface-hover);
}

.project-selector-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.12) 0%, rgba(244, 114, 182, 0.08) 100%);
  border-radius: 10px;
  color: #ec4899;
}

.project-selector-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-selector-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-selector-item-desc {
  font-size: 12px;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-selector-item-status {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  text-transform: capitalize;
}

.project-selector-item-status.active {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.25);
  color: #22c55e;
}

.project-selector-item-status.paused {
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.25);
  color: #eab308;
}

.project-selector-item-status.completed {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.25);
  color: #6366f1;
}

.project-selector-empty {
  padding: 40px 24px;
  text-align: center;
}

.project-selector-empty p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 14px;
}

.project-selector-empty-hint {
  margin-top: 8px !important;
  font-size: 12px !important;
  opacity: 0.6;
}

/* ============================================
   Project Badge in Chat Input
   ============================================ */
.ai-project-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.08) 0%, rgba(244, 114, 182, 0.04) 100%);
  border: 1px solid rgba(236, 72, 153, 0.2);
  border-radius: 999px;
  color: #ec4899;
  font-size: 12px;
  font-weight: 500;
  width: fit-content;
}

.ai-project-badge svg {
  flex-shrink: 0;
}

.ai-clean-back-btn,
.ai-clean-history-btn,
.ai-clean-code-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-clean-back-btn:hover,
.ai-clean-history-btn:hover,
.ai-clean-code-btn:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.ai-clean-code-btn.active {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--primary);
}

/* ============================================
   AI Coding Mode - Split Screen
   ============================================ */
.ai-clean-chat-body {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
  width: 100%;
  overflow: hidden;
}

.ai-clean-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.ai-clean-chat.ai-coding-mode .ai-clean-left {
  flex: 0 0 var(--ai-split-left, 52%);
  width: var(--ai-split-left, 52%);
}

.ai-clean-chat.ai-coding-mode .ai-clean-messages {
  max-width: none;
  margin: 0;
}

.ai-clean-right {
  display: none;
  flex: 1;
  min-width: 0;
  border-left: 1px solid rgba(var(--border-rgb), 0.8);
  background: linear-gradient(180deg, rgba(var(--background-rgb), 0.65) 0%, rgba(var(--background-rgb), 0.9) 100%);
  position: relative;
}

.ai-clean-chat.ai-coding-mode .ai-clean-right {
  display: flex;
}

.ai-clean-splitter {
  display: none;
  width: 12px;
  cursor: col-resize;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ai-clean-chat.ai-coding-mode .ai-clean-splitter {
  display: flex;
}

.ai-clean-splitter::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: rgba(var(--border-rgb), 0.9);
}

.ai-clean-splitter-handle {
  width: 6px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: all 0.18s ease;
}

.ai-clean-splitter:hover .ai-clean-splitter-handle {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.35);
  transform: scaleY(1.05);
}

.ai-code-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ai-code-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(var(--border-rgb), 0.85);
  background: rgba(var(--background-rgb), 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.ai-code-panel-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 650;
  color: var(--foreground);
}

.ai-code-panel-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  opacity: 0.85;
}

.ai-code-panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-code-lang-container {
  position: relative;
  min-width: 100px;
}

.ai-code-lang-trigger {
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(var(--surface-rgb), 0.7);
  border: 1px solid rgba(var(--border-rgb), 0.9);
  color: var(--foreground);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.ai-code-lang-trigger:hover {
  background: rgba(var(--surface-rgb), 0.95);
  border-color: rgba(99, 102, 241, 0.35);
}

.ai-code-lang-trigger i {
  font-size: 10px;
  transition: transform 0.2s ease;
  opacity: 0.7;
}

.ai-code-lang-container.active .ai-code-lang-trigger i {
  transform: rotate(180deg);
}

.ai-code-lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 140px;
  background: #1a1b1e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  padding: 6px;
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.ai-code-lang-container.active .ai-code-lang-dropdown {
  display: flex;
}

.ai-code-lang-option {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #a1a1aa;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-code-lang-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.ai-code-lang-option.selected {
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
}

.ai-code-lang-option.selected::after {
  content: '✓';
  font-size: 10px;
}

.ai-code-action-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(var(--surface-rgb), 0.7);
  border: 1px solid rgba(var(--border-rgb), 0.9);
  color: var(--foreground);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.ai-code-action-btn:hover:not(:disabled) {
  background: rgba(var(--surface-rgb), 0.95);
  border-color: rgba(99, 102, 241, 0.35);
}

.ai-code-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-code-action-btn.primary {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
}

.ai-code-action-btn.primary:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.26);
}

.ai-code-panel-body {
  flex: 1;
  min-height: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-code-output {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 15, 18, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  height: 0;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  margin-top: 0;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.ai-code-output.show {
  height: 320px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 12px;
  pointer-events: all;
}

.ai-code-output-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.ai-code-tab {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #71717a;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-code-tab:hover {
  color: #fafafa;
  background: rgba(255, 255, 255, 0.05);
}

.ai-code-tab.active {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.1);
}

.ai-code-output-meta {
  font-size: 11px;
  font-weight: 600;
  color: #52525b;
  margin-left: auto;
  margin-right: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family: 'Source Code Pro', monospace;
}

.ai-code-output-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
  color: #71717a;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-code-output-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
  transform: scale(1.05);
}

.ai-code-output-close:active {
  transform: scale(0.95);
}

.ai-code-tab {
  height: 28px;
  padding: 0 10px;
  border-radius: 10px;
  background: rgba(var(--surface-rgb), 0.55);
  border: 1px solid rgba(var(--border-rgb), 0.85);
  color: var(--foreground);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.ai-code-tab:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

.ai-code-tab.active {
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
}

.ai-code-output-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted-foreground);
  opacity: 0.9;
  padding: 0 6px;
}

.ai-code-output-body {
  height: 220px;
  position: relative;
  background: rgba(12, 12, 14, 0.55);
}

.ai-code-output-view {
  position: absolute;
  inset: 0;
  display: none;
}

.ai-code-output-view.show {
  display: block;
}

.ai-code-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #0a0a0c;
  display: block;
}

.ai-code-console {
  height: 100%;
  overflow: auto;
  padding: 10px;
  color: #e4e4e7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.ai-code-console-line {
  padding: 2px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-code-console-empty {
  color: rgba(228, 228, 231, 0.55);
  padding: 18px 10px;
}

.ai-code-editor {
  flex: 1;
  min-height: 0;
  width: 100%;
  resize: none;
  border-radius: 14px;
  padding: 14px;
  background: rgba(12, 12, 14, 0.75);
  border: 1px solid rgba(var(--border-rgb), 0.9);
  color: #e4e4e7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.ai-code-editor:focus {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.ai-code-hint {
  font-size: 12px;
  color: var(--muted-foreground);
  opacity: 0.9;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(var(--border-rgb), 0.85);
  background: rgba(var(--surface-rgb), 0.45);
}

.ai-clean-chat-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  opacity: 0.8;
}

/* Messages */
.ai-clean-messages {
  flex: 1;
  overflow-y: auto;
  padding: 32px 24px 160px;
  max-width: 850px;
  margin: 0 auto;
  width: 100%;
  scroll-behavior: smooth;
}

.ai-clean-msg {
  margin-bottom: 32px;
  animation: messageFadeIn 0.3s ease-out;
}

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

.ai-clean-msg-user {
  display: flex;
  justify-content: flex-end;
}

.ai-clean-bubble-user {
  max-width: 80%;
  padding: 10px 18px;
  background: var(--surface);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ai-clean-msg-assistant {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-assistant-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.ai-assistant-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.ai-assistant-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

.ai-clean-bubble-assistant {
  width: 100%;
}

.ai-clean-content {
  font-size: 15px;
  line-height: 1.6;
  color: var(--foreground);
}

.ai-clean-content p {
  margin-bottom: 16px;
}

.ai-clean-content p:last-child {
  margin-bottom: 0;
}

/* Actions */
.ai-clean-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ai-clean-msg-assistant:hover .ai-clean-actions {
  opacity: 1;
}

.ai-clean-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted-foreground);
  font-size: 12px;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-clean-action-btn[title="Import code to editor"] {
  border-color: rgba(99, 102, 241, 0.25);
  background: rgba(99, 102, 241, 0.08);
  color: var(--foreground);
}

.ai-clean-action-btn:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
  color: var(--foreground);
}

.ai-clean-action-btn[title="Import code to editor"]:hover {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.35);
}

.ai-clean-loading {
  width: 100%;
  margin: 10px 0 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(var(--border-rgb, 255, 255, 255), 0.10);
  background: rgba(var(--surface-rgb), 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.ai-thinking-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ai-thinking-time {
  font-size: 12px;
  color: var(--muted-foreground);
  opacity: 0.9;
}

.ai-thinking-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-thinking-spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(var(--primary-rgb), 0.25);
  border-top-color: rgba(var(--primary-rgb), 0.95);
  animation: aiSpin 0.85s linear infinite;
  flex: 0 0 auto;
}

.ai-thinking-text {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.2;
  will-change: transform, opacity;
}

.ai-thinking-text-animate {
  animation: aiStatusSwap 220ms ease both;
}

@keyframes aiSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

/* Chat input area */
.ai-clean-chat-input-area {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: transparent;
  z-index: 10;
}

/* Base style for non-coding mode */
.ai-clean-chat:not(.ai-coding-mode) .ai-clean-chat-input-area {
  position: absolute;
}

/* Remove old sidebar-dependent positioning as we are now in a fixed-padding container */
.sidebar ~ .main-content .ai-clean-chat:not(.ai-coding-mode) .ai-clean-chat-input-area,
.sidebar.collapsed ~ .main-content .ai-clean-chat:not(.ai-coding-mode) .ai-clean-chat-input-area {
  left: 0;
}

.ai-clean-chat.ai-coding-mode .ai-clean-chat-input-area {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px;
  width: 100%;
}

.ai-clean-input-box {
  width: 100%;
  max-width: 780px;
  background: rgba(var(--surface-rgb), 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  min-width: 0;
}

.ai-clean-chat.ai-coding-mode .ai-clean-input-box {
  max-width: none;
}

.ai-clean-input-box:focus-within {
  border-color: rgba(var(--primary-rgb), 0.55);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.22),
    0 0 0 3px rgba(var(--primary-rgb), 0.16);
}

.ai-input-plus-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface-hover);
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.ai-clean-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 4px;
  color: var(--foreground);
  font-size: 15px;
  outline: none;
  resize: none;
}

.ai-input-model-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--surface-hover);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer;
}

.ai-clean-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(var(--surface-rgb, 20, 20, 30), 0.38);
  color: var(--foreground);
  border: 1px solid rgba(var(--border-rgb, 255, 255, 255), 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.ai-clean-send-btn:hover {
  background: rgba(var(--surface-rgb, 20, 20, 30), 0.52);
}

 .ai-clean-send-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.18);
 }

.ai-clean-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Mobile adjustments - Uses CSS Variables from styles.css */
@media (max-width: 768px) {
  .ai-clean-cards {
    grid-template-columns: 1fr 1fr;
  }

  .ai-clean-hint,
  .ai-clean-cards {
    display: none;
  }

  .ai-clean-greeting {
    font-size: 1.5rem;
  }

  .ai-clean-center {
    padding: 40px 0 var(--mobile-content-padding-bottom);
  }

  .ai-clean-bubble-user {
    max-width: 85%;
  }

  .ai-clean-input,
  #aiAgentInput,
  #aiChatInput {
    font-size: 16px;
    color: var(--foreground);
    caret-color: var(--foreground);
  }

  .ai-clean-input::placeholder,
  #aiAgentInput::placeholder,
  #aiChatInput::placeholder {
    color: var(--muted-foreground);
    opacity: 0.8;
  }

  .ai-clean-input-box {
    background: rgba(var(--surface-rgb), 0.92);
    border-color: rgba(var(--border-rgb), 0.7);
  }

  .ai-clean-input-area,
  .ai-clean-chat-input-area {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--mobile-total-bottom);
    padding: 12px 12px;
    z-index: 3100;
  }

  .ai-clean-messages {
    padding-bottom: calc(var(--mobile-nav-height) + 180px);
  }
}

@media (max-width: 480px) {
  .ai-clean-cards {
    grid-template-columns: 1fr;
  }

  .ai-clean-chat {
    height: calc(100vh - 80px);
    height: calc(100dvh - 80px);
  }

  .ai-clean-chat-inner {
    border-radius: 18px;
  }

  .ai-clean-chat-header {
    padding: 10px 12px;
  }

  .ai-clean-input-box {
    border-radius: 18px;
    padding: 8px 10px;
    gap: 8px;
  }

  .ai-clean-input-area,
  .ai-clean-chat-input-area {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .ai-clean-messages {
    padding-bottom: calc(80px + 180px);
  }
}
/* File Attachment Styles */
.ai-file-attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 8px 16px 0;
  background: var(--surface-hover);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.ai-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  color: var(--foreground);
  font-size: 13px;
}

.ai-file-info svg {
  color: var(--primary);
  flex-shrink: 0;
}

.ai-file-size {
  color: var(--muted-foreground);
  font-size: 12px;
}

.ai-file-remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-file-remove:hover {
  background: var(--destructive);
  color: white;
}

.ai-input-plus-btn:hover {
  background: var(--primary);
  color: white;
}

.ai-file-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 8px 16px 0;
  color: var(--muted-foreground);
  font-size: 13px;
}

.ai-file-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
/* File indicator in chat messages */
.ai-file-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 12px;
  color: inherit;
  opacity: 0.9;
}

.ai-file-indicator svg {
  flex-shrink: 0;
}

/* ============================================
   AI Launch (AI tab landing)
   ============================================ */

.ai-launch {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  padding: var(--sidebar-inset);
  font-family: 'Inter', sans-serif;
  background: var(--background);
}

.ai-launch-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.ai-launch-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-launch-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted-foreground);
}

.ai-launch-brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--glass-border);
}

.ai-launch-ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-foreground);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ai-launch-ghost-btn:hover {
  background: var(--surface-hover);
  color: var(--foreground);
  border-color: var(--border-strong);
}

.ai-launch-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0 24px;
}

.ai-launch-title {
  margin: 0;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.ai-launch-subtitle {
  margin: 6px 0 28px;
  font-size: 20px;
  font-weight: 400;
  color: var(--muted-foreground);
  letter-spacing: -0.01em;
}

/* ---- Composer ---- */
.ai-launch-composer {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 14px 14px 10px;
  box-shadow: var(--glass-shadow);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ai-launch-composer:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--glass-border), var(--glass-shadow);
}

.ai-launch-composer-hint {
  font-size: 11.5px;
  color: var(--muted-foreground);
  letter-spacing: 0.01em;
  margin-bottom: 8px;
}

.ai-launch-textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--foreground);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.55;
  min-height: 46px;
  max-height: 220px;
  padding: 0 2px 8px;
}

.ai-launch-textarea::placeholder {
  color: var(--muted-foreground);
}

.ai-launch-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.ai-launch-composer-left,
.ai-launch-composer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-launch-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ai-launch-icon-btn:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.ai-launch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ai-launch-chip:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.ai-launch-chip-static {
  cursor: default;
  color: var(--muted-foreground);
}

.ai-launch-chip-static:hover {
  background: transparent;
  color: var(--muted-foreground);
}

.ai-launch-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.ai-launch-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.ai-launch-send:hover {
  transform: translateY(-1px);
}

.ai-launch-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---- Mode dropdown ---- */
.ai-mode-select {
  position: relative;
}

.ai-mode-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 230px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--glass-shadow);
  display: none;
  z-index: 40;
}

.ai-mode-menu.open {
  display: block;
}

.ai-mode-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s ease;
}

.ai-mode-option:hover {
  background: var(--surface-hover);
}

.ai-mode-option.selected {
  background: var(--surface-hover);
}

.ai-mode-option-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

.ai-mode-option-desc {
  font-size: 11.5px;
  color: var(--muted-foreground);
}

/* ---- Starters ---- */
.ai-launch-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.ai-launch-starter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-foreground);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ai-launch-starter:hover {
  background: var(--surface-hover);
  color: var(--foreground);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.ai-launch-starter-icon svg {
  width: 14px;
  height: 14px;
  display: block;
  color: var(--muted-foreground);
}

/* ---- Recent chats ---- */
.ai-launch-recent {
  margin-top: 36px;
}

.ai-launch-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.ai-launch-link {
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-transform: none;
}

.ai-launch-link:hover {
  color: var(--foreground);
}

.ai-launch-recent-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.ai-launch-recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--muted-foreground);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ai-launch-recent-item:last-child {
  border-bottom: none;
}

.ai-launch-recent-item:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.ai-launch-recent-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted-foreground);
  flex-shrink: 0;
}

.ai-launch-recent-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-launch-recent-meta {
  font-size: 11.5px;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.ai-launch-recent-empty {
  padding: 16px 14px;
  font-size: 12.5px;
  color: var(--muted-foreground);
}

@media (max-width: 768px) {
  .ai-launch-inner {
    padding: 16px 14px 48px;
  }

  .ai-launch-center {
    padding: 24px 0 16px;
    justify-content: flex-start;
  }

  .ai-launch-title {
    font-size: 26px;
  }

  .ai-launch-subtitle {
    font-size: 17px;
  }

  .ai-launch-composer-bar {
    flex-wrap: wrap;
  }
}

/* ============================================
   Ask AI sidebar — clean panel (docs + whiteboard)
   ============================================ */
.askai-panel {
  width: 400px;
  max-width: 92vw;
  background: var(--card, #0b0b0d);
  border-right: 1px solid var(--border);
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.askai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.askai-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.01em;
}

.askai-mark {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--surface-hover, rgba(255, 255, 255, 0.06));
  color: var(--foreground);
}

.askai-mark svg {
  width: 14px;
  height: 14px;
}

.askai-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.askai-icon-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.askai-icon-btn:hover {
  background: var(--surface-hover, rgba(255, 255, 255, 0.06));
  color: var(--foreground);
}

.askai-icon-btn svg {
  width: 16px;
  height: 16px;
}

.askai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.askai-messages::-webkit-scrollbar {
  width: 6px;
}

.askai-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.askai-intro {
  padding: 20px 20px 10px;
}

.askai-intro .ai-launch-title {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--foreground);
  margin: 0 0 6px 0;
}

.askai-intro .ai-launch-subtitle {
  font-size: 20px;
  font-weight: 400;
  color: var(--muted-foreground);
  margin: 0 0 28px 0;
}

.askai-intro .ai-launch-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.askai-suggestion {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--foreground);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.askai-suggestion:hover {
  background: var(--surface-hover, rgba(255, 255, 255, 0.05));
  border-color: var(--border-strong, var(--border));
}

/* Message stream — flat, no bubbles for the assistant */
.askai-messages .ai-response-card.user-card,
.askai-messages .ai-response-card.assistant-card {
  margin-bottom: 14px;
}

.askai-messages .ai-user-message {
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-hover, rgba(255, 255, 255, 0.05));
  border: none;
  border-radius: 12px;
}

.askai-messages .ai-user-avatar,
.askai-messages .ai-assistant-avatar {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 6px;
}

.askai-messages .ai-user-avatar svg,
.askai-messages .ai-assistant-avatar svg {
  width: 12px;
  height: 12px;
}

.askai-messages .ai-user-content,
.askai-messages .ai-assistant-content {
  font-size: 13.5px;
  line-height: 1.6;
}

.askai-messages .ai-assistant-content {
  padding: 0;
  background: transparent;
  border: none;
}

/* Composer */
.askai-composer-wrap {
  padding: 16px 20px 24px;
  border-top: 1px solid var(--border);
}

.doc-ai-sidebar .ai-launch-composer,
.whiteboard-ai-sidebar .ai-launch-composer,
.ai-sidebar-overlay .ai-launch-composer {
  max-width: none;
  margin: 0;
}

.doc-ai-sidebar .ai-launch-composer-hint,
.whiteboard-ai-sidebar .ai-launch-composer-hint,
.ai-sidebar-overlay .ai-launch-composer-hint {
  font-size: 11.5px;
  color: var(--muted-foreground);
  letter-spacing: 0.01em;
  margin-bottom: 8px;
}

.doc-ai-sidebar .ai-launch-textarea,
.whiteboard-ai-sidebar .ai-launch-textarea,
.ai-sidebar-overlay .ai-launch-textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--foreground);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  resize: none;
  font-family: 'Inter', sans-serif;
  padding: 0 2px 8px;
}

.doc-ai-sidebar .ai-launch-textarea::placeholder,
.whiteboard-ai-sidebar .ai-launch-textarea::placeholder,
.ai-sidebar-overlay .ai-launch-textarea::placeholder {
  color: var(--muted-foreground);
}

.doc-ai-sidebar .ai-launch-composer-bar,
.whiteboard-ai-sidebar .ai-launch-composer-bar,
.ai-sidebar-overlay .ai-launch-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0 0;
  border-top: 1px solid var(--border);
}

.doc-ai-sidebar .ai-launch-composer-left,
.whiteboard-ai-sidebar .ai-launch-composer-left,
.ai-sidebar-overlay .ai-launch-composer-left,
.doc-ai-sidebar .ai-launch-composer-right,
.whiteboard-ai-sidebar .ai-launch-composer-right,
.ai-sidebar-overlay .ai-launch-composer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-ai-sidebar .ai-launch-icon-btn,
.whiteboard-ai-sidebar .ai-launch-icon-btn,
.ai-sidebar-overlay .ai-launch-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.doc-ai-sidebar .ai-launch-icon-btn:hover,
.whiteboard-ai-sidebar .ai-launch-icon-btn:hover,
.ai-sidebar-overlay .ai-launch-icon-btn:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.doc-ai-sidebar .ai-launch-chip,
.whiteboard-ai-sidebar .ai-launch-chip,
.ai-sidebar-overlay .ai-launch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.doc-ai-sidebar .ai-launch-chip-static,
.whiteboard-ai-sidebar .ai-launch-chip-static,
.ai-sidebar-overlay .ai-launch-chip-static {
  cursor: default;
  color: var(--muted-foreground);
}

.doc-ai-sidebar .ai-launch-chip-static:hover,
.whiteboard-ai-sidebar .ai-launch-chip-static:hover,
.ai-sidebar-overlay .ai-launch-chip-static:hover {
  background: transparent;
  color: var(--muted-foreground);
}

.doc-ai-sidebar .ai-launch-chip-dot,
.whiteboard-ai-sidebar .ai-launch-chip-dot,
.ai-sidebar-overlay .ai-launch-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.doc-ai-sidebar .ai-launch-send,
.whiteboard-ai-sidebar .ai-launch-send,
.ai-sidebar-overlay .ai-launch-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.doc-ai-sidebar .ai-launch-send:hover,
.whiteboard-ai-sidebar .ai-launch-send:hover,
.ai-sidebar-overlay .ai-launch-send:hover {
  transform: translateY(-1px);
}

.doc-ai-sidebar .ai-launch-send:disabled,
.whiteboard-ai-sidebar .ai-launch-send:disabled,
.ai-sidebar-overlay .ai-launch-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--foreground);
  color: var(--card, #0b0b0d);
  cursor: pointer;
  transition: opacity 0.15s;
}

.askai-send:hover {
  opacity: 0.85;
}

.askai-send svg {
  width: 15px;
  height: 15px;
}

.askai-context {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--muted-foreground);
  padding: 8px 12px;
  background: rgba(var(--surface-rgb, 20, 20, 30), 0.3);
  border-radius: 8px;
  border: 1px solid rgba(var(--border-rgb, 255, 255, 255), 0.08);
}

.askai-context svg {
  width: 13px;
  height: 13px;
  opacity: 0.7;
}

/* ============================================
   Team Hub (feed + chats + groups)
   ============================================ */
.thub {
  --thub-bg: #0b1020;
  --thub-panel: #0f1629;
  --thub-panel-2: #131c33;
  --thub-line: rgba(148, 163, 184, 0.12);
  --thub-line-strong: rgba(148, 163, 184, 0.22);
  --thub-text: #e6e9f2;
  --thub-muted: #8b94ad;
  --thub-accent: #3b82f6;
  --thub-accent-soft: rgba(59, 130, 246, 0.16);
  --thub-danger: #ef4444;
  color: var(--thub-text);
}

.thub .thub-inner {
  background: var(--thub-bg);
  border: 1px solid var(--thub-line);
  border-radius: 20px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.thub button { font-family: inherit; }
.thub svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---- rail ---- */
.thub-rail {
  width: 72px;
  min-width: 72px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 14px;
  background: var(--thub-panel);
  border-right: 1px solid var(--thub-line);
}
.thub-rail-top, .thub-rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.thub-rail-btn {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--thub-muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.thub-rail-btn svg { width: 20px; height: 20px; }
.thub-rail-label { font-size: 10px; font-weight: 600; letter-spacing: .01em; }
.thub-rail-btn:hover { background: var(--thub-panel-2); color: var(--thub-text); }
.thub-rail-btn.active { background: var(--thub-accent-soft); border-color: rgba(59, 130, 246, .45); color: #93c5fd; }
.thub-rail-badge {
  position: absolute; top: 4px; right: 6px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--thub-danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.thub-rail-me { border: none; background: transparent; padding: 0; cursor: pointer; border-radius: 50%; }
.thub-rail-me .thub-avatar { width: 36px; height: 36px; box-shadow: 0 0 0 2px var(--thub-line-strong); }

/* ---- avatars ---- */
.thub-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, hsl(var(--thub-avatar-hue, 220) 45% 42%), hsl(var(--thub-avatar-hue, 220) 45% 28%));
  color: #f1f5f9; font-weight: 600; font-size: 14px;
  overflow: hidden; flex-shrink: 0;
}
.thub-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thub-avatar-group svg { width: 18px; height: 18px; }
.thub-avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.thub-avatar.lg { width: 72px; height: 72px; font-size: 26px; }
.thub-avatar-group {
  border-radius: 12px; background: var(--group-color, var(--thub-accent)); color: #fff; font-size: 15px;
}
.thub-avatar-group.lg { border-radius: 20px; }
.thub-avatar-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.thub-status-dot {
  position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
  background: #64748b; border: 2px solid var(--thub-panel);
}
.thub-avatar-wrap.online .thub-status-dot { background: #22c55e; }
.thub-avatar-wrap.away .thub-status-dot { background: #f59e0b; }

/* ---- list pane ---- */
.thub-list {
  width: 300px; min-width: 300px;
  display: flex; flex-direction: column;
  background: var(--thub-panel);
  border-right: 1px solid var(--thub-line);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.thub-list-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 8px;
}
.thub-list-header h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: var(--thub-text); }
.thub-list-actions { display: flex; gap: 6px; }
.thub-search {
  display: flex; align-items: center; gap: 8px;
  margin: 6px 12px 10px; padding: 0 12px; height: 38px;
  background: var(--thub-bg); border: 1px solid var(--thub-line); border-radius: 12px;
  color: var(--thub-muted);
}
.thub-search:focus-within { border-color: rgba(59, 130, 246, .6); }
.thub-search svg { width: 16px; height: 16px; }
.thub-search input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: var(--thub-text); font-size: 14px;
}
.thub-search input::placeholder { color: var(--thub-muted); }
.thub-list-items { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.thub-list-items::-webkit-scrollbar { width: 6px; }
.thub-list-items::-webkit-scrollbar-thumb { background: var(--thub-line-strong); border-radius: 3px; }
.thub-list-section {
  padding: 10px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--thub-muted);
}
.thub-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 10px 10px; border: none; border-radius: 12px; background: transparent;
  color: var(--thub-text); text-align: left; cursor: pointer;
  transition: background .12s ease;
}
.thub-item:hover { background: var(--thub-panel-2); }
.thub-item.active { background: var(--thub-accent-soft); }
.thub-item.active .thub-item-name { color: #93c5fd; }
.thub-item.selected { background: var(--thub-accent-soft); }
.thub-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.thub-item-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.thub-item-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thub-item-preview { font-size: 12.5px; color: var(--thub-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thub-item-time { font-size: 11px; color: var(--thub-muted); flex-shrink: 0; }
.thub-item-cta { color: var(--thub-muted); opacity: 0; transition: opacity .12s ease; }
.thub-item:hover .thub-item-cta { opacity: 1; }
.thub-unread {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--thub-accent); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.thub-check {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--thub-line-strong); flex-shrink: 0;
  position: relative; transition: all .12s ease;
}
.thub-check.on { background: var(--thub-accent); border-color: var(--thub-accent); }
.thub-check.on::after {
  content: ''; position: absolute; left: 6px; top: 2px; width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.thub-empty-list { padding: 28px 16px; text-align: center; color: var(--thub-muted); font-size: 13px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.thub-empty-list p { margin: 0; }

/* ---- buttons ---- */
.thub-icon-btn {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 10px; background: transparent; color: var(--thub-muted); cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.thub-icon-btn:hover { background: var(--thub-panel-2); color: var(--thub-text); }
.thub-icon-btn.primary { background: var(--thub-accent); color: #fff; }
.thub-icon-btn.primary:hover { background: #2563eb; }
.thub-icon-btn:disabled { opacity: .5; cursor: default; }
.thub-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--thub-line-strong); background: var(--thub-panel-2);
  color: var(--thub-text); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.thub-btn:hover { border-color: rgba(148, 163, 184, .4); }
.thub-btn.primary { background: var(--thub-accent); border-color: var(--thub-accent); color: #fff; }
.thub-btn.primary:hover { background: #2563eb; }
.thub-btn.danger { color: #fca5a5; border-color: rgba(239, 68, 68, .4); }
.thub-btn:disabled { opacity: .5; cursor: default; }
.thub-btn svg { width: 16px; height: 16px; }

/* ---- main / chat ---- */
.thub-main { background: var(--thub-bg); min-width: 0; }
.thub-chat-header {
  min-height: 64px; padding: 10px 16px;
  border-bottom: 1px solid var(--thub-line);
  background: var(--thub-bg);
  justify-content: space-between;
}
.thub-chat-header-empty { border-bottom: none; min-height: 0; padding: 0; }
.thub-chat-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.thub-chat-titleblock { display: flex; flex-direction: column; min-width: 0; }
.thub-chat-name { font-size: 15px; font-weight: 700; color: var(--thub-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thub-chat-subtitle { font-size: 12px; color: var(--thub-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thub-chat-actions { display: flex; align-items: center; gap: 2px; }
.thub .team-mobile-back { display: none; }

.thub-chat-content { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--thub-bg); }
.thub-messages { flex: 1; overflow-y: auto; padding: 18px 20px 8px; display: flex; flex-direction: column; gap: 2px; }
.thub-messages::-webkit-scrollbar { width: 6px; }
.thub-messages::-webkit-scrollbar-thumb { background: var(--thub-line-strong); border-radius: 3px; }

.thub-empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 24px; gap: 8px; color: var(--thub-muted);
}
.thub-empty-icon {
  width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
  background: var(--thub-panel-2); color: #93c5fd; margin-bottom: 8px;
}
.thub-empty-icon svg { width: 28px; height: 28px; }
.thub-empty-state h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--thub-text); }
.thub-empty-state p { margin: 0 0 12px; font-size: 14px; max-width: 360px; line-height: 1.5; }

.thub-conversation-intro { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 20px; text-align: center; color: var(--thub-muted); }
.thub-conversation-intro h3 { margin: 6px 0 0; color: var(--thub-text); font-size: 18px; }
.thub-conversation-intro p { margin: 0; font-size: 13.5px; }

.thub-day-divider { display: flex; align-items: center; gap: 12px; margin: 14px 0 10px; color: var(--thub-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.thub-day-divider::before, .thub-day-divider::after { content: ''; flex: 1; height: 1px; background: var(--thub-line); }

/* messages */
.thub-msg { display: flex; gap: 10px; align-items: flex-start; padding: 2px 0; max-width: 78%; }
.thub-msg.grouped { margin-top: -2px; }
.thub-msg.own { align-self: flex-end; flex-direction: row-reverse; }
.thub-msg-avatar { width: 30px; flex-shrink: 0; }
.thub-msg-body { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.thub-msg.own .thub-msg-body { align-items: flex-end; }
.thub-msg-meta { display: flex; align-items: baseline; gap: 8px; padding: 0 2px; }
.thub-msg.own .thub-msg-meta { flex-direction: row-reverse; }
.thub-msg-user { font-size: 12.5px; font-weight: 600; color: var(--thub-text); }
.thub-msg-time { font-size: 11px; color: var(--thub-muted); }
.thub-msg-row { display: flex; align-items: center; gap: 6px; }
.thub-msg.own .thub-msg-row { flex-direction: row-reverse; }
.thub-msg-bubble {
  padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5;
  background: var(--thub-panel-2); border: 1px solid var(--thub-line); color: var(--thub-text);
  word-break: break-word; overflow-wrap: anywhere;
}
.thub-msg-bubble a { color: #93c5fd; }
.thub-msg-bubble img, .thub-msg-bubble video { max-width: 100%; border-radius: 10px; }
.thub-msg:not(.own) .thub-msg-bubble { border-top-left-radius: 6px; }
.thub-msg.own .thub-msg-bubble { background: var(--thub-accent); border-color: var(--thub-accent); color: #fff; border-top-right-radius: 6px; }
.thub-msg.own .thub-msg-bubble a { color: #fff; text-decoration: underline; }
.thub-msg.pending .thub-msg-bubble { opacity: .65; }
.thub-msg-tools { opacity: 0; transition: opacity .12s ease; }
.thub-msg:hover .thub-msg-tools { opacity: 1; }
.thub-msg-tool { width: 28px; height: 28px; border: none; border-radius: 8px; background: transparent; color: var(--thub-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.thub-msg-tool:hover { background: var(--thub-panel-2); color: var(--thub-text); }
.thub-msg-tool svg { width: 16px; height: 16px; }
.thub-msg-footer { display: flex; gap: 6px; align-items: center; font-size: 10.5px; color: var(--thub-muted); padding: 0 4px; min-height: 0; }
.thub-msg-footer:empty { display: none; }
.thub-msg-status.seen { color: #60a5fa; }
.thub-msg-system { align-self: center; max-width: 100%; margin: 6px 0; font-size: 12px; color: var(--thub-muted); }
.thub-msg-system span { padding: 4px 10px; border-radius: 999px; background: var(--thub-panel-2); }
.thub-tag, .thub-mention { color: #93c5fd; font-weight: 500; }

/* composer */
.thub-composer-wrap { background: var(--thub-bg); border-top: 1px solid var(--thub-line); padding: 12px 16px 14px; }
.thub-composer {
  display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 6px;
  background: var(--thub-panel); border: 1px solid var(--thub-line-strong); border-radius: 16px;
}
.thub-composer:focus-within { border-color: rgba(59, 130, 246, .7); box-shadow: 0 0 0 3px rgba(59, 130, 246, .12); }
.thub-composer-input { flex: 1; padding: 6px 4px; min-width: 0; }
.thub-composer-input .team-message-input { color: var(--thub-text); font-size: 14px; }
.thub-composer-input .team-message-input::placeholder { color: var(--thub-muted); }
.thub-composer-tools { display: flex; align-items: center; gap: 2px; }
.thub-composer-btn { width: 34px; height: 34px; border-radius: 10px; }
.thub-send-btn {
  width: 36px; height: 36px; border-radius: 12px; background: var(--thub-accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; border: none; cursor: pointer;
}
.thub-send-btn:hover { background: #2563eb; color: #fff; }
.thub-send-btn svg { width: 17px; height: 17px; }

/* ---- feed ---- */
.thub-feed-mode .thub-main { background: var(--thub-bg); }
.thub-feed { flex: 1; overflow-y: auto; padding: 20px 24px 40px; }
.thub-feed::-webkit-scrollbar { width: 6px; }
.thub-feed::-webkit-scrollbar-thumb { background: var(--thub-line-strong); border-radius: 3px; }
.thub-feed-column { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.thub-post-composer {
  display: flex; gap: 12px; padding: 16px; border-radius: 16px;
  background: var(--thub-panel); border: 1px solid var(--thub-line);
}
.thub-post-composer-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.thub-post-input {
  width: 100%; resize: none; border: none; outline: none; background: transparent;
  color: var(--thub-text); font-size: 16px; line-height: 1.5; font-family: inherit; padding: 8px 0 0; min-height: 40px; max-height: 260px;
}
.thub-post-input::placeholder { color: var(--thub-muted); }
.thub-post-composer-footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; border-top: 1px solid var(--thub-line); padding-top: 10px; }
.thub-post-counter { font-size: 12px; color: var(--thub-muted); }
.thub-post-counter.warn { color: #f59e0b; }
.thub-post-submit { height: 34px; padding: 0 18px; border-radius: 999px; }
.thub-feed-list { display: flex; flex-direction: column; gap: 12px; }
.thub-post {
  display: flex; gap: 12px; padding: 16px; border-radius: 16px;
  background: var(--thub-panel); border: 1px solid var(--thub-line);
  animation: thubFadeIn .2s ease;
}
.thub-post.pending { opacity: .7; }
.thub-post-body { flex: 1; min-width: 0; }
.thub-post-head { display: flex; align-items: center; gap: 6px; min-width: 0; margin-bottom: 4px; }
.thub-post-author { font-weight: 700; font-size: 14.5px; color: var(--thub-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thub-post-handle, .thub-post-dot, .thub-post-time { font-size: 13px; color: var(--thub-muted); white-space: nowrap; }
.thub-post-delete { margin-left: auto; width: 30px; height: 30px; opacity: 0; }
.thub-post:hover .thub-post-delete { opacity: 1; }
.thub-post-delete:hover { color: #fca5a5; }
.thub-post-content { font-size: 15px; line-height: 1.55; color: var(--thub-text); white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.thub-post-content a { color: #93c5fd; text-decoration: none; }
.thub-post-content a:hover { text-decoration: underline; }
.thub-post-image { display: block; max-width: 100%; max-height: 420px; border-radius: 12px; margin-top: 10px; border: 1px solid var(--thub-line); }
.thub-post-actions { display: flex; align-items: center; gap: 4px; margin-top: 10px; margin-left: -8px; }
.thub-post-action {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  border: none; border-radius: 999px; background: transparent; color: var(--thub-muted);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: background .12s ease, color .12s ease;
}
.thub-post-action svg { width: 17px; height: 17px; }
.thub-post-action:hover { background: var(--thub-accent-soft); color: #93c5fd; }
.thub-post-action.like:hover { background: rgba(236, 72, 153, .14); color: #f472b6; }
.thub-post-action.like.active { color: #f472b6; }
.thub-post-action.like.active svg { fill: currentColor; }
.thub-post-action.active:not(.like) { color: #93c5fd; }
.thub-post-action:disabled { opacity: .5; cursor: default; }
.thub-comments { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--thub-line); display: flex; flex-direction: column; gap: 10px; }
.thub-comment { display: flex; gap: 10px; }
.thub-comment-body { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 12px; background: var(--thub-panel-2); }
.thub-comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.thub-comment-author { font-size: 13px; font-weight: 700; color: var(--thub-text); }
.thub-comment-time { font-size: 11.5px; color: var(--thub-muted); }
.thub-comment-delete { margin-left: auto; width: 26px; height: 26px; opacity: 0; }
.thub-comment:hover .thub-comment-delete { opacity: 1; }
.thub-comment-delete svg { width: 14px; height: 14px; }
.thub-comment-content { font-size: 13.5px; line-height: 1.5; color: var(--thub-text); word-break: break-word; }
.thub-comment-composer { display: flex; align-items: center; gap: 10px; }
.thub-comment-input {
  flex: 1; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--thub-bg);
  border: 1px solid var(--thub-line-strong); color: var(--thub-text); font-size: 13.5px; outline: none; min-width: 0;
}
.thub-comment-input:focus { border-color: rgba(59, 130, 246, .7); }
.thub-comment-input::placeholder { color: var(--thub-muted); }
.thub-loading { padding: 20px; text-align: center; color: var(--thub-muted); font-size: 13px; }
.thub-feed .thub-empty-state { padding: 60px 24px; }

@keyframes thubFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- members panel ---- */
.thub-panel { background: var(--thub-panel); border-left: 1px solid var(--thub-line); backdrop-filter: none; -webkit-backdrop-filter: none; }
.thub-panel .team-panel-header { color: var(--thub-text); border-bottom: 1px solid var(--thub-line); }

/* ---- modals (new message / new group / group details) ---- */
.thub-picker { display: flex; flex-direction: column; gap: 10px; color: var(--foreground); }
.thub-picker .thub-search { margin: 0; background: var(--surface, rgba(0,0,0,.2)); border-color: var(--border); }
.thub-picker .thub-search input { color: var(--foreground); }
.thub-picker-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.thub-picker .thub-item { color: var(--foreground); }
.thub-picker .thub-item:hover { background: var(--surface-hover, rgba(255,255,255,.05)); }
.thub-picker .thub-item.selected { background: rgba(59, 130, 246, .14); }
.thub-picker .thub-item-preview, .thub-picker .thub-empty-list { color: var(--muted-foreground); }
.thub-picker-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted-foreground); }
.thub-form-row { display: flex; gap: 8px; }
.thub-form-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); margin-top: 4px; }
.thub-input {
  flex: 1; height: 40px; padding: 0 12px; border-radius: 10px; font-size: 14px; outline: none;
  background: var(--surface, rgba(0,0,0,.2)); border: 1px solid var(--border); color: var(--foreground);
}
.thub-input:focus { border-color: var(--primary); }
.thub-color-row { gap: 10px; }
.thub-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: 0 0 0 2px transparent; transition: box-shadow .12s ease; }
.thub-color.on { box-shadow: 0 0 0 2px var(--foreground); }
.thub-form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }
.thub-picker .thub-btn { background: var(--surface, rgba(255,255,255,.04)); border-color: var(--border); color: var(--foreground); }
.thub-picker .thub-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.thub-picker .thub-btn.danger { color: #ef4444; }
.thub-group-desc { font-size: 13.5px; color: var(--muted-foreground); margin: 0; }
.thub-item.static { cursor: default; }
.thub-badge, .thub-role { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(59,130,246,.16); color: #93c5fd; text-transform: uppercase; letter-spacing: .04em; }

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .thub-list { width: 260px; min-width: 260px; }
}
@media (max-width: 768px) {
  .thub .thub-inner { border-radius: 0; border: none; flex-direction: column-reverse; }
  .thub-rail {
    width: 100%; min-width: 0; flex-direction: row; justify-content: space-around; padding: 6px 8px;
    border-right: none; border-top: 1px solid var(--thub-line);
  }
  .thub-rail-top, .thub-rail-bottom { flex-direction: row; gap: 4px; }
  .thub-rail-btn { width: 60px; height: 48px; }
  .thub-list { width: 100%; min-width: 100%; border-right: none; }
  .thub.mobile-chat-open .thub-list { display: none; }
  .thub.mobile-chat-open .thub-main { display: flex; }
  .thub:not(.mobile-chat-open):not(.thub-feed-mode) .thub-main { display: none; }
  .thub-feed-mode .thub-list { display: none; }
  .thub-feed-mode .thub-main { display: flex; }
  .thub .team-mobile-back { display: inline-flex; }
  .thub .team-chat-header-left { width: auto; justify-content: flex-start; }
  .thub .team-channel-name { display: block; }
  .thub-chat-header { background: var(--thub-bg); border-bottom: 1px solid var(--thub-line); }
  .thub-msg { max-width: 92%; }
  .thub-feed { padding: 14px 12px 40px; }
  .thub-messages { padding: 14px 12px 8px; }
  .thub-composer-wrap { padding: 8px 10px 10px; }
}
