
/* ============================================================
   CHAT V2 — ChatsScreen list + ChatScreen active conversation
   Phase 3 Design Refinement · Linear/Things 3 + Slack threading
   ============================================================ */

/* === ChatsScreen — full list === */
.chats-screen {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 0 80px;
}

.chats-head { padding: 8px 0 18px; }
.chats-title {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
  color: var(--text-primary);
}
.chats-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.chats-meta .dot-sep {
  width: 3px; height: 3px;
  background: var(--text-tertiary);
  border-radius: 50%;
}
.chats-unread {
  color: var(--kw-red);
  font-weight: 500;
}

/* Toolbar */
.chats-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
}
.chats-search {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 40px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--separator);
  border-radius: 12px;
  transition: border-color 160ms cubic-bezier(0.32, 0.72, 0, 1), box-shadow 160ms;
  color: var(--text-tertiary);
}
.chats-search:focus-within {
  border-color: rgba(200,16,46,0.32);
  box-shadow: 0 0 0 4px rgba(200,16,46,0.08);
  color: var(--text-secondary);
}
.chats-search input {
  flex: 1; border: none; outline: none; background: none;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}
.chats-search input::placeholder { color: var(--text-tertiary); }
.chats-search-clear {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: none;
  background: var(--separator);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 120ms;
}
.chats-search-clear:hover { background: var(--separator-strong); }

.chats-new-btn {
  display: flex; align-items: center; gap: 8px;
  height: 40px;
  padding: 0 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--separator);
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 160ms cubic-bezier(0.32, 0.72, 0, 1);
  white-space: nowrap;
}
.chats-new-btn:hover {
  background: var(--kw-red);
  color: white;
  border-color: var(--kw-red);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(200,16,46,0.25);
}
.chats-new-btn kbd {
  font-family: inherit;
  font-size: 11px;
  padding: 2px 5px;
  background: var(--bg-tinted);
  border: 1px solid var(--separator);
  border-radius: 4px;
  color: var(--text-tertiary);
  margin-left: 4px;
}
.chats-new-btn:hover kbd {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.85);
}

/* Segmented control */
.chats-segmented {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--bg-tinted);
  border-radius: 10px;
  width: fit-content;
  margin-bottom: 24px;
}
.chats-segmented .seg {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.32, 0.72, 0, 1);
  white-space: nowrap;
}
.chats-segmented .seg:hover { color: var(--text-primary); }
.chats-segmented .seg.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 0 0 0.5px var(--separator);
}
.chats-segmented .seg-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--separator);
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}
.chats-segmented .seg.active .seg-count {
  background: var(--kw-red-soft-bg);
  color: var(--kw-red);
}

