@layer business {
#app {
  display: flex;
  flex-direction: row;
  height: 100vh;
  height: 100dvh;  /* iOS Safari 动态视口高度 */
  width: 100vw;
  background-color: var(--bg-void);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  /* Colors for scrollbar to match sidebar background */
  scrollbar-color: transparent transparent; /* Firefox: hidden by default */
  transition: scrollbar-color 0.3s;
}

.sidebar-content:hover {
  scrollbar-color: var(--border-color-default) var(--bg-panel); /* Firefox: show on hover */
}

.sidebar-content::-webkit-scrollbar-track {
  background: var(--bg-panel);
}

.sidebar-content::-webkit-scrollbar-thumb {
  background-color: transparent; /* Hidden by default */
  border: 1px solid var(--bg-panel);
  border-radius: 4px;
}

.sidebar-content:hover::-webkit-scrollbar-thumb {
  background-color: var(--border-color-default); /* Show on hover */
}


/* 排序工具栏 */

.btn-sort:hover {
  background: rgba(139, 119, 90, 0.08);
  border-color: var(--color-primary);
}

.btn-sort.active {
  background: rgba(43, 94, 167, 0.08);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

/* Session 列表容器 */
.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}



/* ── 手机适配 ≤768px ── */
@media (max-width: 768px) {

  .chat-container {
    padding: 12px;
    gap: 12px;
  }

  .input-area {
    padding: 6px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .input-wrapper {
    padding: 8px;
    gap: 8px;
  }


  /* 手机端小字号保底 */
  .conversation-date,
  .conversation-status-badge {
    font-size: 0.75rem;
  }

  /* 触摸设备无 hover，删除按钮始终可见 */
  .conversation-delete-btn {
    opacity: 1;
    font-size: 1rem;
    padding: 6px 8px;
  }

  /* 触摸目标保底 44px */
  .btn-icon,
  #btn-send,
  .btn-stop-inline {
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
  }

}

/* ── Resize Handle（通用可拖拽分割线） ── */
.resize-handle::after {
  content: '';
  position: absolute;
}
.resize-handle:hover {
  background: rgba(43, 94, 167, 0.10);
}
.resize-handle:hover::after,
.resize-handle.dragging::after {
  background: var(--color-primary);
}

/* 水平分割线（左右拖拽） */
.resize-handle--col::after {
  top: 0; bottom: 0;
  left: 2px;
  width: 1px;
  background: var(--ruled-line-color);
}

/* 垂直分割线（上下拖拽） */
.resize-handle--row::after {
  left: 0; right: 0;
  top: 2px;
  height: 1px;
  background: var(--ruled-line-color);
}

/* Chat Panel - 右侧聊天区域 */
#chat-panel {
  flex: 1;
  min-width: min(280px, 100vw);
  flex-shrink: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-void);
}

.main-header {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 60;
  background: rgba(245, 241, 232, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ruled-line-color);
}

.conversation-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.messages-wrapper {
  max-width: var(--max-content-width);
  margin: 0 auto;
  width: 100%;
}

.input-area {
  position: relative;
  padding: 8px 24px 16px 24px; /* 顶部减少内边距，为 todo 留空间 */
  display: flex;
  flex-direction: column; /* 改为纵向布局 */
  align-items: center; /* 居中对齐 */
  background: var(--bg-void);
  /* border-top removed */
}

/* 非 web channel session 的输入禁用遮罩 */
.input-disabled-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(229, 223, 210, 0.85);
  color: var(--text-muted);
  font-size: 0.85rem;
  z-index: 10;
  border-radius: 6px;
}

.input-wrapper {
  max-width: var(--max-content-width);
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color-default);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  gap: 12px;
  box-shadow: var(--paper-shadow);
  transition: border-color 0.3s, box-shadow 0.3s;
  position: relative;
}

.input-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(43, 94, 167, 0.12);
}

#message-input {
  flex: 1;
  color: var(--text-main);
  background: transparent;
  resize: none;
  max-height: 200px;
  min-height: 24px;
  line-height: 1.6;
  font-size: 0.95rem;
}

#message-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* 焦点视觉由外层 .input-wrapper:focus-within 接管，关闭 ui-kit 全局 :focus-visible 的 outline */
#message-input:focus-visible {
  outline: none;
}

/* 发送按钮 hover 微动效与 disabled 态 */
#btn-send:hover:not(:disabled) {
  transform: scale(1.05);
}

#btn-send:active:not(:disabled) {
  transform: scale(0.96);
}

#btn-send:disabled {
  background: rgba(43, 94, 167, 0.25);
  color: rgba(255, 255, 255, 0.6);
  transform: none;
}

/* 输入区图标按钮统一 32px 方形 */
.btn-icon {
  width: 32px;
  min-width: 32px;
  flex-shrink: 0;
}

