/* ============================================
   Digital Anima — Chat Styles
   ============================================ */

/* --- Main Panel: Chat --- */
.panel-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px;
  min-height: 0;
}

.chat-messages > * + * {
  margin-top: 8px;
}

.chat-empty {
  color: var(--aw-color-text-muted);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 80px;
}

/* --- Chat Message Row (avatar + bubble) --- */
.chat-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.chat-msg-row.user {
  flex-direction: row-reverse;
}

.chat-msg-row.assistant .chat-bubble.assistant {
  margin-right: 0;
}

.chat-msg-row.user .chat-bubble.user {
  margin-left: 0;
}

.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}

.chat-msg-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.chat-msg-avatar-initial {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--aw-color-bg-primary);
  background: var(--aw-color-accent);
}

.chat-msg-avatar-user {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--aw-color-text-muted);
  background: var(--aw-color-bg-tertiary);
  padding: 4px;
}

/* --- Anima Tabs --- */
.chat-anima-tabs-header {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border-color, #eee);
}

.chat-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}

.chat-anima-tabs-header .anima-tabs {
  flex: 1;
  padding: 0;
  border-bottom: none;
  min-height: 36px;
}

.chat-add-conversation {
  position: relative;
  flex-shrink: 0;
}

.chat-add-conversation-btn {
  padding: 0.34rem 0.7rem;
  font-size: 0.82rem;
  border: 1px solid var(--aw-color-border-dark);
  border-radius: 999px;
  background: var(--aw-color-bg-secondary);
  color: var(--aw-color-text-primary);
  cursor: pointer;
  white-space: nowrap;
}

.chat-add-conversation-btn:hover,
.chat-add-conversation-btn:active {
  background: var(--aw-color-bg-hover);
}

.chat-right-pane-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--aw-color-text-primary);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.chat-right-pane-toggle-btn:hover,
.chat-right-pane-toggle-btn:active {
  background: var(--aw-color-bg-hover);
}

.chat-right-pane-toggle-btn:focus-visible {
  outline: 2px solid var(--aw-color-accent);
  outline-offset: 2px;
}

.chat-right-pane-toggle-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 0.15s;
}

.chat-right-pane-toggle-btn.is-collapsed .chat-right-pane-toggle-icon {
  transform: rotate(180deg);
}

.chat-right-pane-handle {
  width: 40px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.4rem;
  flex-shrink: 0;
}

.chat-add-conversation-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  width: min(360px, 68vw);
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--aw-color-border-medium);
  border-radius: 12px;
  background: var(--aw-color-bg-primary);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  padding: 0.35rem;
  z-index: 9999;
  display: none;
}

.chat-add-conversation.open .chat-add-conversation-menu {
  display: block;
}

.chat-add-conversation-item {
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 0.42rem 0.48rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--aw-color-text-primary);
  text-align: left;
  cursor: pointer;
}

.chat-add-conversation-item:hover,
.chat-add-conversation-item:active {
  background: var(--aw-color-bg-hover);
}

.chat-add-conversation-item.disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.chat-add-conversation-name {
  font-size: 0.84rem;
  line-height: 1.25;
}

.add-conversation-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.add-conversation-avatar-img {
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--aw-color-avatar-border) 80%, transparent 20%);
}

.add-conversation-avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.56rem;
  font-weight: 700;
  color: var(--aw-color-bg-primary);
  background: var(--aw-color-accent);
}

.chat-add-conversation-empty {
  color: var(--aw-color-text-muted);
  font-size: 0.82rem;
  padding: 0.45rem 0.55rem;
}

.anima-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border-color, #eee);
  flex-wrap: wrap;
  min-height: 38px;
}

.anima-tab-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.anima-tab {
  padding: 0.34rem 0.68rem;
  font-size: 0.85rem;
  border: 1px solid var(--aw-color-border-dark);
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--aw-color-bg-secondary) 92%, white 8%), var(--aw-color-bg-secondary));
  color: var(--aw-color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.anima-tab:hover,
.anima-tab:active {
  background: var(--aw-color-bg-hover);
  color: var(--aw-color-text-primary);
  border-color: color-mix(in srgb, var(--aw-color-accent) 50%, var(--aw-color-border-dark) 50%);
  transform: translateY(-1px);
}

.anima-tab.active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--aw-color-accent) 22%, var(--aw-color-bg-secondary) 78%), color-mix(in srgb, var(--aw-color-accent) 10%, var(--aw-color-bg-secondary) 90%));
  color: var(--aw-color-text-primary);
  border-color: color-mix(in srgb, var(--aw-color-accent) 70%, var(--aw-color-border-dark) 30%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--aw-color-accent) 22%, transparent 78%);
}

.anima-tab.is-streaming {
  animation: anima-tab-thinking-pulse 1.6s ease-in-out infinite;
  position: relative;
}

.anima-tab.is-streaming:not(.active) {
  animation: none;
}

.anima-tab.is-streaming .anima-tab-avatar {
  animation: streaming-avatar-ring 1.4s ease-in-out infinite;
  animation-play-state: running !important;
}

.anima-tab.is-streaming:not(.active) .anima-tab-avatar {
  animation: none;
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--aw-color-accent) 45%, transparent 55%);
}

.anima-tab.is-streaming::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--aw-color-accent);
  border: 2px solid var(--aw-color-bg-secondary);
  animation: streaming-badge-pulse 0.9s ease-in-out infinite;
  animation-play-state: running !important;
  z-index: 2;
  pointer-events: none;
}

.anima-tab.is-streaming:not(.active)::after {
  background: color-mix(in srgb, var(--aw-color-accent) 55%, var(--aw-color-bg-secondary) 45%);
  width: 8px;
  height: 8px;
  animation: streaming-badge-fade 2s ease-in-out infinite;
}

@keyframes streaming-avatar-ring {
  0%, 100% {
    box-shadow: 0 0 0 2px var(--aw-color-accent), 0 0 6px 2px color-mix(in srgb, var(--aw-color-accent) 40%, transparent 60%);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 3px var(--aw-color-accent), 0 0 12px 4px color-mix(in srgb, var(--aw-color-accent) 60%, transparent 40%);
    transform: scale(1.06);
  }
}

@keyframes streaming-badge-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

@keyframes streaming-badge-fade {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.3; }
}