/* List */
.chats-list { display: flex; flex-direction: column; gap: 32px; }
.chats-group { display: flex; flex-direction: column; gap: 8px; }
.chats-group-head {
  display: flex; align-items: center; gap: 12px;
  padding: 0 4px 4px;
}
.chats-group-rule {
  flex: 1;
  height: 1px;
  background: var(--separator);
}
.chats-group-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* Conversation row */
.conv-row {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--separator);
  border-radius: 14px;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.32, 0.72, 0, 1);
}
.conv-row:hover {
  transform: translateY(-1px);
  border-color: var(--separator-strong);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.conv-row.is-solution {
  border-left: 3px solid var(--kw-red);
  padding-left: 16px;
  background: linear-gradient(90deg, rgba(200,16,46,0.025) 0%, var(--bg-elevated) 30%);
}
.conv-row.is-solution:hover {
  background: linear-gradient(90deg, rgba(200,16,46,0.05) 0%, var(--bg-elevated) 35%);
}
.conv-row.is-unread {
  background: linear-gradient(90deg, rgba(200,16,46,0.03) 0%, var(--bg-elevated) 80%);
}

.conv-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--bg-tinted);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
}
.conv-row.is-solution .conv-icon {
  background: var(--kw-red-soft-bg);
  color: var(--kw-red);
}
.conv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.conv-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.conv-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.conv-row.is-unread .conv-title { font-weight: 600; }
.conv-time {
  flex-shrink: 0;
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.conv-sub {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px;
  color: var(--text-secondary);
}
.conv-agents {
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  font-size: 11px;
}
.conv-row.is-solution .conv-agents { color: var(--kw-red); }
.conv-sub .dot-sep {
  width: 2.5px; height: 2.5px;
  background: var(--text-tertiary);
  border-radius: 50%;
}
.conv-solution-tag {
  font-size: 10.5px;
  font-family: 'SF Mono', ui-monospace, monospace;
  color: var(--kw-red);
  letter-spacing: 0;
}
.conv-preview {
  font-size: 12.5px;
  color: var(--text-tertiary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.conv-unread-dot {
  position: absolute;
  top: 18px; right: 18px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--kw-red);
  box-shadow: 0 0 0 3px rgba(200,16,46,0.18);
}

/* Empty states */
.chats-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 60px 24px;
  gap: 12px;
}
.chats-empty-glyph {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--bg-tinted);
  color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.chats-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.chats-empty-sub {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 380px;
  line-height: 1.5;
}
.chats-empty .btn-primary,
.chats-empty .btn-ghost {
  margin-top: 12px;
}

/* === ChatScreen V2 — active conversation === */
.chat-v2 {
  height: calc(100vh - 0px);
  display: flex;
  flex-direction: column;
  margin: 0 -32px;
  padding: 0;
}
.chat-v2-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 32px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(50px) saturate(200%);
  -webkit-backdrop-filter: blur(50px) saturate(200%);
  border-bottom: 1px solid var(--separator);
  position: sticky;
  top: 0;
  z-index: 5;
}
.chat-v2.is-solution .chat-v2-header {
  background: linear-gradient(135deg, rgba(200,16,46,0.045) 0%, var(--bg-glass-strong) 50%);
  border-left: 3px solid var(--kw-red);
}
.chat-v2-back {
  width: 32px; height: 32px;
  border: 1px solid var(--separator);
  background: var(--bg-elevated);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 160ms cubic-bezier(0.32, 0.72, 0, 1);
  flex-shrink: 0;
}
.chat-v2-back:hover {
  background: var(--bg-tinted);
  color: var(--text-primary);
  transform: translateX(-1px);
}
.chat-v2-title-block { flex: 1; min-width: 0; }
.chat-v2-title-row { display: flex; align-items: center; gap: 8px; }
.chat-v2-title-icon { color: var(--kw-red); flex-shrink: 0; }
.chat-v2-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-v2-sub {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}
.chat-v2-sub .dot-sep {
  width: 2.5px; height: 2.5px;
  background: var(--text-tertiary);
  border-radius: 50%;
}
.chat-v2-agents {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}
.chat-v2.is-solution .chat-v2-agents { color: var(--kw-red); }
.chat-v2-type-tag {
  font-family: 'SF Mono', ui-monospace, monospace;
  font-size: 10.5px;
  color: var(--text-tertiary);
}
.chat-v2-type-tag.solution { color: var(--kw-red); }

.chat-v2-actions { display: flex; align-items: center; gap: 8px; }
.chat-v2-menu-wrap { position: relative; }
.chat-v2-menu {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(50px) saturate(200%);
  border: 1px solid var(--separator);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  min-width: 180px;
  z-index: 10;
}
.chat-v2-menu button {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background 120ms;
}
.chat-v2-menu button:hover { background: var(--bg-tinted); }
.chat-v2-menu button.danger { color: var(--kw-red); }