/* Session Items */
.conversation-item {
  padding: 10px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  background: var(--bg-void);
  position: relative;
}

.conversation-item:hover {
  background: rgba(139, 119, 90, 0.08);
  border-color: rgba(139, 119, 90, 0.2);
}

.conversation-item.active {
  background: rgba(43, 94, 167, 0.08);
  border-color: rgba(43, 94, 167, 0.3);
  box-shadow: 0 1px 3px rgba(43, 94, 167, 0.15);
}

.conversation-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.conversation-title {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 8px;
}

.conversation-status-badge {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* 状态徽章颜色 */
.status-waiting-user {
  background: rgba(43, 94, 167, 0.15);
  color: var(--color-primary);
}

.status-busy {
  background: rgba(217, 119, 6, 0.15);
  color: var(--color-warning);
}

.status-paused {
  background: rgba(202, 138, 4, 0.15);
  color: var(--color-warning);
}

.status-retry {
  background: rgba(124, 58, 237, 0.15);
  color: var(--color-accent);
}

.status-idle {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-muted);
}

.status-failed {
  background: rgba(220, 38, 38, 0.15);
  color: var(--file-color-pdf);
}

.status-completed {
  background: rgba(22, 163, 74, 0.15);
  color: var(--color-success);
}

.conversation-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.conversation-footer-left {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  flex: 1;
}

.conversation-footer-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.conversation-owner {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
  flex-shrink: 1;
}

.conversation-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.conversation-delete-btn {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0;
  cursor: pointer;
  transition: all 0.2s;
  padding: 2px 4px;
  border-radius: 3px;
}

.conversation-item:hover .conversation-delete-btn {
  opacity: 1;
}

.conversation-delete-btn:hover {
  color: var(--color-secondary);
  background: rgba(220, 38, 38, 0.1);
}

/* Session 右键上下文菜单 */
.conversation-ctx-menu {
  display: none;
  position: fixed;
  z-index: 9999;
  background: var(--bg-card);
  border: 1px solid var(--ruled-line-color);
  border-radius: 6px;
  box-shadow: var(--paper-shadow);
  padding: 4px;
  min-width: 130px;
  flex-direction: column;
}

.conversation-ctx-menu.open {
  display: flex;
}

.conversation-ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  width: 100%;
  text-align: left;
}

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

.conversation-ctx-item--danger {
  color: var(--file-color-pdf);
}

.conversation-ctx-item--danger:hover {
  background: rgba(220, 38, 38, 0.1);
}

/* Session Controls - Header状态 */
.conversation-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}



/* Stop 按钮 — 输入框内，红色警示覆盖 ghost */
.btn-stop-inline {
  color: var(--file-color-pdf);
  border-color: rgba(220, 38, 38, 0.3);
}

.btn-stop-inline:hover {
  color: #fff;
  background: var(--file-color-pdf);
  border-color: var(--file-color-pdf);
}

/* ── Updater Banner ───────────────────────────────────────── */

#updater-banner {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10001;
  background: var(--bg-secondary, var(--text-main));
  border: 1px solid var(--border-color, var(--text-main));
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  padding: 14px 16px;
  max-width: 380px;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

#updater-banner.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.updater-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.updater-icon {
  font-size: 1.4rem;
  color: var(--accent, var(--color-accent));
  flex-shrink: 0;
}

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

.updater-title {
  font-size: 0.85rem;
  color: var(--text-primary, var(--border-color-default));
}

.updater-notes {
  font-size: 0.75rem;
  color: var(--text-secondary, var(--text-muted));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.updater-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.updater-progress-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-tertiary, var(--text-main));
  overflow: hidden;
}

.updater-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent, var(--color-accent));
  border-radius: 2px;
  transition: width 0.15s;
}

.updater-progress-text {
  font-size: 0.7rem;
  color: var(--text-secondary, var(--text-muted));
  min-width: 32px;
  text-align: right;
}

.updater-btn-close {
  position: absolute;
  top: 6px;
  right: 6px;
}

/* ── Synced Tab (file-explorer) ──────────────────────────── */

.synced-empty-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.synced-empty-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}

.synced-empty-icon i {
  font-size: 2.5rem;
  opacity: 0.4;
  color: var(--accent, var(--color-accent));
}

.synced-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, var(--border-color-default));
}

.synced-empty-desc {
  font-size: 0.85rem;
  color: var(--text-secondary, var(--text-muted));
  max-width: 320px;
  line-height: 1.5;
}

.synced-setup-btn,
.synced-change-btn {
  margin-top: 8px;
}