.anima-tab.has-unread-complete {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #16a34a 18%, var(--aw-color-bg-secondary) 82%),
    color-mix(in srgb, #16a34a 8%, var(--aw-color-bg-secondary) 92%)
  );
  border-color: color-mix(in srgb, #16a34a 44%, var(--aw-color-border-dark) 56%);
  color: var(--aw-color-text-primary);
}

.anima-tab.active.has-unread-complete {
  box-shadow: 0 0 0 1px color-mix(in srgb, #16a34a 28%, transparent 72%);
}

@keyframes anima-tab-thinking-pulse {
  0%,
  100% {
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--aw-color-accent) 20%, var(--aw-color-bg-secondary) 80%),
      color-mix(in srgb, var(--aw-color-accent) 10%, var(--aw-color-bg-secondary) 90%)
    );
    border-color: color-mix(in srgb, var(--aw-color-accent) 48%, var(--aw-color-border-dark) 52%);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--aw-color-accent) 0%, transparent 100%);
  }
  50% {
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--aw-color-accent) 38%, var(--aw-color-bg-secondary) 62%),
      color-mix(in srgb, var(--aw-color-accent) 22%, var(--aw-color-bg-secondary) 78%)
    );
    border-color: color-mix(in srgb, var(--aw-color-accent) 72%, var(--aw-color-border-dark) 28%);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--aw-color-accent) 20%, transparent 80%);
  }
}

.tab-star {
  color: #f59e0b;
  font-size: 0.78rem;
  margin-left: 0.2rem;
}

.anima-tab-name {
  letter-spacing: 0.01em;
}

.anima-tab-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.anima-tab-avatar-img {
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--aw-color-avatar-border) 80%, transparent 20%);
}

.anima-tab-avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--aw-color-bg-primary);
  background: var(--aw-color-accent);
}

.mode-realistic .anima-tab-avatar-initial {
  background: color-mix(in srgb, var(--aw-color-text-primary) 20%, var(--aw-color-bg-tertiary) 80%);
  color: var(--aw-color-text-primary);
}

.anima-tab-close {
  padding: 0 4px;
  font-size: 1rem;
  line-height: 1;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--aw-color-text-muted);
  cursor: pointer;
}

.anima-tab-close:hover,
.anima-tab-close:active {
  background: var(--aw-color-bg-hover);
  color: var(--aw-color-text-primary);
}

/* --- Anima tab floating tooltip (icon-only mode) --- */
.anima-tab-tooltip {
  position: fixed;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--aw-color-bg-tertiary, #333);
  color: var(--aw-color-text-primary, #eee);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.anima-tab-tooltip.visible {
  opacity: 1;
}

/* --- Mobile-only unified header elements (hidden on desktop) --- */
.chat-unified-hamburger,
.chat-thread-dropdown,
.chat-unified-info-btn,
.chat-unified-user-btn,
.chat-unified-user-menu {
  display: none;
}

/* ── Split / Close pane buttons ──────── */
.chat-split-pane-btn,
.chat-close-pane-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--aw-color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.chat-split-pane-btn:hover,
.chat-close-pane-btn:hover {
  background: var(--aw-color-bg-hover);
  color: var(--aw-color-text-primary);
}

.chat-close-pane-btn:hover {
  color: var(--aw-color-danger, #ef4444);
}

/* --- Desktop: icon rail layout for anima tabs --- */
@media (min-width: 769px) {
  .chat-page-layout.sidebar-hidden {
    gap: 0;
  }

  .chat-page-layout.sidebar-hidden .chat-page-sidebar {
    display: none;
  }

  .chat-page-layout.sidebar-hidden .chat-right-pane-handle {
    border-left: 1px solid var(--aw-color-border-light);
  }

  .chat-page-main {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
  }

  .chat-anima-tabs-header {
    grid-column: 1;
    grid-row: 1 / 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.35rem;
    border-bottom: none;
    border-right: 1px solid var(--border-color, #eee);
    min-height: 0;
    overflow: hidden;
  }

  .chat-anima-tabs-header .anima-tabs {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .chat-anima-tabs-header .anima-tab-wrap {
    width: 100%;
    justify-content: center;
    position: relative;
  }

  .chat-anima-tabs-header .anima-tab {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    justify-content: center;
    gap: 0;
  }

  .chat-anima-tabs-header .anima-tab-name {
    display: none;
  }

  .chat-anima-tabs-header .anima-tab-close {
    position: absolute;
    top: -4px;
    right: 2px;
    display: none;
    width: 18px;
    height: 18px;
    padding: 0;
    font-size: 0.72rem;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    background: var(--aw-color-bg-secondary);
    border: 1px solid var(--aw-color-border);
    color: var(--aw-color-text-muted);
    z-index: 2;
  }

  .chat-anima-tabs-header .anima-tab-wrap:hover .anima-tab-close {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .chat-anima-tabs-header .anima-tab-avatar {
    width: 36px;
    height: 36px;
  }

  .chat-anima-tabs-header .anima-tab.is-streaming::after {
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
  }

  .chat-anima-tabs-header .anima-tab.is-streaming:not(.active)::after {
    width: 7px;
    height: 7px;
  }

  .chat-split-pane-btn,
  .chat-close-pane-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
  }

  .chat-add-conversation {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .chat-add-conversation-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 999px;
    font-size: 0;
    line-height: 0;
  }

  .chat-add-conversation-btn::before {
    content: "+";
    font-size: 1.25rem;
    line-height: 1;
    color: var(--aw-color-text-primary);
  }

  .chat-add-conversation-menu {
    left: calc(100% + 8px);
    right: auto;
    top: auto;
    bottom: 0;
    width: min(360px, 56vw);
  }

  .thread-tabs {
    grid-column: 2;
    grid-row: 1;
  }

  .chat-messages-area {
    grid-column: 2;
    grid-row: 2;
    min-height: 0;
  }

  [data-chat-id="chatPageForm"] {
    grid-column: 2;
    grid-row: 3;
  }
}

/* --- Thread Tabs --- */
.thread-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-color, #eee);
  flex-wrap: wrap;
  min-height: 40px;
}

.thread-tab-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.thread-tab {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--aw-color-text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.thread-tab:hover,
.thread-tab:active {
  background: var(--aw-color-bg-hover);
  color: var(--aw-color-text-primary);
}

.thread-tab.active {
  background: color-mix(in srgb, var(--aw-color-accent) 18%, var(--aw-color-bg-secondary) 82%);
  color: var(--aw-color-accent-hover);
  font-weight: 600;
}

.thread-tab.is-streaming {
  animation: thread-tab-thinking-pulse 1.6s ease-in-out infinite;
  color: var(--aw-color-accent-hover);
  font-weight: 600;
  position: relative;
}

.thread-tab.is-streaming::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--aw-color-accent);
  animation: streaming-badge-pulse 0.9s ease-in-out infinite;
  animation-play-state: running !important;
  margin-right: 4px;
  flex-shrink: 0;
}

.thread-tab.has-unread-complete {
  background: color-mix(in srgb, #16a34a 15%, var(--aw-color-bg-secondary) 85%);
  color: color-mix(in srgb, #16a34a 80%, var(--aw-color-text-primary) 20%);
  font-weight: 600;
}

.thread-tab.active.has-unread-complete {
  background: color-mix(in srgb, #16a34a 18%, var(--aw-color-bg-secondary) 82%);
  color: color-mix(in srgb, #16a34a 80%, var(--aw-color-text-primary) 20%);
}

@keyframes thread-tab-thinking-pulse {
  0%,
  100% {
    background: color-mix(in srgb, var(--aw-color-accent) 12%, var(--aw-color-bg-secondary) 88%);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--aw-color-accent) 0%, transparent 100%);
  }
  50% {
    background: color-mix(in srgb, var(--aw-color-accent) 30%, var(--aw-color-bg-secondary) 70%);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--aw-color-accent) 18%, transparent 82%);
  }
}

.thread-tab-close {
  padding: 0 4px;
  font-size: 1rem;
  line-height: 1;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--aw-color-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.thread-tab-close:hover,
.thread-tab-close:active {
  background: var(--aw-color-bg-hover);
  color: var(--aw-color-text-primary);
}

.thread-tab-new {
  padding: 0.35rem 0.6rem;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--aw-color-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-left: 4px;
}

.thread-tab-new:hover,
.thread-tab-new:active {
  background: var(--aw-color-bg-hover);
  color: var(--aw-color-accent);
}

.thread-more-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.35rem;
  padding: 0.1rem 0.25rem;
}

.thread-more-label {
  font-size: 0.74rem;
  color: var(--aw-color-text-muted);
}

.thread-more-select {
  border: 1px solid var(--aw-color-border-dark);
  border-radius: 8px;
  background: var(--aw-color-bg-secondary);
  color: var(--aw-color-text-primary);
  padding: 0.28rem 0.45rem;
  font-size: 0.78rem;
  max-width: 230px;
}

/* --- Thread Archive Button & Dropdown --- */
.thread-archive-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  flex-shrink: 0;
}

.thread-archive-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0.3rem 0.45rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--aw-color-text-muted);
  cursor: pointer;
  font-size: 0.72rem;
  transition: background 0.15s, color 0.15s;
}