/* Thread */
.chat-v2-thread {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.chat-v2-thread::-webkit-scrollbar { width: 8px; }
.chat-v2-thread::-webkit-scrollbar-thumb { background: var(--separator); border-radius: 4px; }
.chat-v2-thread::-webkit-scrollbar-thumb:hover { background: var(--separator-strong); }

/* Greeting (empty thread) */
.chat-v2-greeting {
  text-align: center;
  padding: 64px 32px;
  color: var(--text-secondary);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.chat-v2-greeting svg { color: var(--kw-red); margin-bottom: 4px; }
.chat-v2-greeting h3 { margin: 0; font-size: 18px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.01em; }
.chat-v2-greeting p { margin: 0; font-size: 13px; max-width: 420px; line-height: 1.5; }

/* === Messages === */
.msg { display: flex; flex-direction: column; gap: 8px; max-width: 760px; }

/* User message */
.msg-user { align-self: flex-end; align-items: flex-end; max-width: 75%; }
.msg-user .msg-meta {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  padding-right: 4px;
}
.msg-user-bubble {
  background: var(--kw-red-soft-bg);
  color: var(--text-primary);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.55;
  border-radius: 16px 16px 4px 16px;
  letter-spacing: -0.005em;
  white-space: pre-wrap;
}

/* Assistant base */
.msg-assistant {
  align-self: flex-start;
  width: 100%;
}
.msg-assistant.msg-solution {
  border-left: 3px solid var(--kw-red);
  padding-left: 16px;
  margin-left: -16px;
}

.msg-head {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.msg-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px;
  background: var(--bg-tinted);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text-primary);
}
.msg-solution .msg-pill {
  background: var(--kw-red-soft-bg);
  color: var(--kw-red);
}
.msg-pill svg { flex-shrink: 0; }
.msg-pill-agents {
  font-weight: 500;
  font-size: 10.5px;
  color: var(--text-secondary);
  font-family: 'SF Mono', ui-monospace, monospace;
  letter-spacing: 0;
}
.msg-solution .msg-pill-agents { color: var(--kw-red); opacity: 0.75; }
.msg-time {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.msg-meeting-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  background: rgba(200,16,46,0.06);
  border: 1px solid rgba(200,16,46,0.18);
  color: var(--kw-red);
  border-radius: 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms;
}
.msg-meeting-badge:hover { background: rgba(200,16,46,0.10); transform: translateY(-0.5px); }

/* Message body markdown */
.md-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}
.md-body > * + * { margin-top: 10px; }
.md-h2 {
  margin: 18px 0 6px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.md-h2:first-child { margin-top: 4px; }
.md-h3 {
  margin: 14px 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.005em;
}
.md-p { margin: 0; }
.md-ul, .md-ol { margin: 0; padding-left: 22px; }
.md-ul li, .md-ol li { margin-bottom: 4px; }
.md-ol { counter-reset: olist; list-style: none; padding-left: 0; }
.md-ol li {
  counter-increment: olist;
  position: relative;
  padding-left: 28px;
}
.md-ol li::before {
  content: counter(olist);
  position: absolute;
  left: 0; top: 1px;
  width: 20px; height: 20px;
  background: var(--kw-red-soft-bg);
  color: var(--kw-red);
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.md-quote {
  margin: 8px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--kw-red);
  background: var(--bg-tinted);
  font-style: italic;
  color: var(--text-secondary);
  border-radius: 0 6px 6px 0;
}
.md-code {
  font-family: 'SF Mono', ui-monospace, 'Menlo', monospace;
  font-size: 12px;
  background: var(--bg-tinted);
  padding: 1.5px 6px;
  border-radius: 4px;
  color: var(--text-primary);
}

/* Tool calls */
.msg-tools {
  margin-top: 12px;
  border: 1px solid var(--separator);
  border-radius: 8px;
  background: var(--bg-tinted);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 150ms;
}
.msg-tools:hover { border-color: var(--separator-strong); }
.msg-tools-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--text-secondary);
}
.msg-tools-bar > svg:first-child { color: var(--text-tertiary); flex-shrink: 0; }
.msg-tools-list {
  font-family: 'SF Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-tertiary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-tools-consult {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px;
  background: var(--kw-red-soft-bg);
  color: var(--kw-red);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
}
.msg-tools-caret {
  color: var(--text-tertiary);
  transition: transform 200ms cubic-bezier(0.32, 0.72, 0, 1);
}
.msg-tools.open .msg-tools-caret { transform: rotate(180deg); }
.msg-tools-detail {
  padding: 4px 12px 12px;
  display: flex; flex-direction: column; gap: 6px;
  border-top: 1px solid var(--separator);
}
.msg-tools-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  padding-top: 6px;
}
.msg-tools-row.consult { color: var(--text-primary); }

