/* ═══════════════════════════════════════════════════════════════════
   Chat Overlay v21 — Visual polish pass
   ═══════════════════════════════════════════════════════════════════ */

/* ── FAB (Floating Action Button) — REMOVED: now reuses tabbar centre button ── */
/* Legacy .co-fab class hidden; chat now launches from tabbar-fab only */
.co-fab { display: none !important; }

/* ── Unread badge ────────────────────────────────────────────────── */

.co-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, var(--co-error), var(--co-warning));
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg, var(--jb-color-stone900, #1c1917));
  animation: badge-bounce 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.co-badge.hidden { display: none; }

@keyframes badge-bounce {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

/* ── DS Token Bridge ──────────────────────────────────────────────
   Maps --jb-* design system tokens to chat overlay local vars.
   All children inherit these. JS-set vars (--accent-1 etc.) override.
   ─────────────────────────────────────────────────────────────────── */
:root {
  --co-accent:        var(--jb-color-primary,      #b5854d);
  --co-accent-hover:  var(--jb-color-primaryHover,  #c2956a);
  --co-accent-muted:  var(--jb-color-primaryMuted,  #9a6d3a);
  --co-accent-glow:   var(--jb-color-primaryGlow,   rgba(181,133,77,0.15));
  --co-surface-card:  var(--jb-surface-s1,          #ffffff);
  --co-surface-panel: var(--jb-surface-s2,          #f5f5f4);
  --co-surface-deep:  var(--jb-surface-s0,          #fafaf9);
  --co-border:        var(--jb-color-stone200,      #e7e5e4);
  --co-text-strong:   var(--jb-color-stone900,      #1c1917);
  --co-text-secondary:var(--jb-color-stone600,      #57534e);
  --co-text-hint:     var(--jb-color-stone500,      #78716c);
  --co-error:         var(--jb-color-error,         #c44444);
  --co-success:       var(--jb-color-success,       #6d9b6d);
  --co-warning:       var(--jb-color-warning,       #c97c5c);
  --co-font-body:     var(--jb-font-body,           'Inter', system-ui, sans-serif);
  --co-font-mono:     var(--jb-font-mono,           'JetBrains Mono', monospace);
  --co-radius:        var(--jb-radius-md,           10px);
  --co-radius-lg:     var(--jb-radius-lg,           16px);
  --co-gradient-primary: linear-gradient(135deg, var(--co-accent), var(--co-accent-hover));
}

/* ── Overlay container ───────────────────────────────────────────── */

.co-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.co-overlay.open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.co-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}

.co-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 88vh;
  background: var(--bg, var(--jb-color-stone900, #1c1917));
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  box-shadow: 0 -8px 48px rgba(0, 0, 0, 0.5), 0 -1px 0 color-mix(in srgb, var(--co-accent) 15%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--co-accent) 12%, transparent);
}

.co-overlay.open .co-container {
  transform: translateY(0);
}

/* ── Chat header ─────────────────────────────────────────────────── */

.co-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 8px;
  border-bottom: none;
  background: linear-gradient(180deg, rgba(28, 25, 23, 0.98), var(--secondary-bg, #292524));
  flex-shrink: 0;
  position: relative;
}

.co-header::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
}

.co-header__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.co-avatar {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--gradient-primary, var(--co-gradient-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--co-accent) 20%, transparent);
}

.co-avatar .jb-icon { width: 15px; height: 15px; color: #fff; }

.co-header__info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.co-header__title {
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
}

.co-status {
  font-size: 0.68rem;
  font-weight: 600;
}

.co-header__status {
  display: flex;
  align-items: center;
  gap: 4px;
}

.co-header__context {
  display: none;
}

.co-context-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--co-surface-card, rgba(255,255,255,0.04)) 76%, color-mix(in srgb, var(--co-accent) 18%, transparent));
  border: 1px solid color-mix(in srgb, var(--co-border, rgba(255,255,255,0.08)) 68%, color-mix(in srgb, var(--co-accent) 24%, transparent));
  color: var(--text, #f3f4f6);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.co-context-badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c2956a;
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.45);
}

.co-context-badge__section {
  padding-left: 7px;
  border-left: 1px solid var(--separator, rgba(255,255,255,0.08));
  color: var(--hint, #cbd5e1);
  font-weight: 600;
}

.co-context-summary {
  margin-top: 4px;
  max-width: 260px;
  color: var(--hint, #94a3b8);
  font-size: 0.66rem;
  line-height: 1.3;
}

.co-status--online { color: #34d399; }
.co-status--offline { color: var(--hint, var(--co-text-hint)); }

.co-close-btn {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--hint, #9ca3af);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
}
.co-close-btn:active { background: color-mix(in srgb, var(--co-surface-card, rgba(255,255,255,0.06)) 72%, color-mix(in srgb, var(--co-accent) 14%, transparent)); transform: scale(0.9); }
.co-close-btn .jb-icon { width: 16px; height: 16px; }

/* ── Messages area ───────────────────────────────────────────────── */

.co-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  min-height: 120px;
}

/* ── Bubbles ─────────────────────────────────────────────────────── */

.co-bubble {
  max-width: 84%;
  padding: 12px 16px;
  border-radius: 18px;
  position: relative;
  word-break: break-word;
  animation: co-bubble-in 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes co-bubble-in {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.co-bubble--user {
  align-self: flex-end;
  background: var(--gradient-primary, var(--co-gradient-primary));
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 2px 12px color-mix(in srgb, var(--co-accent) 20%, transparent);
}

.co-bubble--bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: var(--text, #f0f0f5);
  border-bottom-left-radius: 6px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.co-bubble--system {
  align-self: center;
  background: transparent;
  color: var(--hint, var(--co-text-hint));
  font-size: 0.78rem;
  text-align: center;
  padding: 6px 12px;
}

.co-bubble--streaming .co-bubble__text::after {
  content: '▊';
  animation: blink 0.6s infinite;
  color: var(--accent-3, #8fac8f);
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.co-bubble__text {
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* Rich formatting in bot messages */
.co-bubble--bot .co-bubble__text strong { color: var(--text, #f0f0f5); font-weight: 700; }
.co-bubble--bot .co-bubble__text code { background: var(--co-surface-panel, rgba(255,255,255,0.06)); padding: 2px 6px; border-radius: 4px; font-size: 0.82rem; }
.co-bubble--bot .co-bubble__text a { color: var(--accent-3, #8fac8f); text-decoration: none; }

.co-bubble__time {
  font-size: 0.62rem;
  opacity: 0.5;
  margin-top: 3px;
  text-align: right;
  font-weight: 500;
}

/* ── Action feedback chips ───────────────────────────────────────── */

.co-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--separator, rgba(255,255,255,0.06));
}

.co-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--co-surface-card, rgba(255,255,255,0.04)) 70%, rgba(52,211,153,0.18));
  color: #34d399;
  animation: co-chip-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.co-action-chip .jb-icon { width: 12px; height: 12px; }

@keyframes co-chip-pop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ── Typing indicator ────────────────────────────────────────────── */

.co-typing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-size: 0.76rem;
  color: var(--hint, var(--co-text-hint));
  flex-shrink: 0;
  font-weight: 500;
}

.co-typing.hidden { display: none; }

.co-typing-dots { display: flex; gap: 3px; }
.co-typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-1, var(--co-accent)); animation: typing-dot 1.4s infinite; }
.co-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.co-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-dot { 0%, 60%, 100% { opacity: 0.2; transform: scale(0.8); } 30% { opacity: 1; transform: scale(1); } }

/* ── Suggestion chips ────────────────────────────────────────────── */

.co-suggestions {
  padding: 18px 4px;
  animation: co-bubble-in 0.3s ease-out;
}

.co-suggestions__title {
  font-size: 0.72rem;
  color: var(--hint, var(--co-text-hint));
  margin-bottom: 12px;
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.co-suggestions__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.co-suggestion-chip {
  padding: 10px 16px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--co-accent) 25%, transparent);
  background: color-mix(in srgb, var(--co-accent) 8%, transparent);
  color: var(--accent-3, #8fac8f);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}
.co-suggestion-chip .jb-icon { width: 14px; height: 14px; }

.co-suggestion-chip:active {
  transform: scale(0.93);
  background: color-mix(in srgb, var(--co-accent) 15%, transparent);
  border-color: color-mix(in srgb, var(--co-accent) 40%, transparent);
}

/* ── Image preview bar ───────────────────────────────────────────── */

.co-image-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--secondary-bg, #292524);
  border-top: 1px solid var(--separator, rgba(255,255,255,0.06));
  flex-shrink: 0;
}

.co-image-preview.hidden { display: none; }

.co-image-preview__thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--co-border, rgba(255,255,255,0.1));
}

.co-image-preview__name {
  flex: 1;
  font-size: 0.82rem;
  color: var(--hint, var(--co-text-hint));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.co-image-preview__cancel {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--co-surface-card, rgba(255,255,255,0.08));
  color: var(--text, #f0f0f5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.co-image-preview__cancel:hover { background: color-mix(in srgb, var(--co-surface-card, rgba(255,255,255,0.08)) 60%, color-mix(in srgb, var(--co-error) 22%, transparent)); color: var(--co-error); }

.co-image-preview__cancel svg { width: 14px; height: 14px; }

/* ── Bubble image ────────────────────────────────────────────────── */

.co-bubble__image {
  max-width: 220px;
  max-height: 200px;
  border-radius: 10px;
  margin-bottom: 4px;
  display: block;
  object-fit: cover;
}

.co-bubble__caption {
  margin-top: 4px;
  font-size: 0.88rem;
  line-height: 1.45;
}

/* ── Input bar ───────────────────────────────────────────────────── */

.co-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  background: linear-gradient(180deg, var(--secondary-bg, #292524), rgba(28, 25, 23, 0.98));
  flex-shrink: 0;
  padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
}

.co-input-bar textarea {
  flex: 1;
  resize: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 12px 18px;
  font-size: 0.92rem;
  font-family: inherit;
  line-height: 1.45;
  max-height: 100px;
  overflow-y: auto;
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text, #f0f0f5);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.co-input-bar textarea:focus {
  border-color: color-mix(in srgb, var(--co-accent) 45%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--co-accent) 12%, transparent);
  background: rgba(255, 255, 255, 0.06);
}

.co-input-bar textarea::placeholder {
  color: var(--hint, var(--co-text-hint));
}

.co-mic-btn,
.co-send-btn,
.co-attach-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.co-mic-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--hint, #9ca3af);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.co-mic-btn .jb-icon { width: 20px; height: 20px; }

.co-attach-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--hint, #9ca3af);
  width: 36px; height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.co-attach-btn:active { transform: scale(0.88); }

.co-mic-btn:active { transform: scale(0.88); }

.co-mic-btn.recording {
  background: color-mix(in srgb, var(--co-surface-card, rgba(255,255,255,0.06)) 64%, color-mix(in srgb, var(--co-error) 24%, transparent));
  color: #f87171;
  animation: mic-pulse 1s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--co-error) 30%, transparent); }
  50%      { box-shadow: 0 0 0 10px color-mix(in srgb, var(--co-error) 0%, transparent); }
}

.co-send-btn {
  background: var(--gradient-primary, var(--co-gradient-primary));
  color: #fff;
  box-shadow: 0 3px 14px color-mix(in srgb, var(--co-accent) 35%, transparent);
}
.co-send-btn .jb-icon { width: 18px; height: 18px; }

.co-send-btn:active { transform: scale(0.88); }

/* ── Stop button ─────────────────────────────────────────────────── */
.co-stop-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--co-error), color-mix(in srgb, var(--co-error) 85%, #000));
  color: #fff;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--co-error) 30%, transparent);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s;
  -webkit-tap-highlight-color: transparent;
  animation: stop-btn-in 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.co-stop-btn:active { transform: scale(0.88); }
.co-stop-btn.hidden { display: none; }

@keyframes stop-btn-in {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Edit user message — tap highlight ───────────────────────────── */
.co-bubble--user {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.co-bubble--user:active { opacity: 0.85; }
.co-bubble--editing {
  animation: edit-flash 0.8s ease;
}
.co-bubble--editing .co-bubble__text {
  outline: 1px solid color-mix(in srgb, var(--co-accent) 50%, transparent);
  border-radius: 8px;
  padding: 2px 4px;
  cursor: text;
}
.co-bubble--editing .co-bubble__text:focus {
  outline: 2px solid color-mix(in srgb, var(--co-accent) 70%, transparent);
}
@keyframes edit-flash {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
  40%  { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.15); }
  100% { box-shadow: 0 2px 12px color-mix(in srgb, var(--co-accent) 20%, transparent); }
}

/* ── Voice recording state ───────────────────────────────────────── */
.co-recording-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: color-mix(in srgb, var(--co-error) 8%, transparent);
  border-radius: 12px;
  font-size: 0.76rem;
  color: color-mix(in srgb, var(--co-error) 70%, #fff);
  font-weight: 600;
}
.co-recording-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--co-error);
  animation: rec-blink 1s ease-in-out infinite;
}
@keyframes rec-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ── Avatar ring (online pulse) ──────────────────────────────────── */

.co-avatar__ring {
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  border: 1.5px solid color-mix(in srgb, var(--co-accent) 35%, transparent);
  animation: avatar-ring 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes avatar-ring {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 0.8; transform: scale(1.06); }
}

.co-avatar { position: relative; }

/* ── Header status dot ───────────────────────────────────────────── */

.co-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s;
}

.co-status-dot--online {
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
}

.co-status-dot--offline {
  background: var(--co-text-hint);
}

/* ── Bubble meta row ─────────────────────────────────────────────── */

.co-bubble__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 3px;
}

.co-msg-status {
  display: inline-flex;
  opacity: 0.5;
}

.co-msg-status .jb-icon { width: 12px; height: 12px; color: #34d399; }

/* ── History (dimmed) bubbles ────────────────────────────────────── */

.co-bubble--history {
  opacity: 0.55;
  animation: none;
}

.co-bubble--history:hover { opacity: 0.85; }

/* ── Date separator ──────────────────────────────────────────────── */

.co-date-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  user-select: none;
}

.co-date-sep::before,
.co-date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.co-date-sep span {
  padding: 0 14px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--hint, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.co-history-banner {
  position: sticky;
  top: 0;
  z-index: 2;
  width: fit-content;
  margin: 0 auto 12px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--co-surface-card, var(--card-bg));
  border: 1px solid var(--co-border, var(--card-border));
  color: var(--hint, var(--co-text-hint));
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  backdrop-filter: blur(12px);
}

/* ── Session divider ─────────────────────────────────────────────── */

.co-session-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0 8px;
  user-select: none;
}

.co-session-divider::before,
.co-session-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent-1, var(--co-accent)) 36%, transparent), transparent);
}

.co-session-divider span {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 14px;
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--accent-3, #8fac8f);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.co-session-divider .jb-icon { width: 10px; height: 10px; }

/* ── Phase bar (multi-stage thinking) ────────────────────────────── */

.co-phase-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  flex-shrink: 0;
  border-top: 1px solid var(--separator, rgba(255,255,255,0.06));
  background: color-mix(in srgb, var(--co-surface-panel, rgba(255,255,255,0.06)) 72%, transparent);
  transition: all 0.3s ease;
  animation: phase-enter 0.3s ease-out;
}

.co-phase-bar.hidden { display: none; }

@keyframes phase-enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.co-phase__indicator {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.co-phase__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.co-phase__icon .jb-icon { width: 16px; height: 16px; }

.co-phase__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: phase-pulse 1.5s ease-in-out infinite;
}

@keyframes phase-pulse {
  0%, 100% { transform: scale(0.8); opacity: 0.3; }
  50%      { transform: scale(1.3); opacity: 0; }
}

.co-phase__content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.co-phase__label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text, #f0f0f5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.co-phase__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.co-phase__tool {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  white-space: nowrap;
}

.co-phase__tool .jb-icon { width: 10px; height: 10px; }

/* Phase color variants */

.phase-analyze .co-phase__icon { color: #60a5fa; }
.phase-analyze .co-phase__pulse { background: rgba(96, 165, 250, 0.2); }
.phase-analyze .co-phase__label { color: #93bbfd; }

.phase-reason .co-phase__icon { color: var(--co-accent-hover); }
.phase-reason .co-phase__pulse { background: rgba(167, 139, 250, 0.2); }
.phase-reason .co-phase__label { color: #c4b5fd; }

.phase-execute .co-phase__icon { color: #f59e0b; }
.phase-execute .co-phase__pulse { background: rgba(245, 158, 11, 0.2); }
.phase-execute .co-phase__label { color: #fbbf24; }
.phase-execute .co-phase__tool { background: rgba(245, 158, 11, 0.1); color: #fbbf24; }

.phase-compose .co-phase__icon { color: #34d399; }
.phase-compose .co-phase__pulse { background: rgba(52, 211, 153, 0.2); }
.phase-compose .co-phase__label { color: #6ee7b7; }

/* ── Model badge ─────────────────────────────────────────────────── */

.co-model-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--separator, rgba(255,255,255,0.06));
  animation: co-chip-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.co-model-tag {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--co-surface-card, rgba(255,255,255,0.04)) 68%, color-mix(in srgb, var(--co-accent) 20%, transparent));
  color: var(--accent-3, #8fac8f);
}

.co-model-time {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--hint, #9ca3af);
}

/* ── Streaming cursor animation ──────────────────────────────────── */

.co-bubble--streaming {
  border-color: color-mix(in srgb, var(--co-border, rgba(255,255,255,0.08)) 48%, color-mix(in srgb, var(--co-accent) 28%, transparent));
  box-shadow: 0 0 20px color-mix(in srgb, var(--co-accent) 6%, transparent);
}

/* ── Agent tabs — compact quick-action strip (Plan 27) ────────────── */

.co-agent-tabs {
  flex-shrink: 0;
  border-bottom: 1px solid var(--separator, rgba(255,255,255,0.06));
  background: var(--secondary-bg, #292524);
}

.co-agent-tabs--strip {
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* ── Quick pill strip ──────────────────────────────────────────── */

.co-quick-strip {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.co-quick-strip::-webkit-scrollbar { display: none; }

.co-qpill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--pill-accent, var(--co-accent)) 35%, rgba(255,255,255,0.08));
  background: color-mix(in srgb, var(--pill-accent, var(--co-accent)) 12%, rgba(255,255,255,0.03));
  color: color-mix(in srgb, var(--pill-accent, var(--co-accent)) 75%, #fff);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.co-qpill:active { transform: scale(0.93); }

.co-qpill .jb-icon { width: 12px; height: 12px; }

.co-qpill--more {
  --pill-accent: var(--jb-color-slate500, #6a8094);
  border-style: dashed;
}

/* ── Expandable drawer ─────────────────────────────────────────── */

.co-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.22, 1, 0.36, 1), padding 0.3s;
  padding: 0 14px;
}

.co-drawer--open {
  max-height: 50vh;
  overflow-y: auto;
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  scrollbar-width: none;
}

.co-drawer--open::-webkit-scrollbar { display: none; }

.co-drawer__section {
  margin-bottom: 10px;
}

.co-drawer__section:last-child {
  margin-bottom: 0;
}

.co-drawer__label {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hint, rgba(255,255,255,0.5));
  margin-bottom: 8px;
}

.co-drawer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.co-drawer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  color: var(--text, #f0f0f5);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.co-drawer-item:active {
  transform: scale(0.95);
  background: rgba(255,255,255,0.06);
}

.co-drawer-item__icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--pill-accent, var(--co-accent)) 18%, transparent);
  color: color-mix(in srgb, var(--pill-accent, var(--co-accent)) 80%, #fff);
}

.co-drawer-item__icon .jb-icon { width: 14px; height: 14px; }

.co-drawer-item__label {
  font-size: 0.64rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  color: rgba(255,255,255,0.8);
}

@media (max-width: 480px) {
  .co-drawer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.co-workflow-strip {
  padding: 8px 14px 10px;
  border-bottom: 1px solid var(--separator, rgba(255,255,255,0.06));
  background: var(--secondary-bg, #292524);
}

.co-workflow-strip.hidden { display: none; }

.co-workflow-strip__title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hint, var(--co-text-hint));
  margin-bottom: 8px;
}

.co-workflow-strip__rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.co-workflow-strip__rail--stacked {
  display: grid;
  grid-template-columns: 1fr;
  overflow: visible;
}

.co-workflow-strip__rail::-webkit-scrollbar { display: none; }

.co-workflow-card {
  min-width: 0;
  max-width: none;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(69, 123, 157, 0.32);
  background: linear-gradient(180deg, rgba(69, 123, 157, 0.14), rgba(255, 255, 255, 0.04));
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}

.co-workflow-card--run {
  border-color: rgba(233, 196, 106, 0.28);
  background: linear-gradient(180deg, rgba(233, 196, 106, 0.12), rgba(255,255,255,0.03));
}

.co-workflow-card__eyebrow {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hint, var(--co-text-hint));
}

.co-workflow-card__title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-secondary, rgba(255,255,255,0.94));
}

.co-workflow-card__copy {
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--hint, rgba(255,255,255,0.62));
  min-height: 2rem;
}

.co-workflow-card__cta,
.co-workflow-card__badge {
  margin-top: auto;
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.co-workflow-card__cta {
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary, rgba(255,255,255,0.92));
}

.co-workflow-card__badge {
  background: rgba(255,255,255,0.05);
  color: var(--hint, rgba(255,255,255,0.58));
}

.co-guided-form {
  padding: 12px 14px;
  background: color-mix(in srgb, var(--secondary-bg, #292524) 92%, rgba(255,255,255,0.03));
  border-top: 1px solid var(--separator, rgba(255,255,255,0.06));
  border-bottom: 1px solid var(--separator, rgba(255,255,255,0.06));
}

.co-guided-form.hidden { display: none; }

.co-guided-form__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.co-guided-form__title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary, rgba(255,255,255,0.92));
}

.co-guided-form__copy {
  margin-top: 4px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--hint, rgba(255,255,255,0.58));
}

.co-guided-form__close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--text, #f0f0f5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.co-guided-form__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.co-guided-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.co-guided-form__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hint, var(--co-text-hint));
}

.co-guided-form__input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--co-border, rgba(255,255,255,0.08));
  background: rgba(255,255,255,0.04);
  color: var(--text, #f0f0f5);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.84rem;
}

.co-guided-form__textarea {
  resize: vertical;
  min-height: 76px;
}

.co-guided-form__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.co-guided-form__submit,
.co-guided-form__cancel {
  border: none;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.74rem;
  font-weight: 700;
}

.co-guided-form__submit {
  background: color-mix(in srgb, var(--co-accent) 18%, transparent);
  color: #c7d2fe;
}

.co-guided-form__cancel {
  background: rgba(255,255,255,0.06);
  color: var(--hint, rgba(255,255,255,0.58));
}

/* ── Live Tool Result Cards (Agentic UX) ─────────────────────────── */

.co-tool-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 12px;
  max-width: 85%;
}