.thread-archive-btn:hover,
.thread-archive-btn:active {
  background: var(--aw-color-bg-hover);
  color: var(--aw-color-text-primary);
}

.thread-archive-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--aw-color-text-muted);
  color: var(--aw-color-bg-primary);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0 4px;
}

.thread-archive-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  max-width: 300px;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--aw-color-border-medium);
  border-radius: 10px;
  background: var(--aw-color-bg-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 4px;
  z-index: 20;
}

.thread-archive-wrap.open .thread-archive-menu {
  display: block;
}

.thread-archive-item {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
  color: var(--aw-color-text-primary);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.thread-archive-item:hover,
.thread-archive-item:active {
  background: var(--aw-color-bg-hover);
}

.thread-more-select:focus {
  outline: none;
  border-color: var(--aw-color-accent);
}

.chat-ts {
  display: block;
  font-size: 0.65rem;
  color: var(--aw-color-text-placeholder);
  margin-top: 4px;
  text-align: right;
}

.chat-bubble.user .chat-ts {
  color: var(--aw-color-text-muted);
}

.chat-bubble {
  width: 100%;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
  overflow: hidden;
}

.chat-bubble.user {
  margin-left: auto;
  max-width: 85%;
  width: fit-content;
  background: var(--aw-color-bg-tertiary);
  color: var(--aw-color-text-primary);
  border-radius: 6px;
}

.chat-bubble.assistant {
  position: relative;
  margin-right: auto;
  background: transparent;
  color: var(--aw-color-text-primary);
  white-space: normal;
}

/* ── Bubble Action Bar ──────────────────── */

.bubble-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  z-index: 1;
}

.chat-bubble.assistant:hover .bubble-actions,
.chat-bubble.assistant:focus-within .bubble-actions,
.chat-bubble.assistant .bubble-actions.visible {
  opacity: 1;
  pointer-events: auto;
}

.chat-bubble.assistant.streaming .bubble-actions {
  display: none;
}

