/* 主样式文件 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f6f8;
  color: #222;
  height: 100vh;
  overflow: hidden;
}

.container {
  display: flex;
  height: 100vh;
}

/* 左侧任务创建区域 */
.left-panel {
  width: 500px;
  min-width: 450px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.left-header {
  padding: 20px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #0f766e, #10b981);
  color: white;
}

.left-header h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.left-header p {
  font-size: 12px;
  opacity: 0.9;
}

.left-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* YouTube：「查找邮箱列表」标签页内容区 */
.email-find-tab-panel {
  margin-top: 4px;
  padding-bottom: 20px;
  width: 100%;
  max-width: none;
}

.email-find-tab-panel .results-table {
  width: 100%;
}

.email-find-section {
  margin-bottom: 4px;
}

.email-find-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.email-find-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.email-find-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 10px;
  font-size: 12px;
  color: #334155;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.email-find-item.is-running {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.email-find-item.is-error {
  border-color: #fecaca;
  background: #fef2f2;
}

.email-find-item-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 6px;
}

.email-find-empty-hint {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
  padding: 4px 0;
}

/* 右侧结果展示区域 */
.right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
}

.right-header {
  padding: 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #f9fafb;
}

.right-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

.right-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* 4 个搜索平台统一隐藏任务执行步骤卡片 */
#task-steps-container,
#task-steps-collapsed {
  display: none !important;
}

#automailer-submitted-panel,
#automailer-server-sent-panel {
  display: none !important;
}

/* 按钮样式 */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #0f766e;
  color: white;
}

.btn-primary:hover {
  background: #0d9488;
}

.btn-secondary {
  background: #e2e8f0;
  color: #475569;
}

.btn-secondary:hover {
  background: #cbd5e1;
}

/* 搜索结果工具栏：按钮按内容宽度，不拉长 */
.results-toolbar .btn {
  flex: 0 0 auto;
  width: auto;
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  background: #f9fafb;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #0f766e;
  background: #ffffff;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  font-family: ui-monospace, monospace;
}

.form-group-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group-checkbox input[type="checkbox"] {
  width: auto;
}