/* ── 统一底部状态栏（空状态 + 有文件共用）── */
.synced-bottom-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  flex-shrink: 0;
  border-top: 1px solid var(--border-color-subtle);
  background: var(--bg-card);
}
.synced-bottom-bar .bar-usage {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border-color-default);
  overflow: hidden;
}
.synced-bottom-bar .bar-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width 0.2s;
}
.synced-bottom-bar .bar-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 操作状态消息 */
.synced-bottom-msg {
  display: none;
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.synced-bottom-msg.is-loading { display: block; color: var(--color-primary); background: var(--color-primary-soft); }
.synced-bottom-msg.is-success { display: block; color: var(--color-success); background: var(--color-success-soft); }
.synced-bottom-msg.is-error   { display: block; color: var(--color-danger);  background: var(--color-danger-soft); }

/* ── Workspace Settings Panel ─────────────────────────────── */

.workspace-info-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.workspace-loading {
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 12px 0;
}

.workspace-section {
  background: var(--bg-card);
  border: 1px solid var(--ruled-line-color, var(--border-color-default));
  border-radius: 8px;
  padding: 12px 14px;
}

.workspace-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.workspace-section-title i {
  font-size: 1rem;
  color: var(--color-primary, var(--color-primary-hover));
}

.workspace-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.78rem;
}

.workspace-info-label {
  color: var(--text-muted);
  min-width: 48px;
  flex-shrink: 0;
}

.workspace-info-value {
  color: var(--text-primary);
  word-break: break-all;
}

.workspace-folder-path {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 3px;
}

.workspace-hint {
  color: var(--text-muted);
  font-style: italic;
}

.workspace-quota-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.workspace-quota-fill {
  height: 100%;
  background: var(--color-primary, var(--color-primary-hover));
  border-radius: 3px;
  transition: width 0.3s;
}

.workspace-actions {
  margin-top: 10px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Session Sidebar — 常驻可拖拽侧边栏（两模式共享）
   ═══════════════════════════════════════════════════════════════════════ */

#conversation-sidebar {
  width: 180px;
  min-width: 180px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  overflow: hidden;
}

.conversation-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  flex-shrink: 0;
}

/* ── 侧边栏 Tab 切换 ── */
.sidebar-tabs {
  display: flex;
  gap: 2px;
}
.sidebar-tab {
  background: none;
  border: none;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  position: relative;
}
.sidebar-tab.active {
  color: var(--text-main);
  font-weight: 600;
  background: rgba(43, 94, 167, 0.06);
}
.sidebar-tab:hover { color: var(--text-main); }
.sidebar-tab-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  background: var(--color-secondary, #c0392b);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* 好友列表容器 */
#friend-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
}
.friend-section {
  margin-bottom: 8px;
}
.friend-section-header {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 4px;
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.friend-section-header i { font-size: 0.7rem; }
.friend-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}
.friend-item:hover { background: rgba(43, 94, 167, 0.04); }
.friend-avatar {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--text-muted);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem;
  flex-shrink: 0;
}
.friend-info { flex: 1; min-width: 0; }
.friend-name { font-size: 0.82rem; color: var(--text-main); font-weight: 500; }
.friend-sub { font-size: 0.7rem; color: var(--text-muted); }
.friend-actions { display: flex; gap: 4px; flex-shrink: 0; }
.friend-empty {
  text-align: center; padding: 24px;
  color: var(--text-muted); font-size: 0.78rem;
}

/* Session 列表容器（侧边栏内） */
#conversation-sidebar .conversation-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px 8px;
}

/* ── 分组头 ── */
.conversation-group-header {
  padding: 8px 8px 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.conversation-group-header.collapsed .conversation-group-arrow {
  transform: rotate(-90deg);
}

.conversation-group-arrow {
  font-size: 0.65rem;
  transition: transform 0.15s;
}

.conversation-group-count {
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 6px;
}

/* ── 加载更多按钮 ── */
.conversation-load-more {
  display: block;
  width: 100%;
  padding: 6px 10px;
  margin-top: 2px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}

.conversation-load-more:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.conversation-load-more:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ── 会话项（更新） ── */
.conversation-item {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
  position: relative;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.conversation-item:hover {
  background: rgba(139, 119, 90, 0.06);
}

.conversation-item.active {
  background: rgba(43, 94, 167, 0.07);
  border-color: rgba(43, 94, 167, 0.2);
}

/* ── 头像区容器（相对定位，承载未读角标） ── */
.conversation-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
  line-height: 0;
}

/* ── 头像区（微信宫格） ── */
.conversation-avatar {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
  display: grid;
  overflow: hidden;
  background: #b0a898;
}

/* 单人首字头像 */
.conversation-avatar.single-peer {
  display: flex;
  align-items: center;
  justify-content: center;
}
.conversation-avatar .avatar-initial {
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
}

/* 2×2 宫格 */
.conversation-avatar.grid-2x2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
}

/* 3×3 宫格 */
.conversation-avatar.grid-3x3 {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 1px;
}