/* Suggestion chips */
.msg-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.suggestion-chip {
  padding: 6px 14px;
  border: 1px solid var(--separator);
  background: var(--bg-elevated);
  border-radius: 999px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.32, 0.72, 0, 1);
}
.suggestion-chip:hover {
  background: var(--kw-red-soft-bg);
  border-color: rgba(200,16,46,0.28);
  color: var(--kw-red);
  transform: translateY(-1px);
}
.suggestion-chip:active { transform: scale(0.96); }

/* Message actions (meeting) */
.msg-actions {
  display: flex; gap: 8px;
  margin-top: 12px;
}
.btn-sm {
  font-size: 12px;
  padding: 5px 10px;
  height: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* === Triage indicator === */
.msg-triage {
  align-self: flex-start;
  display: flex; flex-direction: column;
  gap: 12px;
  max-width: 600px;
}
.triage-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--separator);
  border-radius: 999px;
  font-size: 12.5px;
  align-self: flex-start;
  animation: triagePulse 2.4s ease-in-out infinite;
}
@keyframes triagePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200,16,46,0.12); }
  50%      { box-shadow: 0 0 0 6px rgba(200,16,46,0); }
}
.triage-spark { color: var(--kw-red); flex-shrink: 0; }
.triage-label { font-weight: 600; color: var(--text-primary); }
.triage-text { color: var(--text-secondary); }
.triage-pulse-dots { display: inline-flex; gap: 3px; margin-left: 2px; }
.triage-pulse-dots span {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--kw-red);
  animation: dotPulse 1.4s ease-in-out infinite;
}
.triage-pulse-dots span:nth-child(2) { animation-delay: 0.18s; }
.triage-pulse-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes dotPulse {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50%      { opacity: 1; transform: scale(1.1); }
}

/* Fan-out cards */
.triage-fanout {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-left: 8px;
}
.fanout-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px 10px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--separator);
  border-radius: 10px;
  min-width: 220px;
  animation: fadeInUp 320ms cubic-bezier(0.32, 0.72, 0, 1);
}
.fanout-card.done { border-color: rgba(52,199,89,0.25); }
.fanout-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 10.5px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}
.fanout-mid { flex: 1; min-width: 0; }
.fanout-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.fanout-status {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 1px;
}
.fanout-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex-shrink: 0;
}
.fanout-status-dot.done {
  background: #34C759;
  box-shadow: 0 0 0 3px rgba(52,199,89,0.15);
}

/* Input bar */
.chat-v2-input {
  position: sticky;
  bottom: 0;
  padding: 16px 32px 24px;
  background: linear-gradient(180deg, transparent 0%, var(--bg-primary) 30%);
  z-index: 4;
}
.chat-v2-input-inner {
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--separator);
  border-radius: 18px;
  padding: 10px 10px 10px 18px;
  box-shadow: 0 1px 0 inset rgba(255,255,255,0.5), 0 4px 16px rgba(0,0,0,0.04);
  transition: border-color 160ms, box-shadow 160ms;
}
.chat-v2-input-inner:focus-within {
  border-color: rgba(200,16,46,0.32);
  box-shadow: 0 1px 0 inset rgba(255,255,255,0.5), 0 0 0 4px rgba(200,16,46,0.08);
}
.chat-v2.is-solution .chat-v2-input-inner { border-left: 3px solid var(--kw-red); padding-left: 15px; }
.chat-v2-input-inner textarea {
  flex: 1;
  border: none; outline: none; background: none;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  padding: 6px 0;
  max-height: 200px;
  letter-spacing: -0.005em;
}
.chat-v2-input-inner textarea::placeholder { color: var(--text-tertiary); }