/* 任务列表样式 */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item {
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.task-item:hover {
  background: #f1f5f9;
  border-color: #0f766e;
}

.task-item.active {
  background: #ecfdf5;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

/* 持续搜索任务与普通任务区分：左侧色条 */
.task-item-continuous {
  border-left: 3px solid #0f766e;
  background: #f0fdfa;
}

.task-item-continuous:hover {
  background: #ccfbf1;
}

.task-item-continuous.active {
  background: #ccfbf1;
  border-left-color: #0f766e;
}

/* 未处理已完成任务高亮 */
.task-item.unprocessed-completed {
  border-left: 3px solid #ef4444;
  background: #fef2f2;
}
.task-item.unprocessed-completed:hover {
  background: #fee2e2;
}
.task-item.unprocessed-completed.active {
  background: #fee2e2;
  border-left-color: #ef4444;
  border-color: #ef4444;
}

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

.task-title {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.task-meta {
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
  margin-top: 4px;
}

.task-meta .task-meta-line2 {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #94a3b8;
}

/* 任务卡片内关键词标签 */
.task-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.task-keywords .chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.status-badge.pending {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.running {
  background: #dbeafe;
  color: #1e40af;
}

.status-badge.completed {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.failed {
  background: #fee2e2;
  color: #991b1b;
}

.status-badge.paused {
  background: #e5e7eb;
  color: #374151;
}

.status-badge.fetching_users {
  background: #e0e7ff;
  color: #3730a3;
}

.status-badge.auto_expired {
  background: #f3f4f6;
  color: #6b7280;
}

/* 当前任务执行步骤（与 X 一致：圆点图标 + 标题/说明） */
.step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
}

.step-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-icon.pending {
  background: #e2e8f0;
  color: #64748b;
}

.step-icon.running {
  background: #fef3c7;
  color: #92400e;
  animation: step-pulse 1.5s ease-in-out infinite;
}

.step-icon.completed {
  background: #d1fae5;
  color: #065f46;
}

@keyframes step-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.step-content {
  flex: 1;
}

.step-title {
  font-weight: 500;
  color: #0f172a;
  margin-bottom: 2px;
}

.step-detail {
  font-size: 11px;
  color: #64748b;
}

/* 表格样式 */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.results-table th {
  background: #f9fafb;
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.results-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
}

.results-table tr:hover {
  background: #f9fafb;
}

.results-table thead tr.filter-row th {
  padding: 4px 6px;
  background: #f1f5f9;
  font-weight: normal;
  vertical-align: middle;
}

.results-table .filter-input {
  width: 100%;
  max-width: 120px;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 11px;
  box-sizing: border-box;
}

.results-table .filter-input-small {
  max-width: 60px;
  margin-top: 2px;
  display: block;
}

.results-table .filter-row th select.filter-input {
  max-width: 80px;
}

.cell-title {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 链接样式 */
.link {
  color: #0f766e;
  text-decoration: none;
}

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

/* 加载状态 */
.loading {
  text-align: center;
  padding: 40px;
  color: #64748b;
}

.loading-overlay {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #0f766e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: #e2e8f0;
  border-radius: 50%;
}

/* 标签页 */
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
}

.tab {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  color: #64748b;
  transition: all 0.2s;
}

.tab.active {
  color: #0f766e;
  border-bottom-color: #0f766e;
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: #0f172a;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* 下载模态框 */
.download-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.download-modal.active {
  display: flex;
}

.download-modal-content {
  background: white;
  padding: 32px;
  border-radius: 12px;
  width: 420px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
}

.download-modal-content h3 {
  margin: 0 0 20px 0;
  font-size: 20px;
  font-weight: 600;
  color: #0f172a;
}

.download-modal-content > p {
  margin: 0 0 20px 0;
  line-height: 1.5;
  color: #64748b;
  font-size: 14px;
}

#download-status {
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin: 20px 0;
}

#download-status p {
  margin: 8px 0;
  line-height: 1.6;
}

#download-link-container {
  margin: 24px 0;
}

.download-link {
  display: inline-block;
  padding: 14px 32px;
  background: #0f766e;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.download-link:hover {
  background: #0d9488;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}

.download-modal-content .close-btn {
  margin-top: 20px;
  padding: 10px 24px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  width: auto;
  height: auto;
  display: inline-block;
}

.download-modal-content .close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

/* 用户视频样式 */
.user-item {
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 12px;
}

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

.user-name {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

.user-video-item {
  padding: 12px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 8px;
}

.user-video-item:last-child {
  margin-bottom: 0;
}

.user-video-title {
  font-weight: 500;
  color: #0f172a;
  margin-bottom: 4px;
  line-height: 1.4;
}

.user-video-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 10px;
}

.user-video-link {
  margin-top: 4px;
}

/* 追加关键词弹窗 */
.append-keywords-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.append-keywords-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}
.append-keywords-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 0;
  margin-bottom: 8px;
}
.append-keywords-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}
.append-keywords-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  line-height: 1;
}
.append-keywords-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.append-keywords-hint {
  margin: 0 24px 20px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}