/* 宫格单元格文字（2×2 和 3×3 共用） */
.conversation-avatar .avatar-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.5rem;
  line-height: 1;
}

.conversation-avatar.grid-2x2 .avatar-cell {
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.15);
}

.conversation-avatar.grid-3x3 .avatar-cell {
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.15);
}

/* Lyna 默认图标 */
.conversation-avatar.lyna-default {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ── 会话项内容 ── */
.conversation-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.conversation-item-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.conversation-item-title {
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* ── 运行状态点（替代旧徽章） ── */
.conversation-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.conversation-status-dot.busy {
  background: var(--color-warning, #d97706);
  animation: status-pulse 1.2s ease-in-out infinite;
}

.conversation-status-dot.waiting {
  background: var(--color-primary, #3b82f6);
}

.conversation-status-dot.completed {
  background: var(--color-success, #16a34a);
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── 副标题行（App 名称 + 归属） ── */
.conversation-item-subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
}

.conversation-app-names {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* 未读角标（头像右上角） */
.conversation-unread-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dc2626;
  border: 2px solid var(--bg-main, #ffffff);
  z-index: 1;
}

/* ── 归属标签（admin/SA） ── */
.conversation-owner-tag {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  flex-shrink: 1;
}

/* ── 分割线（session-sidebar ↔ chat-panel，模块内细线） ── */
#conversation-divider {
  width: 5px;
  flex-shrink: 0;
  background: transparent;
  cursor: col-resize;
  position: relative;
  z-index: 400;
}

#conversation-divider::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 2px;
  width: 1px;
  background: var(--ruled-line-color, rgba(0,0,0,0.08));
  transition: background 0.15s;
}

#conversation-divider:hover::after,
#conversation-divider.dragging::after {
  background: var(--color-primary);
}

/* ── 移动端适配 ── */
@media (max-width: 768px) {
  #conversation-sidebar {
    width: 100vw;
    max-width: 100vw;
    min-width: unset;
    position: fixed;
    inset: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

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

  #conversation-divider {
    display: none;
  }

  .conversation-item {
    padding: 10px 12px;
  }
}

/* ── 新建会话面板 ── */
.new-conv-dialog {
  display: flex; flex-direction: column; gap: 10px;
}

.new-conv-lyna-btn {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--msg-user-border, #b8cfe8);
  border-radius: var(--radius-md, 6px);
  background: var(--msg-user-bg, #e8f0fa);
  color: var(--color-primary, #2b5ea7);
  font-size: var(--font-size-md, 0.85rem);
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: background 0.15s;
}
.new-conv-lyna-btn:hover { background: #d4e4f6; }

.new-conv-divider {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-muted, #8c7e6a);
  font-size: 0.72rem;
}
.new-conv-divider::before,
.new-conv-divider::after {
  content: ''; flex: 1; height: 1px;
  background: var(--ruled-line-color, #d6cfc2);
}

.new-conv-search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color-default, #d1d5db);
  border-radius: var(--radius-md, 6px);
  font-size: 0.85rem;
  background: var(--bg-input, #fdfcf8);
  outline: none;
  box-sizing: border-box;
}
.new-conv-search:focus { border-color: var(--color-primary, #2b5ea7); }

.new-conv-results {
  max-height: 200px; overflow-y: auto;
  display: flex; flex-direction: column;
}
.new-conv-searching,
.new-conv-empty {
  padding: 16px; text-align: center;
  color: var(--text-muted, #8c7e6a); font-size: 0.78rem;
}

.new-conv-user-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
  transition: background 0.12s;
}
.new-conv-user-item:hover { background: var(--bg-card, #faf7f0); }

.new-conv-user-avatar {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--text-muted, #8c7e6a);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
  flex-shrink: 0;
}

.new-conv-user-info { flex: 1; min-width: 0; }
.new-conv-user-name {
  font-size: 0.85rem; font-weight: 500;
  color: var(--text-main, #3c3226);
}
.new-conv-user-id {
  font-size: 0.72rem;
  color: var(--text-muted, #8c7e6a);
}
.new-conv-status { font-size: 0.7rem; margin-left: 6px; }
.new-conv-status.add { color: var(--color-accent, #6a4c93); }
.new-conv-status.added { color: var(--color-success, #27864a); }

/* 多选模式 */
.new-conv-user-item.selected {
  background: var(--color-primary-light, #e8f0fe);
  border-left: 3px solid var(--color-primary, #2b5ea7);
  padding-left: 7px;
}
.new-conv-action-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0 0 0; gap: 10px;
  border-top: 1px solid var(--color-border, #e0d6c5);
  margin-top: 8px;
}
.new-conv-selected-chips {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.new-conv-chip {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--color-primary, #2b5ea7); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}

}