.bubble-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: var(--aw-color-bg-secondary);
  color: var(--aw-color-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

@supports (backdrop-filter: blur(4px)) {
  .bubble-action-btn {
    background: color-mix(in srgb, var(--aw-color-bg-primary) 80%, transparent 20%);
    backdrop-filter: blur(4px);
  }
}

.bubble-action-btn:hover,
.bubble-action-btn:active {
  background: var(--aw-color-bg-primary);
  color: var(--aw-color-text-primary);
}

.bubble-action-btn [data-lucide] {
  width: 14px;
  height: 14px;
}

@media (max-width: 768px) {
  .chat-bubble.assistant:hover .bubble-actions {
    opacity: 0;
    pointer-events: none;
  }
  .chat-bubble.assistant .bubble-actions.visible {
    opacity: 1;
    pointer-events: auto;
  }
}

/* --- Markdown content inside assistant bubbles --- */
.chat-bubble.assistant p {
  margin: 0 0 0.5em;
}
.chat-bubble.assistant p:last-child {
  margin-bottom: 0;
}
.chat-bubble.assistant h1,
.chat-bubble.assistant h2,
.chat-bubble.assistant h3,
.chat-bubble.assistant h4 {
  margin: 0.6em 0 0.3em;
  line-height: 1.3;
}
.chat-bubble.assistant h1 { font-size: 1.1em; }
.chat-bubble.assistant h2 { font-size: 1.05em; }
.chat-bubble.assistant h3 { font-size: 1em; }
.chat-bubble.assistant ul,
.chat-bubble.assistant ol {
  margin: 0.3em 0;
  padding-left: 1.4em;
}
.chat-bubble.assistant li {
  margin: 0.15em 0;
}
.chat-bubble.assistant code {
  background: var(--aw-color-code-inline-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.85em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  word-break: break-word;
}
.chat-bubble.assistant pre {
  background: var(--aw-color-code-bg);
  color: var(--aw-color-code-text);
  padding: 8px 10px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.4em 0;
  font-size: 0.82em;
  line-height: 1.5;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-bubble.assistant pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.chat-bubble.assistant blockquote {
  border-left: 3px solid var(--aw-color-border-dark);
  margin: 0.4em 0;
  padding: 0.2em 0.8em;
  color: var(--aw-color-text-secondary);
}
.chat-bubble.assistant table {
  border-collapse: collapse;
  margin: 0.4em 0;
  font-size: 0.85em;
  max-width: 100%;
  display: block;
  overflow-x: auto;
}
.chat-bubble.assistant th,
.chat-bubble.assistant td {
  border: 1px solid var(--aw-color-border-dark);
  padding: 4px 8px;
}
.chat-bubble.assistant th {
  background: var(--aw-color-bg-tertiary);
  font-weight: 600;
}
.chat-bubble.assistant a {
  color: var(--aw-color-accent);
  text-decoration: underline;
}
.chat-bubble.assistant hr {
  border: none;
  border-top: 1px solid var(--aw-color-border-dark);
  margin: 0.5em 0;
}
.chat-bubble img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 8px;
  object-fit: contain;
  cursor: pointer;
}

.chat-bubble.thinking {
  margin-right: auto;
  background: var(--aw-color-warning-bg);
  color: var(--aw-color-warning-text);
  border-bottom-left-radius: 4px;
  font-style: italic;
}

@keyframes thinking-dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

.thinking-animation::after {
  content: '';
  animation: thinking-dots 1.5s steps(1) infinite;
  animation-play-state: var(--aw-animation-play-state);
}

/* ── Messages Area Wrapper ──────────────────── */
.chat-messages-area {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ── Scroll to Bottom Button ──────────────────── */
.scroll-to-bottom-btn {
  position: absolute;
  right: 16px;
  bottom: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--aw-color-border-medium);
  background: var(--aw-color-bg-primary);
  color: var(--aw-color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}

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

.scroll-to-bottom-btn:hover {
  background: var(--aw-color-bg-hover);
}

.chat-input-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 12px 4px;
  border-top: 1px solid var(--aw-color-border-light);
  flex-shrink: 0;
}

/* ── Textarea + Buttons Container ──────────── */

.chat-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  border: 1px solid var(--aw-color-border-medium);
  border-radius: 12px;
  background: var(--aw-color-bg-primary);
  transition: border-color 0.15s;
  overflow: visible;
  padding: 2px 4px;
}

.chat-input-wrap:focus-within {
  border-color: var(--aw-color-accent);
}

.chat-input-wrap:has(.chat-input:disabled) {
  background: var(--aw-color-bg-subtle);
}

.chat-input {
  width: 100%;
  padding: 2px 6px;
  border: none;
  background: transparent;
  color: var(--aw-color-text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  resize: none;
  overflow-y: auto;
  min-height: 64px;
  max-height: 260px;
  line-height: 1.5;
}

.chat-input:disabled {
  color: var(--aw-color-text-muted);
}

.chat-input-actions {
  display: grid;
  grid-template-columns: repeat(2, 28px);
  grid-auto-rows: 28px;
  gap: 6px;
  justify-content: center;
  align-content: center;
  padding: 0;
  min-height: 0;
}

.voice-controls-slot {
  width: 28px;
  height: 28px;
}

.chat-pane:not(.focused) .voice-controls-slot {
  visibility: hidden;
}

.chat-input-actions .voice-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-right: 0;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
}

.chat-input-actions .voice-mic-btn {
  width: 28px;
  height: 28px;
  border-width: 1px;
}

.chat-input-form .voice-toolbar {
  margin-top: 6px;
  background: var(--aw-color-bg-tertiary, #f0f0f0);
  border: 1px solid var(--aw-color-border, #e5e5e5);
}

.chat-send-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--aw-color-accent);
  color: var(--aw-color-bg-primary);
  border: none;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.chat-send-icon-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 0;
  pointer-events: none;
}

.chat-send-icon {
  width: 12px;
  height: 12px;
  display: block;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  pointer-events: none;
}

.chat-send-icon rect {
  fill: currentColor;
  stroke: none;
}

.chat-send-icon-square {
  width: 12px;
  height: 12px;
}

.chat-send-btn:hover:not(:disabled),
.chat-send-btn:active:not(:disabled) {
  background: var(--aw-color-accent-hover);
}

.chat-send-btn:focus-visible {
  outline: 2px solid var(--aw-color-accent-light);
  outline-offset: 2px;
}

.chat-send-btn:disabled {
  background: var(--aw-color-accent-light);
  cursor: not-allowed;
}

/* ── Pending Queue ──────────────────── */

.pending-queue-bar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 8px;
  background: var(--aw-color-warning-bg);
  border: 1px solid var(--aw-color-warning-border);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  max-height: 120px;
  overflow-y: auto;
  animation: pendingSlideIn 0.15s ease-out;
}

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

.pending-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 2px;
}

.pending-queue-label {
  font-weight: 600;
  color: var(--aw-color-warning-text);
  font-size: 0.72rem;
}

.pending-queue-clear {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--aw-color-text-muted);
  padding: 0 2px;
}

.pending-queue-clear:hover,
.pending-queue-clear:active {
  color: var(--aw-color-error);
}

.pending-queue-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  min-width: 0;
}

.pending-queue-item:hover,
.pending-queue-item:active {
  background: rgba(0, 0, 0, 0.05);
}

.pending-queue-item-num {
  flex-shrink: 0;
  color: var(--aw-color-text-muted);
  font-size: 0.7rem;
  width: 1.2em;
  text-align: right;
}

.pending-queue-item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--aw-color-warning-text);
}

.pending-queue-item-del {
  flex-shrink: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--aw-color-text-muted);
  padding: 0 2px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.1s;
}

.pending-queue-item:hover .pending-queue-item-del {
  opacity: 1;
}

.pending-queue-item-del:hover,
.pending-queue-item-del:active {
  color: var(--aw-color-error);
}

/* Queue add button */
.chat-queue-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--aw-color-text-muted);
  border: 1px solid var(--aw-color-border, #ddd);
  border-radius: 50%;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.chat-queue-icon {
  width: 12px;
  height: 12px;
  display: block;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  pointer-events: none;
}

.chat-queue-btn:hover:not(:disabled),
.chat-queue-btn:active:not(:disabled) {
  border-color: var(--aw-color-accent);
  color: var(--aw-color-accent);
}

.chat-queue-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Send button: stop mode (streaming, no pending) */
.chat-send-btn.stop {
  background: var(--aw-color-text-primary, #1f2937);
  color: #fff;
}

.chat-send-btn.stop:hover:not(:disabled),
.chat-send-btn.stop:active:not(:disabled) {
  filter: brightness(0.9);
}

/* Send button: interrupt mode (streaming + pending) */
.chat-send-btn.interrupt {
  background: var(--aw-color-warning, #d97706);
  color: #fff;
}

.chat-send-btn.interrupt:hover:not(:disabled),
.chat-send-btn.interrupt:active:not(:disabled) {
  filter: brightness(0.9);
}

/* ── Streaming UI ─────────────────────────── */

/* Streaming cursor: blinking block at end of text (案3) */
.streaming-cursor {
  display: inline;
  font-weight: 300;
  color: var(--aw-color-accent);
  animation: blink-cursor 1s step-end infinite;
  animation-play-state: var(--aw-animation-play-state);
}

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

/* Streaming bubble: left accent border (案2) */
.chat-bubble.assistant.streaming {
  border-left: 3px solid var(--aw-color-accent-light);
  min-height: 2em;
}

.tool-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  background: var(--aw-color-warning-bg);
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--aw-color-warning-text);
}

.tool-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--aw-color-warning);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  animation-play-state: var(--aw-animation-play-state);
  flex-shrink: 0;
}

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