.append-keywords-section {
  padding: 0 24px 20px;
}
.append-keywords-section label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 10px;
}
.append-keywords-chips,
.append-keywords-pending-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.append-keyword-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.append-keyword-chip.source {
  background: #ccfbf1;
  color: #0f766e;
  border: 1px solid #99f6e4;
}
.append-keyword-chip.source:hover {
  background: #99f6e4;
  color: #0d5c52;
}
.append-keyword-chip.pending {
  background: #0f766e;
  color: #fff;
  border: 1px solid #0d5c52;
}
.append-keyword-chip.pending:hover {
  background: #0d5c52;
}
.append-keyword-chip.pending b {
  margin-left: 4px;
  opacity: 0.9;
}
.append-keywords-placeholder {
  font-size: 13px;
  color: #94a3b8;
}
.append-keywords-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px 14px;
  font-size: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  resize: vertical;
  box-sizing: border-box;
  display: block;
  margin-bottom: 10px;
}
.append-keywords-textarea:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}
.append-keywords-add-input-btn {
  padding: 8px 16px;
  font-size: 13px;
  background: #e2e8f0;
  color: #475569;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.append-keywords-add-input-btn:hover {
  background: #cbd5e1;
  color: #0f172a;
}
.append-keywords-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px 24px;
  border-top: 1px solid #e2e8f0;
  margin-top: 4px;
}
.append-keywords-btn {
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  font-weight: 500;
}
.append-keywords-btn.cancel {
  background: #f1f5f9;
  color: #475569;
}
.append-keywords-btn.cancel:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.append-keywords-btn.submit {
  background: #0f766e;
  color: #fff;
}
.append-keywords-btn.submit:hover:not(:disabled) {
  background: #0d5c52;
}
.append-keywords-btn.submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* 导出关键词选择弹窗：数量提示 */
.export-keywords-count {
  color: #0f766e;
  font-weight: 500;
}
.export-keywords-hint {
  color: #64748b;
  font-size: 13px;
  margin-bottom: 8px;
}

/* 前端统一弹窗（替代 alert/confirm/prompt） */
.app-dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  /* 须高于 Sparkols 全屏层（.sparkols-submit-modal-wrap 约 13000），否则 alert 被挡住 */
  z-index: 20001;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.app-dialog-overlay.active {
  display: flex;
}
.app-dialog-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  min-width: 320px;
  max-width: 480px;
  max-height: 85vh;
  overflow: auto;
  padding: 20px 24px;
}
.app-dialog-title {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 12px;
}
.app-dialog-message {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 16px;
}
.app-dialog-input-wrap {
  margin-bottom: 16px;
}
.app-dialog-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}
.app-dialog-input:focus {
  outline: none;
  border-color: #0f766e;
}
.app-dialog-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.app-dialog-btn {
  padding: 8px 18px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  cursor: pointer;
}
.app-dialog-btn:hover {
  background: #f1f5f9;
}
.app-dialog-btn-primary {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}
.app-dialog-btn-primary:hover {
  background: #0d5c52;
}

/* Sparkols 项目制收件箱：聊天式工作台 */
.sparkols-mail-workspace {
  margin-bottom: 12px;
  background: transparent;
}

.sparkols-mail-workspace-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 0 14px;
  border-bottom: 1px solid #e2e8f0;
}

.sparkols-mail-workspace-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.sparkols-mail-workspace-sub {
  margin-top: 6px;
  font-size: 12px;
}

.sparkols-mail-workspace-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.sparkols-mail-task-toolbar {
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
}

.sparkols-mail-workbench-slot {
  margin-top: 14px;
}

.sparkols-mail-workbench {
  display: grid;
  grid-template-columns: var(--sparkols-inbox-left-width, 320px) 6px minmax(0, 1fr);
  height: clamp(640px, calc(100vh - 292px), 920px);
  min-height: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

#mail-inbox-wrap .sparkols-mail-workbench {
  grid-template-columns: var(--sparkols-inbox-left-width, 340px) minmax(0, 1fr);
}

.sparkols-mail-workbench.is-thread-collapsed {
  grid-template-columns: 48px minmax(0, 1fr);
}

.sparkols-mail-resizer {
  position: relative;
  z-index: 3;
  background: transparent;
}

.sparkols-mail-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: #e2e8f0;
}

.sparkols-mail-resizer:hover,
.sparkols-mail-resizing .sparkols-mail-resizer {
  background: rgba(15, 118, 110, 0.08);
}

.sparkols-mail-resizer-left,
.sparkols-mail-resizer-side {
  cursor: col-resize;
  touch-action: none;
}

.sparkols-mail-resizing,
.sparkols-mail-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.sparkols-mail-workbench.is-thread-collapsed .sparkols-mail-resizer-left {
  display: none;
}

.sparkols-mail-thread-list {
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: #f6f8fb;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  position: relative;
}

#mail-inbox-wrap .sparkols-mail-chat-content {
  grid-template-columns: minmax(0, 1fr) var(--sparkols-inbox-side-width, 320px);
}