.co-tool-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.8rem;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.co-tool-card--success {
  border-left: 3px solid #34d399;
}

.co-tool-card--error {
  border-left: 3px solid #f87171;
}

.co-tool-card__header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.co-tool-card__icon .jb-icon {
  width: 14px;
  height: 14px;
  color: var(--co-accent-hover);
}

.co-tool-card--error .co-tool-card__icon .jb-icon {
  color: #f87171;
}

.co-tool-card__name {
  flex: 1;
  font-weight: 600;
  color: var(--text-secondary, rgba(255,255,255,0.88));
  font-size: 0.78rem;
}

.co-tool-card__status .jb-icon {
  width: 12px;
  height: 12px;
}

.co-tool-card--success .co-tool-card__status .jb-icon { color: #34d399; }
.co-tool-card--error .co-tool-card__status .jb-icon { color: #f87171; }

.co-tool-card__summary {
  margin-top: 4px;
  color: var(--hint, rgba(255,255,255,0.55));
  font-size: 0.74rem;
  line-height: 1.4;
  word-break: break-word;
}

/* ── Agent Task Progress Cards ───────────────────────────────────── */

.co-agent-card {
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 6px 12px;
  max-width: 85%;
  font-size: 0.78rem;
}

.co-agent-card--completed {
  border-color: rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.06);
}

.co-agent-card--failed {
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.06);
}