/* ── Tool Activity Timeline ──────────────── */

.tool-activity-timeline {
  margin-top: 8px;
  font-size: 0.78rem;
  border-radius: 6px;
  background: var(--aw-color-card-bg, rgba(0,0,0,0.03));
  overflow: hidden;
}

.tool-activity-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  cursor: pointer;
  color: var(--aw-color-warning-text);
  user-select: none;
  list-style: none;
}
.tool-activity-header::-webkit-details-marker { display: none; }
.tool-activity-header .tool-spinner { width: 10px; height: 10px; }

.tool-activity-list {
  padding: 2px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tool-activity-item {
  display: flex;
  align-items: baseline;
  gap: 5px;
  line-height: 1.5;
  color: var(--aw-color-text-secondary);
}

.tool-activity-item--running {
  color: var(--aw-color-warning-text);
}
.tool-activity-item--running .tool-spinner { width: 10px; height: 10px; }

.tool-activity-item--error {
  color: var(--aw-color-error, #e74c3c);
}

.tool-activity-icon {
  flex-shrink: 0;
  font-weight: 600;
  font-size: 0.75rem;
}
.tool-activity-ok { color: var(--aw-color-success, #2ecc71); }
.tool-activity-error { color: var(--aw-color-error, #e74c3c); }

.tool-activity-name {
  font-family: var(--aw-font-mono, monospace);
  font-weight: 500;
}

.tool-activity-dur {
  font-size: 0.7rem;
  opacity: 0.7;
  white-space: nowrap;
}

.tool-activity-summary {
  font-size: 0.7rem;
  opacity: 0.65;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
}

.tool-activity-detail {
  margin-left: 6px;
  font-size: 0.7rem;
  opacity: 0.8;
  font-family: var(--aw-font-mono, monospace);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

/* ── Streaming Zone Layout ──────────────── */

.streaming-zone-text,
.streaming-zone-tools,
.streaming-zone-subordinate,
.streaming-zone-thinking {
  /* Zones are block-level wrappers; empty zones collapse */
}
.streaming-zone-tools:empty,
.streaming-zone-subordinate:empty,
.streaming-zone-thinking:empty {
  display: none;
}

/* ── Tool Activity Animations ──────────────── */

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

@keyframes aw-flash-success {
  0%   { background-color: rgba(46, 204, 113, 0.25); }
  100% { background-color: transparent; }
}

@keyframes aw-flash-error {
  0%   { background-color: rgba(231, 76, 60, 0.25); }
  100% { background-color: transparent; }
}

@keyframes aw-progress-dots {
  0%, 20% { opacity: 0.3; }
  50%     { opacity: 1; }
  80%, 100% { opacity: 0.3; }
}

.tool-activity-item {
  animation: aw-slide-in 0.2s ease-out;
}

.tool-activity-item--running::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--aw-color-warning-text, #92400e);
  margin-right: 2px;
  flex-shrink: 0;
  animation: aw-progress-dots 1.2s ease-in-out infinite;
}

.tool-activity-item:not(.tool-activity-item--running):not(.tool-activity-item--error) {
  animation: aw-slide-in 0.2s ease-out, aw-flash-success 0.6s ease-out;
}

.tool-activity-item--error:not(.tool-activity-item--running) {
  animation: aw-slide-in 0.2s ease-out, aw-flash-error 0.6s ease-out;
}

/* Suppress animations during streaming to prevent flicker */
.chat-bubble.streaming .tool-activity-item {
  animation: none;
}
.chat-bubble.streaming .tool-activity-item--running::before {
  animation: aw-progress-dots 1.2s ease-in-out infinite;
}

/* Completed tools collapsible section */
.tool-activity-completed {
  font-size: 0.75rem;
}
.tool-activity-completed-summary {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  cursor: pointer;
  color: var(--aw-color-text-muted);
  user-select: none;
  list-style: none;
}
.tool-activity-completed-summary::-webkit-details-marker { display: none; }
.tool-activity-completed-summary::before {
  content: "\25B6";
  font-size: 0.6rem;
  transition: transform 0.15s;
}
.tool-activity-completed[open] > .tool-activity-completed-summary::before {
  transform: rotate(90deg);
}

/* details smooth open/close */
.tool-activity-list {
  transition: max-height 0.25s ease;
  overflow: hidden;
}

/* ── Subordinate Activity ──────────────── */

.subordinate-activity {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 10px;
  background: var(--aw-color-bg-secondary, #f0f4f8);
  border-radius: 8px;
  font-size: 0.76rem;
  transition: opacity 0.15s ease;
}

.subordinate-activity--animate {
  animation: aw-slide-in 0.25s ease-out;
}

@keyframes aw-avatar-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
  50%      { box-shadow: 0 0 6px 2px rgba(99, 102, 241, 0.4); }
}

.subordinate-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  animation: aw-avatar-glow 2s ease-in-out infinite;
}

.subordinate-name {
  font-weight: 600;
  color: var(--aw-color-text-secondary);
  min-width: 40px;
}

.subordinate-tool {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--aw-font-mono, monospace);
  opacity: 0.9;
}

/* ── Heartbeat Relay Indicator ──────────── */

.heartbeat-relay-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--aw-color-success-bg-alt);
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--aw-color-success-text);
}

.heartbeat-relay-text {
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--aw-color-success-bg-alt);
  border-left: 2px solid var(--aw-color-success-border);
  border-radius: 0 4px 4px 0;
  font-size: 0.85rem;
  color: var(--aw-color-gray-dark);
  line-height: 1.5;
  opacity: 0.85;
}

/* ── Compression Indicator ────────────────── */

.compression-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  background: var(--aw-color-info-bg);
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--aw-color-info-text);
}

/* ── Bootstrap Indicator ─────────────────── */

.bootstrap-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  background: var(--aw-color-info-bg);
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--aw-color-info-text);
}

/* ── Bootstrap Progress (Chat) ─────────── */

.bootstrap-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  animation: bootstrap-fade-in 0.4s ease-out;
}

.bootstrap-progress-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.bootstrap-progress-avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.bootstrap-progress-avatar-initial {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--aw-color-bg-primary);
  background: var(--aw-color-accent);
}

.bootstrap-progress-header {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--aw-color-text-primary);
  margin-bottom: 4px;
}