.chat-v2-send {
  width: 32px; height: 32px;
  border: none;
  border-radius: 10px;
  background: var(--separator);
  color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 180ms cubic-bezier(0.32, 0.72, 0, 1);
}
.chat-v2-send.visible {
  background: var(--kw-red);
  color: white;
  box-shadow: 0 4px 12px rgba(200,16,46,0.32);
}
.chat-v2-send.visible:hover { transform: translateY(-1px); filter: brightness(1.06); }
.chat-v2-send:active { transform: scale(0.94); }
.chat-v2-send:disabled { cursor: default; }

/* Empty chat (no conversation selected) */
.chat-v2-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  height: calc(100vh - 80px);
  gap: 10px;
  color: var(--text-secondary);
}
.chat-v2-empty-glyph {
  width: 72px; height: 72px;
  border-radius: 18px;
  background: var(--bg-tinted);
  color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.chat-v2-empty h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.chat-v2-empty p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 400px;
}

/* fadeInUp shared */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg.fade-in { animation: fadeInUp 280ms cubic-bezier(0.32, 0.72, 0, 1); }

/* ===== Solution Session Phase Progress (chat header) ===== */
.ss-phase-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(237, 28, 36, 0.04), rgba(237, 28, 36, 0.02), transparent);
  border: 1px solid rgba(237, 28, 36, 0.10);
  border-radius: 12px;
}
.ssp-step {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: opacity 200ms cubic-bezier(0.32, 0.72, 0, 1);
}
.ssp-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 240ms cubic-bezier(0.32, 0.72, 0, 1);
}
.ssp-step-label { display: flex; flex-direction: column; font-size: 11px; line-height: 1.2; }
.ssp-step-short { font-weight: 600; color: var(--text-primary); letter-spacing: -0.01em; }
.ssp-step-full {
  font-size: 9.5px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ssp-connector {
  flex: 1;
  height: 2px;
  border-radius: 1px;
  background: rgba(0, 0, 0, 0.06);
  min-width: 12px;
  transition: background 240ms cubic-bezier(0.32, 0.72, 0, 1);
}
.ssp-connector.ssp-done { background: linear-gradient(90deg, var(--kw-red, #ED1C24), rgba(237, 28, 36, 0.4)); }
.ssp-step.ssp-done .ssp-step-num { background: var(--kw-red, #ED1C24); color: white; }
.ssp-step.ssp-current .ssp-step-num {
  background: rgba(237, 28, 36, 0.15);
  color: var(--kw-red, #ED1C24);
  border: 2px solid var(--kw-red, #ED1C24);
  box-shadow: 0 0 0 4px rgba(237, 28, 36, 0.10);
  animation: sspPulse 2s ease-in-out infinite;
}
.ssp-step.ssp-current .ssp-step-short { color: var(--kw-red, #ED1C24); }
.ssp-step.ssp-upcoming .ssp-step-num {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-tertiary);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.ssp-step.ssp-upcoming { opacity: 0.55; }

@keyframes sspPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(237, 28, 36, 0.10); }
  50%      { box-shadow: 0 0 0 6px rgba(237, 28, 36, 0.18); }
}

@media (max-width: 720px) {
  .ssp-step-full { display: none; }
  .ssp-step-short { font-size: 10px; }
  .ssp-step-num { width: 20px; height: 20px; font-size: 10px; }
}

/* Responsive */
@media (max-width: 768px) {
  .chats-screen { padding: 16px 0 60px; }
  .chats-toolbar { flex-direction: column; align-items: stretch; }
  .chats-new-btn { justify-content: center; }
  .chat-v2-thread { padding: 20px 16px; }
  .chat-v2-header { padding: 14px 16px; }
  .chat-v2-input { padding: 12px 16px 16px; }
  .conv-row { padding: 12px 14px; }
}