.sparkols-mail-list-head {
  flex: 0 0 auto;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  color: #334155;
  border-bottom: 1px solid #e2e8f0;
  min-width: 0;
}

.sparkols-mail-list-head b {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sparkols-mail-list-head span {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}

.sparkols-mail-list-title {
  flex: 1 1 auto;
  min-width: 72px;
  overflow: hidden;
}

.sparkols-mail-icon-btn,
.sparkols-mail-back-btn,
.sparkols-mail-collapse-btn {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .sparkols-mail-list-head span {
    display: none;
  }
}

.sparkols-mail-collapse-btn,
.sparkols-mail-collapsed-rail {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font: inherit;
}

.sparkols-mail-collapse-btn {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border-radius: 6px;
  font-size: 18px;
  line-height: 24px;
}

.sparkols-mail-icon-btn,
.sparkols-mail-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
}

.sparkols-mail-list-filters {
  flex: 0 0 auto;
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  max-height: min(360px, calc(100vh - 360px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sparkols-mail-filter-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.sparkols-mail-filter-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sparkols-mail-filter-advanced {
  display: none;
}

.sparkols-mail-filter-advanced.is-open {
  display: grid;
  gap: 10px;
  max-height: min(220px, 30vh);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.sparkols-mail-list-filters span {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sparkols-mail-filter-chip {
  border: 1px solid #dbe4ef;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  padding: 7px 10px;
}

.sparkols-mail-filter-chip.is-active {
  border-color: #0f766e;
  background: #e8f7f3;
  color: #0f766e;
  font-weight: 700;
}

.sparkols-mail-collapsed-rail {
  display: none;
  width: 100%;
  height: 100%;
  padding: 12px 0;
  border: 0;
  border-radius: 0;
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  gap: 10px;
}

.sparkols-mail-collapsed-rail span {
  writing-mode: vertical-rl;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sparkols-mail-collapsed-rail b {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  font-size: 12px;
}

.sparkols-mail-workbench.is-thread-collapsed .sparkols-mail-list-head,
.sparkols-mail-workbench.is-thread-collapsed .sparkols-mail-thread-items,
.sparkols-mail-workbench.is-thread-collapsed .sparkols-mail-list-pager,
.sparkols-mail-workbench.is-thread-collapsed .sparkols-mail-list-empty,
.sparkols-mail-workbench.is-thread-collapsed .sparkols-mail-list-loading {
  display: none;
}

.sparkols-mail-workbench.is-thread-collapsed .sparkols-mail-collapsed-rail {
  display: flex;
}

.sparkols-mail-thread-items {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  contain: layout paint;
}

.sparkols-mail-virtual-list {
  position: relative;
  width: 100%;
  min-height: 100%;
}

.sparkols-mail-virtual-window {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  will-change: transform;
  contain: layout paint style;
}

.sparkols-mail-thread-item {
  position: relative;
  width: 100%;
  display: block;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  border-left: 4px solid transparent;
  background: transparent;
  padding: 11px 12px 11px 12px;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  min-height: 98px;
}

.sparkols-mail-thread-item:hover,
.sparkols-mail-thread-item.is-active {
  background: #fff;
  border-left-color: #0f766e;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08);
}

.sparkols-mail-thread-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.sparkols-mail-thread-main b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.sparkols-mail-thread-main em {
  font-size: 10px;
  font-style: normal;
  color: #94a3b8;
  white-space: nowrap;
}

.sparkols-mail-thread-person,
.sparkols-mail-thread-stage,
.sparkols-mail-thread-foot,
.sparkols-mail-thread-badges {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sparkols-mail-thread-stage {
  color: #0f766e;
}

.sparkols-mail-thread-actions {
  position: absolute;
  right: 10px;
  bottom: 9px;
  display: flex;
  gap: 5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.sparkols-mail-thread-item:hover .sparkols-mail-thread-actions,
.sparkols-mail-thread-item:focus-within .sparkols-mail-thread-actions,
.sparkols-mail-thread-item.is-active .sparkols-mail-thread-actions {
  opacity: 1;
  pointer-events: auto;
}

.sparkols-mail-thread-action {
  border: 1px solid #dbe4ef;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  line-height: 1;
  padding: 5px 8px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.sparkols-mail-thread-action:hover {
  border-color: #94a3b8;
  color: #0f172a;
}

.sparkols-mail-thread-action.is-danger {
  color: #dc2626;
}

.sparkols-mail-thread-action.is-danger:hover {
  border-color: #fecaca;
  background: #fff1f2;
}

.sparkols-mail-thread-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  white-space: normal;
}

.sparkols-mail-thread-badges i {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-style: normal;
  line-height: 20px;
}

.sparkols-mail-thread-badges i:first-child {
  background: #e8f7f3;
  color: #0f766e;
}

.sparkols-mail-list-pager {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e2e8f0;
}

.sparkols-mail-list-empty,
.sparkols-mail-list-loading {
  padding: 18px 16px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.sparkols-mail-chat-pane {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}

.sparkols-mail-chat-content {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 6px var(--sparkols-inbox-side-width, 500px);
  text-align: left;
  overflow: hidden;
}

.sparkols-mail-chat-content > .sparkols-mail-chat-empty:only-child {
  grid-column: 1 / -1;
}

.sparkols-mail-conversation-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.sparkols-mail-chat-header {
  flex: 0 0 auto;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.sparkols-mail-chat-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.sparkols-mail-chat-title-row > div:first-child {
  min-width: 0;
}

.sparkols-mail-chat-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sparkols-mail-chat-meta,
.sparkols-mail-chat-counter {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
}

.sparkols-mail-chat-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sparkols-mail-chat-counter {
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
}

.sparkols-mail-chat-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sparkols-mail-chat-actions .sparkols-mail-chat-counter {
  margin-top: 0;
}

.sparkols-mail-context-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.sparkols-mail-context-strip span {
  padding: 5px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
}

.sparkols-mail-project-note {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  line-height: 1.55;
}

.sparkols-mail-project-note b {
  color: #0f172a;
}

.sparkols-mail-project-note span {
  min-width: 0;
  word-break: break-word;
  white-space: pre-wrap;
}

.sparkols-mail-project-flow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
}

.sparkols-mail-flow-step {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
}

.sparkols-mail-flow-step b {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
}

.sparkols-mail-flow-step span {
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
}

.sparkols-mail-flow-step em {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sparkols-mail-flow-step.is-done {
  border-color: #99f6e4;
  background: #ecfdf5;
}

.sparkols-mail-flow-step.is-done b {
  background: #0f766e;
  color: #fff;
}

.sparkols-mail-ai-strip {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
}

.sparkols-mail-ai-strip b {
  color: #0f172a;
  white-space: nowrap;
}

.sparkols-mail-timeline-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
}

.sparkols-mail-timeline-title {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.sparkols-mail-timeline-title b {
  flex: 0 0 auto;
}

.sparkols-mail-timeline-title em {
  min-width: 0;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  color: #64748b;
  font-size: 12px;
}

.sparkols-mail-timeline-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.sparkols-mail-timeline-head span {
  color: #64748b;
  font-size: 12px;
}

.sparkols-mail-timeline {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 18px 24px;
  background: #f8fafc;
}

.sparkols-mail-message {
  display: flex;
  margin: 10px 0;
}

.sparkols-mail-message.is-outbound {
  justify-content: flex-end;
}

.sparkols-mail-bubble {
  max-width: min(760px, 86%);
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.sparkols-mail-message.is-outbound .sparkols-mail-bubble {
  background: #e8f7f3;
  border-color: #b8e8dc;
}

.sparkols-mail-message.is-local-sent .sparkols-mail-bubble {
  border-color: #5eead4;
  box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.16), 0 4px 14px rgba(15, 118, 110, 0.08);
}

.sparkols-mail-message.is-sending .sparkols-mail-bubble {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.sparkols-mail-message.is-failed .sparkols-mail-bubble {
  border-color: #fecaca;
  background: #fff1f2;
  cursor: pointer;
}

.sparkols-mail-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 6px;
}

.sparkols-mail-bubble-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sparkols-mail-bubble-translate {
  flex: 0 0 auto;
  padding: 3px 8px;
  font-size: 11px;
}

.sparkols-mail-bubble-subject {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  font-size: 13px;
}

.sparkols-mail-bubble-body {
  color: #1e293b;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 2px;
}

.sparkols-mail-ai-summary-toggle {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0f766e;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.sparkols-mail-ai-summary {
  margin-top: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.sparkols-mail-ai-summary.is-hidden {
  display: none;
}

.sparkols-mail-local-note {
  margin-top: 8px;
  color: #0f766e;
  font-size: 12px;
  line-height: 1.4;
}

.sparkols-mail-message.is-sending .sparkols-mail-local-note {
  color: #2563eb;
}

.sparkols-mail-message.is-failed .sparkols-mail-local-note {
  color: #dc2626;
}

.sparkols-mail-local-retry {
  margin-top: 8px;
  min-height: 36px;
  min-width: 72px;
  padding: 8px 14px;
  font-size: 13px;
}

.sparkols-mail-event-line {
  display: grid;
  grid-template-columns: 116px 132px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
}

.sparkols-mail-event-line span {
  color: #94a3b8;
}

.sparkols-mail-event-line b {
  color: #0f172a;
}

.sparkols-mail-event-line em {
  font-style: normal;
  color: #475569;
  word-break: break-word;
}

.sparkols-mail-timeline-empty {
  color: #94a3b8;
  font-size: 13px;
  padding: 18px 0;
  text-align: left;
}

.sparkols-mail-missing-case {
  margin: 14px 0 12px;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
}

.sparkols-mail-missing-case.is-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.sparkols-mail-missing-case.is-info {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #115e59;
}

.sparkols-mail-missing-case-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}

.sparkols-mail-missing-case-head b {
  color: #0f172a;
}

.sparkols-mail-missing-case-head span {
  font-weight: 800;
}

.sparkols-mail-missing-case-body {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.65;
}

.sparkols-mail-missing-case-body p {
  margin: 0;
}

.sparkols-mail-missing-case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.64);
}

.sparkols-mail-missing-case-grid div {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border-right: 1px solid rgba(148, 163, 184, 0.28);
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  min-width: 0;
}

.sparkols-mail-missing-case-grid div:nth-child(2n) {
  border-right: 0;
}

.sparkols-mail-missing-case-grid div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.sparkols-mail-missing-case-grid b {
  font-size: 12px;
  color: #475569;
}

.sparkols-mail-missing-case-grid code {
  color: #0f172a;
  white-space: normal;
  word-break: break-word;
}

.sparkols-mail-reply-dock {
  flex: 0 0 auto;
  border-top: 1px solid #e2e8f0;
  padding: 0;
  background: #fff;
}

.sparkols-mail-reply-dock > summary {
  min-height: 44px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: #0f172a;
  font-weight: 700;
  list-style: none;
}

.sparkols-mail-reply-dock > summary::-webkit-details-marker {
  display: none;
}

.sparkols-mail-reply-dock > summary::before {
  content: "›";
  flex: 0 0 auto;
  color: #64748b;
  transform: rotate(0deg);
  transition: transform 0.16s ease;
}

.sparkols-mail-reply-dock[open] > summary::before {
  transform: rotate(90deg);
}

.sparkols-mail-reply-dock > summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sparkols-mail-reply-dock > summary em {
  flex: 0 0 auto;
  font-style: normal;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.sparkols-mail-reply-dock-body {
  padding: 0 16px 12px;
}

.sparkols-project-reply-translatebar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.sparkols-mail-reply-toolbar-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 8px;
}

.sparkols-mail-reply-head {
  display: grid;
  gap: 12px;
  color: #0f172a;
  font-size: 14px;
  margin-bottom: 8px;
}

.sparkols-mail-reply-head span {
  color: #64748b;
  font-size: 12px;
}

.sparkols-mail-reply-textarea {
  width: 100%;
  min-height: 84px;
  max-height: 180px;
  resize: vertical;
}

.sparkols-mail-reply-textarea + .sparkols-mail-reply-textarea {
  margin-top: 8px;
}

.sparkols-mail-reply-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.sparkols-mail-chat-empty {
  margin: auto;
  max-width: 420px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  padding: 24px;
}

.sparkols-mail-side-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e2e8f0;
  background: #f8fafc;
  overflow: hidden;
}

.sparkols-mail-side-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.sparkols-mail-side-section {
  min-width: 0;
}

.sparkols-mail-side-title {
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
}

.sparkols-mail-side-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sparkols-mail-side-title-row .sparkols-btn-xs {
  flex: 0 0 auto;
  white-space: nowrap;
}

.sparkols-mail-context-summary {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.sparkols-mail-context-summary div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
}

.sparkols-mail-context-summary b {
  color: #0f172a;
}

.sparkols-mail-context-summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sparkols-mail-context-modal-panel {
  width: min(1180px, calc(100vw - 64px));
  max-height: min(840px, calc(100vh - 64px));
  overflow: hidden;
}

.sparkols-mail-context-modal-body {
  max-height: calc(100vh - 170px);
  overflow-y: auto;
  padding-right: 2px;
}

.sparkols-mail-context-modal-body .sparkols-mail-project-flow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sparkols-mail-context-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.sparkols-mail-project-analysis-card {
  padding: 18px;
  border: 1px solid #cfe0f3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.sparkols-mail-project-analysis-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sparkols-mail-project-analysis-head b {
  display: block;
  color: #0f172a;
  font-size: 18px;
  margin-bottom: 6px;
}

.sparkols-mail-project-analysis-head span {
  display: block;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.sparkols-mail-project-analysis-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sparkols-mail-project-analysis-form {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.sparkols-mail-project-analysis-form label {
  display: grid;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
}

.sparkols-mail-project-analysis-result {
  margin-top: 16px;
  min-height: 96px;
  line-height: 1.6;
}

.sparkols-mail-project-analysis-result .sparkols-analysis-account-head img,
.sparkols-mail-project-analysis-result .sparkols-analysis-video-section {
  display: none;
}

.sparkols-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.sparkols-status-ok,
.sparkols-status-warn,
.sparkols-status-muted {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.sparkols-status-ok {
  border: 1px solid #86efac;
  background: #dcfce7;
  color: #15803d;
}

.sparkols-status-warn {
  border: 1px solid #facc15;
  background: #fef9c3;
  color: #a16207;
}

.sparkols-status-muted {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.sparkols-table tr.is-selected > td {
  background: #f0f9ff;
}

.sparkols-mail-context-detail-grid div,
.sparkols-mail-context-detail-block {
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.sparkols-mail-context-detail-grid b,
.sparkols-mail-context-detail-block b {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
  font-size: 14px;
}

.sparkols-mail-context-detail-grid span {
  display: block;
  color: #334155;
  font-size: 16px;
  line-height: 1.6;
  word-break: break-word;
}

.sparkols-mail-context-detail-block {
  margin-top: 12px;
}

.sparkols-mail-context-detail-block pre {
  margin: 0;
  color: #334155;
  font: inherit;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.sparkols-mail-creator-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.sparkols-mail-creator-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  grid-column: 1 / -1;
}

.sparkols-mail-creator-head strong {
  color: #0f172a;
  font-size: 15px;
}

.sparkols-mail-creator-row {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.sparkols-mail-creator-row span {
  display: block;
  margin-bottom: 5px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.25;
}

.sparkols-mail-creator-row strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.sparkols-mail-creator-row a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 1100px) {
  .sparkols-mail-workbench {
    grid-template-columns: 280px minmax(0, 1fr);
    height: clamp(560px, calc(100vh - 280px), 820px);
  }

  .sparkols-mail-chat-content {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .sparkols-mail-side-panel {
    height: auto;
    min-height: 420px;
    border-top: 1px solid #e2e8f0;
    border-left: 0;
  }

  .sparkols-mail-bubble {
    max-width: 92%;
  }

  .sparkols-mail-context-detail-grid {
    grid-template-columns: 1fr;
  }

  .sparkols-mail-creator-card {
    grid-template-columns: 1fr;
  }
}