.bootstrap-progress-spinner .tool-spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
  border-color: var(--aw-color-accent);
  border-top-color: transparent;
}

.bootstrap-progress-step {
  font-size: 0.92rem;
  color: var(--aw-color-text-secondary);
  min-height: 1.4em;
}

.bootstrap-step-fade {
  animation: bootstrap-step-switch 0.4s ease-out;
}

.bootstrap-dots {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.bootstrap-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--aw-color-border, #d1d5db);
  transition: background 0.3s, transform 0.3s;
}

.bootstrap-dot--active {
  background: var(--aw-color-accent);
}

.bootstrap-dot--current {
  transform: scale(1.3);
  animation: bootstrap-dot-pulse 1.5s ease-in-out infinite;
}

@keyframes bootstrap-dot-pulse {
  0%, 100% { transform: scale(1.3); opacity: 1; }
  50% { transform: scale(1); opacity: 0.6; }
}

.bootstrap-progress--complete .bootstrap-progress-step {
  font-size: 1rem;
  font-weight: 600;
  color: var(--aw-color-accent);
}

.bootstrap-progress--error .bootstrap-progress-step {
  color: var(--aw-color-error, #ef4444);
}

.bootstrap-progress--error .bootstrap-progress-spinner .tool-spinner {
  border-color: var(--aw-color-error, #ef4444);
  border-top-color: transparent;
}

@keyframes bootstrap-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bootstrap-step-switch {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Notification Messages ─────────────────── */

.chat-bubble.assistant.notification {
  background: var(--aw-color-info-bg-alt);
  border-left: 3px solid var(--aw-color-info-text-alt);
}

.chat-bubble.assistant.notification::before {
  content: "\1F514 ";
}

/* ── Toast Notifications ───────────────────── */

#notificationToasts {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  pointer-events: none;
}

.notification-toast {
  pointer-events: auto;
  background: var(--aw-color-bg-primary);
  border: 1px solid var(--aw-color-border-separator);
  border-left: 4px solid var(--aw-color-info-text-alt);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  animation: toast-slide-in 0.3s ease-out;
  transition: opacity 0.2s;
}

.notification-toast.priority-high,
.notification-toast.priority-urgent {
  border-left-color: var(--aw-color-error);
}

.notification-toast-header {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 4px;
}

.notification-toast-subject {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--aw-color-gray-darker);
  margin-bottom: 2px;
}

.notification-toast-body {
  font-size: 0.82rem;
  color: var(--aw-color-gray-text);
  line-height: 1.4;
}

@keyframes toast-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification-toast-exit {
  animation: toast-slide-out 0.3s ease-in forwards;
}

@keyframes toast-slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ── Infinite Scroll (Chat History Pagination) ── */

.chat-load-sentinel {
  height: 1px;
  width: 100%;
}

.chat-load-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  color: var(--aw-color-text-placeholder);
  font-size: 0.8rem;
}

/* ── Image Input ─────────────────────────── */

.image-preview-bar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  flex-shrink: 0;
}

.image-preview-item {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--aw-color-border-medium);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: var(--aw-color-bg-primary);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.image-preview-remove:hover {
  background: rgba(0, 0, 0, 0.75);
}

.chat-attach-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--aw-color-border, #ddd);
  border-radius: 50%;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--aw-color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.chat-attach-btn:hover {
  background: var(--aw-color-bg-hover);
  color: var(--aw-color-accent);
  border-color: var(--aw-color-accent);
}

/* ── Chat Input Row (legacy / fallback) ──────── */

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex: 1;
}

/* ── Chat Image Display ──────────────────── */

.chat-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.chat-attached-image {
  max-width: 300px;
  max-height: 200px;
  border-radius: 8px;
  cursor: pointer;
  object-fit: contain;
}

.chat-attached-image:hover {
  opacity: 0.9;
}

.chat-attached-image-error {
  min-width: 160px;
  min-height: 96px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.08) 8px,
    rgba(255, 255, 255, 0.02) 8px,
    rgba(255, 255, 255, 0.02) 16px
  );
  border: 1px dashed var(--aw-color-border, #666);
}

.chat-bubble.user .chat-text:empty {
  display: none;
}

/* ── Drag & Drop Overlay ─────────────────── */

.image-drag-over {
  outline: 2px dashed var(--aw-color-accent);
  outline-offset: -4px;
  background: rgba(37, 99, 235, 0.05);
}

/* ── Image Lightbox ──────────────────────── */

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.image-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

/* ── Bustup Image Overlay ────────────────── */

.bustup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bustup-overlay.visible {
  opacity: 1;
}

.bustup-overlay.hiding {
  opacity: 0;
}

.bustup-overlay-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  pointer-events: none;
}

/* ── Tool Call Group (collapsible wrapper) ──────── */

.tool-call-group {
  margin-top: 6px;
}

.tool-call-group-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--aw-color-tool-bg);
  cursor: pointer;
  user-select: none;
  font-size: 0.78rem;
  color: var(--aw-color-tool-text);
}

.tool-call-group-header:hover,
.tool-call-group-header:active {
  background: var(--aw-color-tool-border);
}

.tool-call-group-icon {
  flex-shrink: 0;
  font-size: 0.65rem;
  transition: transform 0.15s ease;
}

.tool-call-group.expanded .tool-call-group-icon {
  transform: rotate(90deg);
}

.tool-call-group-label {
  font-weight: 600;
}

.tool-group-error-badge {
  color: var(--aw-color-danger-text, #c0392b);
  font-weight: 700;
}

.tool-call-group-body {
  padding-left: 4px;
  margin-top: 2px;
}

/* ── Tool Call Indicators (Collapsed) ──────── */

.tool-call-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 10px;
  background: var(--aw-color-warning-bg);
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--aw-color-warning-text);
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.tool-call-row:hover,
.tool-call-row:active {
  background: var(--aw-color-warning-border);
}