.co-agent-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.co-agent-card__icon .jb-icon {
  width: 16px;
  height: 16px;
}

.co-agent-card__icon.phase-reason .jb-icon { color: #c2956a; }
.co-agent-card__icon.phase-execute .jb-icon { color: #fbbf24; }
.co-agent-card__icon.phase-compose .jb-icon { color: var(--co-accent-hover); }
.co-agent-card__icon.phase-done .jb-icon { color: #34d399; }
.co-agent-card__icon.phase-error .jb-icon { color: #f87171; }

.co-agent-card__title {
  flex: 1;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.co-agent-card__detail {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
}

.co-agent-card__step {
  font-family: var(--co-font-mono);
}

/* Pulse animation on executing agent cards */
.co-agent-card--executing .co-agent-card__icon .jb-icon {
  animation: agent-pulse 1.2s ease-in-out infinite;
}

@keyframes agent-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ═══════════════════════════════════════════════════════════════════
   Neural Chat — New Animations
   ═══════════════════════════════════════════════════════════════════ */

/* ── Consciousness Wave (neural activity in phase bar) ───────────── */

.co-neural-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 16px;
  margin-top: 3px;
}

.co-neural-wave span {
  display: inline-block;
  width: 3.5px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.5;
  animation: neural-bar 1.2s ease-in-out infinite;
}

.co-neural-wave span:nth-child(1) { animation-delay: 0s;    height: 5px; }
.co-neural-wave span:nth-child(2) { animation-delay: 0.12s; height: 10px; }
.co-neural-wave span:nth-child(3) { animation-delay: 0.24s; height: 16px; }
.co-neural-wave span:nth-child(4) { animation-delay: 0.36s; height: 8px; }
.co-neural-wave span:nth-child(5) { animation-delay: 0.48s; height: 13px; }

@keyframes neural-bar {
  0%, 100% { transform: scaleY(0.3); opacity: 0.25; }
  25%      { transform: scaleY(1.0); opacity: 0.9; }
  50%      { transform: scaleY(0.5); opacity: 0.4; }
  75%      { transform: scaleY(1.2); opacity: 1; }
}

/* Phase-specific wave colors */
.phase-analyze .co-neural-wave span { color: #60a5fa; }
.phase-reason .co-neural-wave span  { color: var(--co-accent-hover); }
.phase-execute .co-neural-wave span { color: #fbbf24; }
.phase-compose .co-neural-wave span { color: #34d399; }

/* ── Neural Thinking (abstract orbiting dots + label) ─────────────── */

.co-neural-think {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 0 12px;
  animation: neural-think-enter 0.35s ease-out;
}

@keyframes neural-think-enter {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

.co-neural__orbit {
  position: relative;
  width: 48px;
  height: 48px;
}

.co-neural__dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-3, #8fac8f);
  top: 50%;
  left: 50%;
  margin: -3px 0 0 -3px;
  animation: neural-orbit 3s linear infinite;
}

/* Each dot at different orbit radius and phase */
.co-neural__dot:nth-child(1) { animation: neural-orbit-1 2.4s ease-in-out infinite; }
.co-neural__dot:nth-child(2) { animation: neural-orbit-2 2.8s ease-in-out infinite; opacity: 0.7; width: 5px; height: 5px; }
.co-neural__dot:nth-child(3) { animation: neural-orbit-3 3.2s ease-in-out infinite; opacity: 0.5; width: 4px; height: 4px; }
.co-neural__dot:nth-child(4) { animation: neural-orbit-4 2.6s ease-in-out infinite; opacity: 0.8; }
.co-neural__dot:nth-child(5) { animation: neural-orbit-5 3.0s ease-in-out infinite; opacity: 0.4; width: 3px; height: 3px; }

@keyframes neural-orbit-1 {
  0%   { transform: translate(0, -18px); }
  25%  { transform: translate(16px, -6px); }
  50%  { transform: translate(0, 14px); }
  75%  { transform: translate(-16px, -4px); }
  100% { transform: translate(0, -18px); }
}
@keyframes neural-orbit-2 {
  0%   { transform: translate(14px, 0); }
  25%  { transform: translate(-4px, 16px); }
  50%  { transform: translate(-14px, -2px); }
  75%  { transform: translate(6px, -14px); }
  100% { transform: translate(14px, 0); }
}
@keyframes neural-orbit-3 {
  0%   { transform: translate(-10px, 12px); }
  25%  { transform: translate(12px, 10px); }
  50%  { transform: translate(8px, -14px); }
  75%  { transform: translate(-14px, -6px); }
  100% { transform: translate(-10px, 12px); }
}
@keyframes neural-orbit-4 {
  0%   { transform: translate(-16px, -8px); }
  25%  { transform: translate(4px, -18px); }
  50%  { transform: translate(18px, 4px); }
  75%  { transform: translate(-6px, 16px); }
  100% { transform: translate(-16px, -8px); }
}
@keyframes neural-orbit-5 {
  0%   { transform: translate(8px, -20px); }
  25%  { transform: translate(-18px, 2px); }
  50%  { transform: translate(2px, 20px); }
  75%  { transform: translate(18px, -4px); }
  100% { transform: translate(8px, -20px); }
}

/* Phase-specific dot colors */
.phase-analyze .co-neural__dot { background: #60a5fa; }
.phase-reason .co-neural__dot  { background: #8fac8f; }
.phase-execute .co-neural__dot { background: #fbbf24; }
.phase-compose .co-neural__dot { background: #34d399; }

/* Label — fades in/out gently, mostly visible */
.co-neural__label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-3, #8fac8f);
  animation: neural-label-breathe 3s ease-in-out infinite;
  text-shadow: 0 0 12px currentColor;
}

.phase-analyze .co-neural__label { color: #60a5fa; }
.phase-reason .co-neural__label  { color: var(--co-accent-hover); }
.phase-execute .co-neural__label { color: #fbbf24; }
.phase-compose .co-neural__label { color: #34d399; }

@keyframes neural-label-breathe {
  0%, 100% { opacity: 0.45; filter: blur(1.5px); }
  30%      { opacity: 1; filter: blur(0px); }
  70%      { opacity: 1; filter: blur(0px); }
}

/* Thought stream — scrollable flowing text below the dots */
.co-neural__stream {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  max-height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 85%;
  max-width: 340px;
  padding: 0 8px;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.co-neural__stream::-webkit-scrollbar { display: none; }

.co-neural__thought {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--hint, #9ca3af);
  opacity: 0;
  animation: thought-appear 0.6s ease-out forwards;
  text-align: center;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

/* Flowing mode — single continuous text, always visible */
.co-neural__thought--flowing {
  opacity: 0.7;
  animation: none;
  text-align: center;
  word-break: break-word;
}

/* Fade older thoughts (multi-line mode) */
.co-neural__thought:not(:last-child):not(.co-neural__thought--flowing) {
  opacity: 0.3;
  font-size: 0.65rem;
  animation: none;
}

@keyframes thought-appear {
  0%   { opacity: 0; transform: translateY(6px); filter: blur(4px); }
  60%  { opacity: 0.9; transform: translateY(0); filter: blur(0); }
  100% { opacity: 0.7; transform: translateY(0); filter: blur(0); }
}

/* Phase-colored thoughts */
.phase-analyze .co-neural__thought:last-child { color: #60a5fa; }
.phase-reason .co-neural__thought:last-child  { color: var(--co-accent-hover); }
.phase-execute .co-neural__thought:last-child { color: #fbbf24; }
.phase-compose .co-neural__thought:last-child { color: #34d399; }

/* Collapse: dots converge to center, then vanish */
.co-neural-think--collapse .co-neural__dot {
  animation: neural-collapse 0.35s ease-in forwards !important;
}
.co-neural-think--collapse .co-neural__label {
  animation: neural-label-fade 0.25s ease-out forwards !important;
}
.co-neural-think--collapse .co-neural__stream {
  animation: neural-label-fade 0.25s ease-out forwards !important;
}
.co-neural-think--collapse {
  animation: neural-think-shrink 0.4s ease-in forwards;
}

@keyframes neural-collapse {
  to { transform: translate(0, 0) scale(0); opacity: 0; }
}
@keyframes neural-label-fade {
  to { opacity: 0; filter: blur(6px); }
}
@keyframes neural-think-shrink {
  0%   { opacity: 1; transform: scale(1); }
  70%  { opacity: 0.6; transform: scale(0.5); }
  100% { opacity: 0; transform: scale(0); }
}

/* ── Bubble Emerge (response appears from convergence point) ─────── */

.co-bubble--emerge {
  animation: bubble-emerge 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: left center;
}

@keyframes bubble-emerge {
  0%   { opacity: 0; transform: scaleX(0.3) scaleY(0.6); filter: blur(4px); }
  60%  { opacity: 1; transform: scaleX(1.02) scaleY(1.02); filter: blur(0); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* ── Typing cursor (blinking line during stream) ─────────────────── */

.co-typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  border-radius: 1px;
  background: var(--accent-1, var(--co-accent));
  box-shadow: 0 0 6px color-mix(in srgb, var(--co-accent) 40%, transparent);
  animation: typing-blink 0.9s ease-in-out infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
  flex-shrink: 0;
}

@keyframes typing-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.2; }
}

/* Dissolve transition (legacy compat) */
.co-bubble--dissolve {
  animation: co-dissolve 0.3s ease-out forwards !important;
}

@keyframes co-dissolve {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.95) translateY(-4px); }
}

/* ── Streaming state ─────────────────────────────────────────────── */

.co-bubble--streaming {
  border-color: color-mix(in srgb, var(--co-accent) 15%, transparent);
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* ── Context Constellation (knowledge graph visual) ──────────────── */

.co-constellation {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 8px;
  animation: constellation-enter 0.4s ease-out;
  overflow: hidden;
}

@keyframes constellation-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.co-constellation__svg {
  width: 120px;
  height: 40px;
  flex-shrink: 0;
}

/* Dots appear sequentially */
.co-constellation__dot {
  fill: #8fac8f;
  opacity: 0;
}

.co-constellation__dot--1 { animation: const-dot 0.3s 0.1s ease-out forwards; }
.co-constellation__dot--2 { animation: const-dot 0.3s 0.3s ease-out forwards; }
.co-constellation__dot--3 { animation: const-dot 0.3s 0.5s ease-out forwards; }
.co-constellation__dot--4 { animation: const-dot 0.3s 0.7s ease-out forwards; }

@keyframes const-dot {
  from { opacity: 0; transform: scale(0); }
  to   { opacity: 1; transform: scale(1); }
}

/* Lines draw sequentially after dots */
.co-constellation__line {
  stroke: rgba(167, 139, 250, 0.3);
  stroke-width: 1;
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
}

.co-constellation__line--1 { animation: const-line 0.4s 0.4s ease-out forwards; }
.co-constellation__line--2 { animation: const-line 0.4s 0.6s ease-out forwards; }
.co-constellation__line--3 { animation: const-line 0.4s 0.8s ease-out forwards; }
.co-constellation__line--4 { animation: const-line 0.4s 1.0s ease-out forwards; }

@keyframes const-line {
  from { stroke-dashoffset: 80; }
  to   { stroke-dashoffset: 0; }
}

.co-constellation__label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--accent-3, #8fac8f);
  white-space: nowrap;
  opacity: 0;
  animation: const-label 0.3s 0.8s ease-out forwards;
}

@keyframes const-label {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 0.7; transform: translateX(0); }
}

/* Fade out */
.co-constellation--fade {
  animation: constellation-fade 0.4s ease-out forwards;
}

@keyframes constellation-fade {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-4px); }
}

/* ── Specialist Identity Badge ───────────────────────────────────── */

.co-specialist-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--specialist-color, var(--co-accent)) 14%, transparent);
  color: var(--specialist-color, #8fac8f);
  animation: co-chip-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.co-specialist-emoji {
  font-size: 0.72rem;
  line-height: 1;
}

/* Morph animation when specialist changes between messages */
.co-specialist-morph {
  animation: specialist-morph 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes specialist-morph {
  0%   { transform: scale(0.7); opacity: 0; filter: blur(4px); }
  50%  { transform: scale(1.1); opacity: 0.7; filter: blur(0); }
  100% { transform: scale(1); opacity: 1; filter: blur(0); }
}

/* ── Tool Card Status Pop ────────────────────────────────────────── */

.co-tool-card__status--pop {
  animation: tool-status-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes tool-status-pop {
  from { transform: scale(0) rotate(-180deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Error shake for failed tool cards */
.co-tool-card--error {
  animation: tool-error-shake 0.4s ease-out;
}

@keyframes tool-error-shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  40%      { transform: translateX(4px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(2px); }
}

/* ── Scroll-to-Bottom FAB ────────────────────────────────────────── */

.co-scroll-fab {
  position: absolute;
  bottom: 80px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--card-bg, rgba(28, 25, 23, 0.9));
  color: var(--text, #f0f0f5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 10;
  animation: scroll-fab-in 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  transition: transform 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.co-scroll-fab:active {
  transform: scale(0.88);
}

.co-scroll-fab:hover {
  background: color-mix(in srgb, var(--co-accent) 15%, transparent);
  border-color: color-mix(in srgb, var(--co-accent) 30%, transparent);
}

@keyframes scroll-fab-in {
  from { opacity: 0; transform: scale(0.6) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════
   Light Theme
   ═══════════════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: light) {
  :root:not([data-tg-theme]) .co-header::before { background: color-mix(in srgb, var(--co-border) 88%, transparent); }
  :root:not([data-tg-theme]) .co-close-btn { background: var(--co-surface-card); }
  :root:not([data-tg-theme]) .co-close-btn:active { background: color-mix(in srgb, var(--co-surface-card) 88%, color-mix(in srgb, var(--co-accent) 8%, transparent)); }

  /* Bot bubble — visible on light bg */
  :root:not([data-tg-theme]) .co-bubble--bot { background: var(--co-surface-card); border-color: var(--co-border); }
  :root:not([data-tg-theme]) .co-bubble--bot .co-bubble__text strong { color: var(--text, var(--co-text-strong)); }
  :root:not([data-tg-theme]) .co-bubble--bot .co-bubble__text code { background: var(--co-surface-panel); }

  /* Input bar */
  :root:not([data-tg-theme]) .co-input-bar textarea { background: var(--co-surface-card); border-color: var(--co-border); }
  :root:not([data-tg-theme]) .co-input-bar textarea:focus { border-color: color-mix(in srgb, var(--co-accent) 50%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--co-accent) 10%, transparent); }

  /* Mic & attach buttons */
  :root:not([data-tg-theme]) .co-mic-btn { background: var(--co-surface-card); }
  :root:not([data-tg-theme]) .co-attach-btn { background: var(--co-surface-card); }

  /* Separators and dividers */
  :root:not([data-tg-theme]) .co-date-sep::before,
  :root:not([data-tg-theme]) .co-date-sep::after { background: rgba(0, 0, 0, 0.08); }
  :root:not([data-tg-theme]) .co-actions { border-top-color: rgba(0, 0, 0, 0.06); }
  :root:not([data-tg-theme]) .co-input-bar { border-top-color: rgba(0, 0, 0, 0.06); }

  /* Image preview */
  :root:not([data-tg-theme]) .co-image-preview { background: var(--secondary-bg); border-top-color: var(--separator); }
  :root:not([data-tg-theme]) .co-image-preview__thumb { border-color: var(--co-border); }
  :root:not([data-tg-theme]) .co-image-preview__cancel { background: var(--co-surface-card); color: var(--co-text-secondary); }
  :root:not([data-tg-theme]) .co-header { border-bottom-color: rgba(0, 0, 0, 0.06); }

  /* Phase bar */
  :root:not([data-tg-theme]) .co-phase-bar { border-top-color: var(--separator); background: color-mix(in srgb, var(--co-surface-panel) 72%, transparent); }

  /* Model badge */
  :root:not([data-tg-theme]) .co-model-badge { border-top-color: rgba(0, 0, 0, 0.06); }

  /* Agent cards */
  :root:not([data-tg-theme]) .co-agent-card__title { color: rgba(0, 0, 0, 0.85); }
  :root:not([data-tg-theme]) .co-agent-card__detail { color: rgba(0, 0, 0, 0.45); }

  /* Neural thinking — light mode */
  :root:not([data-tg-theme]) .co-neural__label { color: var(--co-accent); }
  :root:not([data-tg-theme]) .co-neural__dot { background: var(--co-accent); }
  :root:not([data-tg-theme]) .co-neural__thought { color: rgba(0, 0, 0, 0.5); }

  /* Typing cursor — light mode */
  :root:not([data-tg-theme]) .co-typing-cursor {
    background: var(--co-accent);
    box-shadow: 0 0 4px color-mix(in srgb, var(--co-accent) 30%, transparent);
  }

  /* Scroll FAB — light mode */
  :root:not([data-tg-theme]) .co-scroll-fab {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--co-text-secondary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  }

  /* Tool cards — light mode borders */
  :root:not([data-tg-theme]) .co-tool-card { background: var(--co-surface-card); border-color: var(--co-border); }
  :root:not([data-tg-theme]) .co-tool-card__name { color: rgba(0, 0, 0, 0.75); }
  :root:not([data-tg-theme]) .co-tool-card__summary { color: rgba(0, 0, 0, 0.45); }

  /* Constellation — light mode */
  :root:not([data-tg-theme]) .co-constellation__line { stroke: color-mix(in srgb, var(--co-accent) 20%, transparent); }

  /* Stop button — light mode */
  :root:not([data-tg-theme]) .co-stop-btn {
    box-shadow: 0 2px 10px color-mix(in srgb, var(--co-error) 20%, transparent);
  }

  /* Edit flash — light mode */
  :root:not([data-tg-theme]) .co-bubble--editing {
    animation: edit-flash-light 0.8s ease;
  }
  :root:not([data-tg-theme]) .co-bubble--editing .co-bubble__text {
    outline-color: color-mix(in srgb, var(--co-accent) 40%, transparent);
  }
}

@keyframes edit-flash-light {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--co-accent) 30%, transparent); }
  40%  { box-shadow: 0 0 0 6px color-mix(in srgb, var(--co-accent) 15%, transparent); }
  100% { box-shadow: 0 2px 12px color-mix(in srgb, var(--co-accent) 20%, transparent); }
}

:root[data-theme-mode="light"]:not([data-tg-theme]) .co-header::before { background: color-mix(in srgb, var(--co-border) 88%, transparent); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-close-btn { background: var(--co-surface-card); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-close-btn:active { background: color-mix(in srgb, var(--co-surface-card) 88%, color-mix(in srgb, var(--co-accent) 8%, transparent)); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-bubble--bot { background: var(--co-surface-card); border-color: var(--co-border); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-bubble--bot .co-bubble__text strong { color: var(--text, var(--co-text-strong)); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-bubble--bot .co-bubble__text code { background: var(--co-surface-panel); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-input-bar textarea { background: var(--co-surface-card); border-color: var(--co-border); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-input-bar textarea:focus { border-color: color-mix(in srgb, var(--co-accent) 50%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--co-accent) 10%, transparent); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-mic-btn { background: var(--co-surface-card); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-attach-btn { background: var(--co-surface-card); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-date-sep::before,
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-date-sep::after { background: rgba(0, 0, 0, 0.08); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-actions { border-top-color: rgba(0, 0, 0, 0.06); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-input-bar { border-top-color: rgba(0, 0, 0, 0.06); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-image-preview { background: var(--secondary-bg); border-top-color: var(--separator); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-image-preview__thumb { border-color: var(--co-border); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-image-preview__cancel { background: var(--co-surface-card); color: var(--co-text-secondary); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-header { border-bottom-color: rgba(0, 0, 0, 0.06); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-phase-bar { border-top-color: var(--separator); background: color-mix(in srgb, var(--co-surface-panel) 72%, transparent); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-model-badge { border-top-color: rgba(0, 0, 0, 0.06); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-agent-card__title { color: rgba(0, 0, 0, 0.85); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-agent-card__detail { color: rgba(0, 0, 0, 0.45); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-neural__label { color: var(--co-accent); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-neural__dot { background: var(--co-accent); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-neural__thought { color: rgba(0, 0, 0, 0.5); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-typing-cursor { background: var(--co-accent); box-shadow: 0 0 4px color-mix(in srgb, var(--co-accent) 30%, transparent); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-scroll-fab {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--co-text-secondary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-tool-card { background: var(--co-surface-card); border-color: var(--co-border); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-tool-card__name { color: rgba(0, 0, 0, 0.75); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-tool-card__summary { color: rgba(0, 0, 0, 0.45); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-constellation__line { stroke: color-mix(in srgb, var(--co-accent) 20%, transparent); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-stop-btn { box-shadow: 0 2px 10px color-mix(in srgb, var(--co-error) 20%, transparent); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-bubble--editing { animation: edit-flash-light 0.8s ease; }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-bubble--editing .co-bubble__text { outline-color: color-mix(in srgb, var(--co-accent) 40%, transparent); }
:root[data-theme-mode="light"]:not([data-tg-theme]) .co-history-banner { background: var(--co-surface-card); border-color: var(--co-border); color: rgba(0, 0, 0, 0.5); }

:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-header::before { background: color-mix(in srgb, var(--co-border) 82%, transparent); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-close-btn { background: var(--co-surface-card); color: var(--hint, var(--co-text-hint)); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-close-btn:active { background: color-mix(in srgb, var(--co-surface-card) 72%, color-mix(in srgb, var(--co-accent) 14%, transparent)); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-bubble--bot { background: var(--co-surface-card); border-color: var(--co-border); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-bubble--bot .co-bubble__text code { background: var(--co-surface-panel); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-actions { border-top-color: var(--separator); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-input-bar { border-top-color: var(--separator); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-input-bar textarea { background: var(--co-surface-card); border-color: var(--co-border); color: var(--text); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-input-bar textarea:focus { border-color: color-mix(in srgb, var(--co-border) 38%, color-mix(in srgb, var(--co-accent) 52%, transparent)); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-mic-btn { background: var(--co-surface-card); color: var(--hint); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-attach-btn { background: var(--co-surface-card); color: var(--hint); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-image-preview { background: var(--secondary-bg); border-top-color: var(--separator); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-image-preview__thumb { border-color: var(--co-border); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-image-preview__cancel { background: var(--co-surface-card); color: var(--text); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-phase-bar { border-top-color: var(--separator); background: color-mix(in srgb, var(--co-surface-panel) 72%, transparent); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-model-badge { border-top-color: var(--separator); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-tool-card { background: var(--co-surface-card); border-color: var(--co-border); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-tool-card__name { color: var(--text-secondary, rgba(255,255,255,0.85)); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-tool-card__summary { color: var(--hint, rgba(255,255,255,0.5)); }
:root[data-theme-preference="dark"]:not([data-tg-theme]) .co-history-banner { background: var(--co-surface-card); border-color: var(--co-border); color: var(--hint); }

/* ── Free Assistant Banner Compatibility Styles ─────────────────── */

.lai-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 8px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--co-accent) 12%, transparent) 0%, rgba(168,85,247,0.10) 100%);
  border: 1px solid color-mix(in srgb, var(--co-accent) 20%, transparent);
  position: relative;
  animation: lai-slide-in 0.3s ease;
}

@keyframes lai-slide-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lai-banner__icon {
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.lai-banner__body {
  flex: 1;
  min-width: 0;
}

.lai-banner__title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text);
}

.lai-banner__desc {
  font-size: 12px;
  color: var(--hint);
  line-height: 1.4;
}

.lai-banner__actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.lai-banner__close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: var(--hint);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}

.lai-btn {
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.lai-btn--primary {
  background: var(--accent, var(--co-accent));
  color: #fff;
}
.lai-btn--primary:hover { opacity: 0.9; }

.lai-btn--ghost {
  background: transparent;
  color: var(--hint);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
}
.lai-btn--ghost:hover { background: rgba(255,255,255,0.05); }

/* ── Free Assistant Progress Compatibility Styles ────────────────── */

.lai-prog-wrap {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  margin-top: 8px;
  overflow: hidden;
}

.lai-prog-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--co-accent), var(--co-accent-hover));
  transition: width 0.3s ease;
}

/* ── Free Assistant Response Badge Compatibility ─────────────────── */

.co-local-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--co-accent) 15%, transparent);
  color: var(--co-accent-hover);
  margin-left: 6px;
}

/* ── Free Assistant Header Indicator Compatibility ───────────────── */

.co-lai-indicator {
  font-size: 10px;
  font-weight: 600;
  margin-left: 8px;
  opacity: 0.8;
}

/* ── Settings Danger Action Styles ───────────────────────────────── */

.btn-action--danger {
  background: color-mix(in srgb, var(--co-error) 15%, transparent) !important;
  color: var(--co-error) !important;
  border: 1px solid color-mix(in srgb, var(--co-error) 30%, transparent) !important;
}
.btn-action--danger:hover {
  background: color-mix(in srgb, var(--co-error) 25%, transparent) !important;
}
