.chat-analysis-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 28px;
  padding: 4px 0;
  background: transparent;
  border: none;
  border-radius: 0;
  flex-shrink: 0;
}

.chat-analysis-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
  font-size: 13px;
  font-weight: 600;

  &:hover {
    color: var(--text-primary);
  }
}

.chat-analysis-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);

  .chat-analysis-breadcrumb-separator {
    opacity: 0.6;
  }
}

.chat-analysis-dropdown {
  position: relative;
}

.chat-analysis-current-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.2s ease;

  .current {
    color: var(--text-primary);
  }

  svg {
    transition: transform 0.2s ease;
  }

  &:hover {
    color: var(--text-primary);
  }

  &.open svg {
    transform: rotate(180deg);
  }
}

.chat-analysis-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 120px;
  padding: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  z-index: 20;
}

.chat-analysis-menu-item {
  width: 100%;
  display: block;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;

  &:hover {
    background: var(--bg-hover);
    color: var(--primary);
  }
}

.chat-analysis-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .chat-analysis-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .chat-analysis-breadcrumb {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .chat-analysis-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