.tool-call-row.expanded {
  background: var(--aw-color-warning-border);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.tool-call-row-icon {
  flex-shrink: 0;
  font-size: 0.72rem;
  transition: transform 0.15s;
}

.tool-call-row.expanded .tool-call-row-icon {
  transform: rotate(90deg);
}

.tool-call-row-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-call-error {
  background: var(--aw-color-error-bg);
  color: var(--aw-color-error-text);
}

.tool-call-error:hover,
.tool-call-error:active {
  background: var(--aw-color-error-border);
}

.tool-call-error.expanded {
  background: var(--aw-color-error-border);
}

/* ── Tool Call Detail (Expanded) ──────────── */

.tool-call-detail {
  padding: 8px 10px;
  background: var(--aw-color-warning-bg-alt);
  border: 1px solid var(--aw-color-warning-border);
  border-top: none;
  border-radius: 0 0 4px 4px;
  font-size: 0.78rem;
  margin-bottom: 4px;
  animation: activitySlideDown 0.15s ease-out;
}

.tool-call-error + .tool-call-detail {
  background: var(--aw-color-error-bg-alt);
  border-color: var(--aw-color-error-border);
}

.tool-call-label {
  font-weight: 600;
  color: #78716c;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 6px;
  margin-bottom: 2px;
}

.tool-call-label:first-child {
  margin-top: 0;
}

.tool-call-content {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  padding: 4px 6px;
  background: var(--aw-color-tool-content-bg);
  border-radius: 3px;
  max-height: 200px;
  overflow-y: auto;
}

.tool-call-show-more {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border: 1px solid #d6d3d1;
  border-radius: 4px;
  background: transparent;
  font-size: 0.72rem;
  color: #78716c;
  cursor: pointer;
  transition: all 0.15s;
}

.tool-call-show-more:hover,
.tool-call-show-more:active {
  background: #f5f5f4;
  color: #44403c;
  border-color: #a8a29e;
}

@keyframes activitySlideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 500px; }
}

/* ── Session Dividers ────────────────────── */

.session-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  color: var(--aw-color-text-placeholder);
  font-size: 0.72rem;
}

.session-divider::before,
.session-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--aw-color-border-separator);
}

.session-divider-label {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.session-divider-heartbeat .session-divider-label {
  padding: 1px 8px;
  background: var(--aw-color-success-bg-alt);
  border: 1px solid var(--aw-color-success-border);
  border-radius: 999px;
  color: var(--aw-color-success-text);
  font-size: 0.7rem;
}

.session-divider-cron .session-divider-label {
  padding: 1px 8px;
  background: var(--aw-color-info-bg-alt);
  border: 1px solid var(--aw-color-info-border);
  border-radius: 999px;
  color: var(--aw-color-info-text);
  font-size: 0.7rem;
}

/* ── Background Session Groups (collapsible) ── */

.bg-session-group {
  margin: 8px 0;
}

.bg-session-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  user-select: none;
  transition: filter 0.1s ease;
  width: fit-content;
  max-width: 70%;
  min-width: 200px;
}

.bg-session-header:hover,
.bg-session-header:active {
  filter: brightness(0.92);
}

.bg-session-chevron {
  flex-shrink: 0;
  font-size: 0.6rem;
  transition: transform 0.15s ease;
  opacity: 0.7;
}

.bg-session-group.expanded .bg-session-chevron {
  transform: rotate(90deg);
}

.bg-session-label {
  font-weight: 500;
  white-space: nowrap;
}

.bg-session-time {
  margin-left: auto;
  opacity: 0.6;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bg-session-body {
  padding: 6px 12px 6px 22px;
  margin-top: 2px;
  font-size: 0.82rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--aw-color-text-muted);
}

/* Heartbeat / Task body - markdown content */
.bg-session-group--heartbeat .bg-session-body,
.bg-session-group--task .bg-session-body {
  max-height: 400px;
  overflow-y: auto;
}

.bg-session-message {
  margin-bottom: 8px;
}

.bg-session-message:last-child {
  margin-bottom: 0;
}

/* Cron/Task body - compact item list */
.bg-session-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  opacity: 0.85;
}

.bg-session-item-ts {
  margin-left: auto;
  font-size: 0.68rem;
  opacity: 0.5;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Type-specific header colors (subtle tints) ── */

.bg-session-header--heartbeat {
  background: color-mix(in srgb, var(--aw-color-success-text, #68d391) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--aw-color-success-text, #68d391) 15%, transparent);
  color: var(--aw-color-text-muted);
}

.bg-session-header--cron {
  background: color-mix(in srgb, var(--aw-color-info-text, #63b3ed) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--aw-color-info-text, #63b3ed) 15%, transparent);
  color: var(--aw-color-text-muted);
}

.bg-session-header--task {
  background: color-mix(in srgb, var(--aw-color-accent, #b794f4) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--aw-color-accent, #b794f4) 15%, transparent);
  color: var(--aw-color-text-muted);
}

/* ── History Loading More (Infinite Scroll) ── */

.history-loading-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  color: var(--aw-color-text-placeholder);
  font-size: 0.8rem;
}

.history-loading-more .tool-spinner {
  border-color: var(--aw-color-text-placeholder);
  border-top-color: transparent;
}

/* ── Thinking Block ──────────────────────── */

.thinking-block {
  margin-bottom: 8px;
  border: 1px solid var(--aw-color-border);
  border-radius: 6px;
  overflow: hidden;
}

.thinking-summary {
  cursor: pointer;
  padding: 6px 10px;
  background: var(--aw-color-bg-secondary, #f8f9fa);
  font-size: 0.82rem;
  color: var(--aw-color-text-secondary);
  user-select: none;
  list-style: none;
}

.thinking-summary:hover {
  background: var(--aw-color-bg-hover, #eef0f2);
}

.thinking-summary:active {
  background: var(--aw-color-bg-active, #e2e4e6);
}

.thinking-summary::-webkit-details-marker {
  display: none;
}

.thinking-summary::before {
  content: "▸ ";
  transition: transform 0.15s;
}

.thinking-block[open] .thinking-summary::before {
  content: "▾ ";
}

.thinking-icon {
  margin-right: 4px;
}

.thinking-content {
  padding: 8px 10px;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--aw-color-text-secondary);
  background: var(--aw-color-bg-tertiary, #f0f1f3);
  word-wrap: break-word;
  max-height: 300px;
  overflow-y: auto;
}

.thinking-content p { margin: 0 0 0.5em; }
.thinking-content p:last-child { margin-bottom: 0; }
.thinking-content code { font-size: 0.78rem; }
.thinking-content pre { font-size: 0.75rem; margin: 0.5em 0; overflow-x: auto; }

/* Inline preview while thinking (hidden once main text arrives) */
.thinking-inline-preview {
  margin-bottom: 8px;
  color: var(--aw-color-text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  font-style: italic;
  max-height: calc(1.5em * 5);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--aw-color-border-medium) transparent;
}
.thinking-inline-preview::-webkit-scrollbar { width: 4px; }
.thinking-inline-preview::-webkit-scrollbar-thumb {
  background: var(--aw-color-border-medium);
  border-radius: 2px;
}
.thinking-inline-preview::-webkit-scrollbar-track { background: transparent; }

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
  .thinking-summary {
    background: var(--aw-color-bg-secondary, #2a2d32);
  }
  .thinking-summary:hover {
    background: var(--aw-color-bg-hover, #33363c);
  }
  .thinking-summary:active {
    background: var(--aw-color-bg-active, #3c3f45);
  }
  .thinking-content {
    background: var(--aw-color-bg-tertiary, #1e2126);
  }
}

[data-theme="dark"] .thinking-summary {
  background: var(--aw-color-bg-secondary, #2a2d32);
}

[data-theme="dark"] .thinking-summary:hover {
  background: var(--aw-color-bg-hover, #33363c);
}

[data-theme="dark"] .thinking-summary:active {
  background: var(--aw-color-bg-active, #3c3f45);
}

[data-theme="dark"] .thinking-content {
  background: var(--aw-color-bg-tertiary, #1e2126);
}

/* ── Text Artifact Card ──────────────────────────── */

.text-artifact-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin: 4px 0;
  background: var(--aw-color-code-bg);
  border: 1px solid var(--aw-color-border-dark);
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.15s;
  max-width: 100%;
}

.text-artifact-card:hover,
.text-artifact-card:active {
  filter: brightness(1.2);
}

.text-artifact-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.text-artifact-name {
  color: var(--aw-color-code-text);
  font-size: 0.88rem;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Text Artifact Modal ─────────────────────────── */

.text-artifact-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 16px;
}

.text-artifact-modal {
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  max-height: 85vh;
  background: var(--aw-color-bg-primary);
  border: 1px solid var(--aw-color-border-medium);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.text-artifact-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--aw-color-border);
  background: var(--aw-color-bg-secondary);
}

.text-artifact-modal-filename {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--aw-color-text-primary);
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-artifact-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--aw-color-text-muted);
  padding: 0 4px;
  line-height: 1;
}

.text-artifact-modal-close:hover,
.text-artifact-modal-close:active {
  color: var(--aw-color-text-primary);
}

.text-artifact-modal-body {
  flex: 1;
  min-height: 0;
  padding: 0;
}

.text-artifact-modal-textarea {
  width: 100%;
  height: 100%;
  min-height: 200px;
  max-height: 60vh;
  resize: vertical;
  border: none;
  outline: none;
  padding: 16px;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--aw-color-text-primary);
  background: var(--aw-color-bg-primary);
  tab-size: 4;
}

.text-artifact-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--aw-color-border);
  background: var(--aw-color-bg-secondary);
}

.text-artifact-btn {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  border: 1px solid var(--aw-color-border-medium);
  background: var(--aw-color-bg-primary);
  color: var(--aw-color-text-primary);
  transition: background 0.15s;
}

.text-artifact-btn:hover,
.text-artifact-btn:active {
  background: var(--aw-color-bg-hover);
}

.text-artifact-btn-download {
  background: var(--aw-color-accent);
  color: #fff;
  border-color: var(--aw-color-accent);
}

.text-artifact-btn-download:hover,
.text-artifact-btn-download:active {
  background: var(--aw-color-accent-hover);
}

@media (max-width: 600px) {
  .text-artifact-modal-overlay {
    padding: 8px;
  }
  .text-artifact-modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 8px;
  }
  .text-artifact-modal-textarea {
    max-height: 70vh;
  }
}

/* ── Mobile: prevent auto-zoom on input focus ── */
@media (max-width: 768px) {
  .chat-input {
    font-size: 16px;
  }
}

/* ============================================
   Multi-Pane Host & Splitter
   ============================================ */

.chat-pane-host {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.chat-pane {
  display: flex;
  flex: 1 0 0%;
  min-width: 0;
  overflow: hidden;
  position: relative;
  transition: box-shadow 0.15s;
}

.chat-pane .chat-page-main {
  flex: 1;
  min-width: 0;
}

.chat-pane.focused {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--aw-color-accent) 40%, transparent 60%);
  z-index: 1;
}

.chat-pane:only-child.focused {
  box-shadow: none;
}

/* ── Stream-done flash (non-focused pane) ── */

@keyframes pane-done-flash {
  0%   { background: transparent; }
  30%  { background: color-mix(in srgb, var(--aw-color-accent) 12%, transparent); }
  100% { background: transparent; }
}

.chat-pane.stream-done-flash {
  animation: pane-done-flash 1.2s ease-out;
}

/* ── Splitter ─────────────────────────── */

.chat-pane-splitter {
  width: 5px;
  flex-shrink: 0;
  cursor: col-resize;
  background: var(--aw-color-border-light, #e5e7eb);
  position: relative;
  z-index: 2;
  transition: background 0.15s;
}

.chat-pane-splitter:hover,
.chat-pane-splitter:active,
.chat-pane-splitter.active {
  background: var(--aw-color-accent, #3b82f6);
}

.chat-pane-splitter::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 24px;
  border-radius: 2px;
  background: var(--aw-color-text-muted, #9ca3af);
  opacity: 0;
  transition: opacity 0.15s;
}

.chat-pane-splitter:hover::before,
.chat-pane-splitter.active::before {
  opacity: 0.6;
}

/* ── Mobile: single pane only ─────────── */
@media (max-width: 768px) {
  .chat-pane-host {
    flex-direction: column;
  }

  .chat-pane-splitter {
    display: none;
  }

  .chat-pane:not(.focused) {
    display: none;
  }

  .chat-pane.focused {
    box-shadow: none;
  }

  .chat-split-pane-btn,
  .chat-close-pane-btn {
    display: none !important;
  }
}

/* ── Demo Suggest Cards ──────────────────── */

.demo-suggest-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  gap: 1.5rem;
}

.demo-suggest-header {
  text-align: center;
}

.demo-suggest-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--aw-color-text-primary);
  margin: 0 0 0.25rem;
}

.demo-suggest-header p {
  font-size: 0.85rem;
  color: var(--aw-color-text-muted);
  margin: 0;
}

.demo-suggest-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  max-width: 560px;
  width: 100%;
}

.demo-suggest-card {
  background: var(--aw-color-bg-secondary);
  border: 1px solid var(--aw-color-border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  text-align: left;
  font-size: 0.88rem;
  color: var(--aw-color-text-primary);
  line-height: 1.45;
  transition: border-color 0.15s, background 0.15s;
}

.demo-suggest-card:hover,
.demo-suggest-card:active {
  border-color: var(--aw-color-accent);
  background: var(--aw-color-bg-hover, var(--aw-color-bg-secondary));
}

/* ── Demo Prompt Chips ───────────────────── */

.chat-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem 0;
  overflow: hidden;
  max-height: 4rem;
}

.chat-prompt-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: var(--aw-color-bg-secondary);
  border: 1px solid var(--aw-color-border);
  color: var(--aw-color-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.chat-prompt-chip:hover,
.chat-prompt-chip:active {
  border-color: var(--aw-color-accent);
  color: var(--aw-color-text-primary);
}

@media (max-width: 640px) {
  .demo-suggest-grid {
    grid-template-columns: 1fr;
  }
}
